Headless: phr ask
One request, no interaction — for scripts, CI and other programs.
phr ask "summarize the open TODOs in this repo"
git diff | phr ask "review this diff" # the request can come from stdin
phr ask --output-format json "run the tests and report"
phr ask --output-format stream-json "build it" | jq .| --output-format | What you get |
|---|---|
| text (default) | the final answer on stdout; progress on stderr |
| json | one object: the answer, the stop reason, the cost and the session id |
| stream-json | every engine event as one JSON line — the same events the server streams |
| Option | Meaning |
|---|---|
| --cwd <folder> | the project folder (default: the current one) |
| --mode <mode> | permission mode; actions that would need approval are refused unless --mode bypass |
| --effort <level> | fast · balanced · deep |
| --resume <id> · --continue | continue a conversation |
| --budget <usd> · --max-calls <n> | stop at a spend cap or a number of steps |
| --allowed-tools · --disallowed-tools | comma-separated tool names |
| --append-system-prompt <text> | extra instructions for this run |
| --no-browser · --no-mcp | leave the browser or MCP servers out |
| --quiet | no progress on stderr |
Was this page helpful?