dial
GUIDE · Automate & share — updated 2026-11-26

Script Dial and run it in CI

Dial runs without its terminal UI too: one prompt in, one answer out. Pipe it into scripts, get JSON or a schema-checked answer, review changes in CI, or run a prompt on a schedule. The same approvals and sandbox apply.

dial -p "summarize what changed in this branch"
git diff | dial -p "review this diff for bugs"
dial -p --image screenshot.png "what is wrong with this layout?"

Words after -p form the prompt, and piped input is added as context. dial -c continues the last session instead of starting a new one, and -o FILE also writes the final answer to a file.

Approvals without a person

Nobody is there to approve, so calls that need consent are refused. Allow the tools the job needs by name, or everything with -y:

dial -p --allow read,edit "fix the lint errors"
dial -p -y "update the snapshots and run the tests"

Prefer --allow: read-only mode and deny rules still win over it. Pair it with the sandbox on machines you care about.

JSON and streaming output

dial -p --output-format json "list the TODOs" | jq .
dial -p --output-format stream-json "run the tests"

json prints one result object with the session ID, the answer, tool outcomes, token usage and duration. stream-json prints one event per line (text, tools, todos, notices, usage) and then the result. In both, stdout carries only JSON.

Structured answers from a JSON Schema

cat > risk.json <<'EOF'
{"type":"object","required":["risk","reasons"],
 "properties":{"risk":{"enum":["low","medium","high"]},
               "reasons":{"type":"array","items":{"type":"string"}}}}
EOF
dial -p --output-schema risk.json "rate the risk of the uncommitted changes"

The schema is checked before any model call, and the answer is validated against it, with a few chances to correct itself. On success stdout carries the compact JSON; if it still doesn't match, nothing is printed and the run exits 2.

Exit codes

CodeMeaning
0Completed
1Error
2Incomplete, blocked, needs input, no answer or interrupted
3A required tool approval was denied (wins over 2)

Review in CI

dial review runs the /review workflow without the UI, strictly read-only:

dial review                      # uncommitted changes
dial review --base main           # this branch against main
dial review --commit abc123
dial review --base main --output-format json -o review.json

In a pipeline, run Dial from the container so nothing needs installing on the runner:

docker run --rm -v "$PWD":/workspace -e ANTHROPIC_API_KEY \
  ghcr.io/kiidxatlas/dial -p -y "summarize this repo"

Pass API keys as secrets in the environment, never on the command line. On Linux the prompt is hidden from ps once read; elsewhere, pass it on stdin to keep it out of the process list.

Run on a schedule

dial schedule add "check for flaky tests and report" --every 30m --watch 'src/**/*.rs' --allow read

/schedule list|add|remove|log|run manages schedules from inside a session. For editors and other programs, dial rpc and dial acp speak JSON over stdio; see RPC and ACP.