athena-flow exec "<prompt>"
Runs Athena non-interactively. No TUI, no input bar. Designed for CI pipelines and scripts.
| Flag | Description | Default |
|---|
--json | Emit JSONL events to stdout | off |
--output-last-message=<path> | Write final assistant message to file | — |
--ephemeral | Don't persist session data | off |
--on-permission=<policy> | Permission request policy | fail |
--on-question=<policy> | AskUserQuestion policy | fail |
--timeout-ms=<ms> | Hard timeout for the run | — |
--continue[=<sessionId>] | Resume most recent or specific session | — |
| Value | Behavior |
|---|
allow | Automatically allow all |
deny | Automatically deny all |
fail | Fail the run on any request (default) |
| Value | Behavior |
|---|
empty | Respond with empty string |
fail | Fail the run on any question (default) |
# CI-friendly: JSON output, auto-deny permissions, ignore questions
athena-flow exec "run tests" --json --on-permission=deny --on-question=empty
# With timeout
athena-flow exec "lint all files" --timeout-ms=60000
# Ephemeral (no session persistence)
athena-flow exec "check for security issues" --ephemeral
# Save the final message
athena-flow exec "summarize changes" --output-last-message=./summary.txt
# Continue a previous session
athena-flow exec "continue previous work" --continue
- name: Run Athena
run: |
npx @athenaflow/cli exec "run all tests and report results" \
--json \
--on-permission=deny \
--on-question=empty \
--timeout-ms=300000 \
--ephemeral
athena-test:
script:
- npx @athenaflow/cli exec "run all tests and report results"
--json
--on-permission=deny
--on-question=empty
--timeout-ms=300000
--ephemeral
| Code | Meaning |
|---|
| 0 | Success |
| 1 | General error |
| 2 | Permission request with --on-permission=fail |
| 3 | Question with --on-question=fail |
| 4 | Timeout |
| 5 | Agent error |
| 6 | Session not found (for --continue) |
| 7 | Hook registration failure |
All standard flags (--workflow, --isolation, --plugin, --project-dir, --model) also work in exec mode.