finalsay CLI when your agent or script runs shell commands: coding agents (Claude Code, Codex, Cursor, Aider),
CI jobs, git hooks, cron, deploy scripts. finalsay ask creates an approval and, with --wait, blocks until someone
answers in the mobile app or web dashboard. The exit code tells the caller what they decided.
Install and sign in
npx finalsay ask …. For CI and agents, skip login and set environment variables:
Flags override environment variables, which override the saved login. The login is saved to
$XDG_CONFIG_HOME/finalsay/config.json (usually ~/.config/finalsay/config.json), readable only by you. There is
deliberately no flag for the API key, so it never lands in shell history. login needs an interactive terminal.
Ask
Limits are checked before anything is sent, with the same schema the API uses. A payload over a limit exits
2.
Without --wait, ask prints the request ID and exits 0 once the approval is created.
Other commands
Every command takes
--api-url, and every command except mcp takes --json.
Exit codes
These codes are stable. Scripts and hooks can rely on them.
JSON output
With--json, ask --wait, wait and status print the approval result
plus two fields:
outcome:approved,other_option,custom_instruction,expiredorpendingexit_code
custom_instruction holds the fallback. Errors print
{ "error", "message", "exit_code" }.
Waiting and polling
--wait polls every 2 seconds at first, backing off by 1.5× to every 15 seconds. It stops at the approval’s
expires_at (plus 30 seconds for the server to mark it expired) or at --max-wait, whichever comes first. Network
errors, 429 and server errors are retried; it gives up after 10 errors in a row. Each request times out after 30
seconds.
Many agent shells time out long-running commands. Either run finalsay ask --wait in the background, or create
without --wait and call finalsay wait <request_id> later.
Next
- Claude Code and Codex: the skill file,
AGENTS.md, and a hook that gates risky commands. - CI and GitHub Actions: gate a deploy job.