Skip to content
CLIWaitlist open

Ask a person from any shell script

finalsay ask sends the question to your phone and waits. The exit code is the answer.

release.sh
finalsay ask "Deploy v2.3 to production?" -c "$(git log -1 --stat)" --wait && ./deploy.sh

Set it up

  1. Install it

    Node 20 or later.

    sh
    npm i -g finalsay
  2. Sign in

    Run finalsay login on your machine, or set FINALSAY_API_KEY and FINALSAY_AGENT_ID in CI.

    sh
    finalsay login
  3. Ask, and wait for the answer

    sh
    finalsay ask "Run the migration on prod?" --wait
    echo $?   # 0 approved · 3 another option · 4 instruction · 5 expired

See it work

Answer it yourself. Nothing here talks to a server.

Interactive demo: answer an agent’s approval request

  1. Tap the notification
  2. Pick an answer
  3. See what the agent does
~/code/app · zshpaused
$ ./release.sh v2.3.0
✓ 412 tests passed
✓ built registry/app:v2.3.0
$ finalsay ask "Deploy v2.3.0 to production?" -c "$(git log --oneline v2.2.4..HEAD)" \ -o "Deploy=deploy" -o "Canary first=canary" -o "Hold=hold" \ --summary "v2.3.0 → production" --expires-in 600 \ --expire-instruction "Hold. Retry after the 16:00 freeze ends." --wait --json > decision.json
Waiting for approval in FinalSay…
release.sh (continued)
code=$?
choice=$(jq -r '.selected_option_value // empty' decision.json)
case "$code:$choice" in
  0:*)       ./deploy.sh production ;;
  3:canary)  ./deploy.sh canary ;;
  3:hold)    echo "Not deploying: hold" ;;
  4:*)       echo "Instruction: $(jq -r .custom_instruction decision.json)"; exit 1 ;;
  5:*)       echo "Expired: $(jq -r .custom_instruction decision.json)"; exit 1 ;;
  *)         exit 1 ;;
esac
Release botnowDeploy v2.3.0 to production?12 commits since v2.2.4. Tests: 412 passed.

Exit codes

CodeMeaning
0Approved: the approving option was chosen (the first option, or --approve-value).
1Error: network, auth, not found, rate or plan limit, idempotency conflict.
2Usage error: bad flags, missing config, a payload over a limit.
3Another option was chosen.
4The reviewer sent a custom instruction.
5Expired with no answer.
6Still pending (status, or --max-wait reached).
130Interrupted with Ctrl-C. The approval stays open; resume with finalsay wait.

Details

Useful flags
-o, --option
An option as Label=value. Up to four. Approve and Reject if you set none.
-c, --context / --context-file
Markdown context, up to 2,500 characters. --context-file - reads stdin.
--wait, --max-wait
Block for the answer
--approve-value
Which option exits 0. The first one by default.
--summary
The push notification title
--expires-in, --expire-instruction
The timeout in seconds
--json
Print the result as JSON
JSON output

ask --wait --json, wait --json and status --json print the API result plus two fields the CLI adds: outcome and exit_code.

decision.json
{
  "request_id": "5b1c…",
  "status": "selected_option",
  "selected_option_index": 0,
  "selected_option_label": "Approve",
  "selected_option_value": "approve",
  "custom_instruction": null,
  "resolved_by": { "user_id": "…", "name": "Ana" },
  "resolved_at": "2026-11-15T10:01:00.000Z",
  "outcome": "approved",
  "exit_code": 0
}
In CI

The commit message goes through an environment variable, never straight into the script.

.github/workflows/deploy.yml
- name: Ask before deploying
  env:
    FINALSAY_API_KEY: ${{ secrets.FINALSAY_API_KEY }}
    FINALSAY_AGENT_ID: ${{ vars.FINALSAY_AGENT_ID }}
    COMMIT_MSG: ${{ github.event.head_commit.message }}
  run: |
    npx finalsay ask "Deploy ${GITHUB_SHA::7} to production?" -c "$COMMIT_MSG" --wait --max-wait 900
For coding agents

Drop skill/SKILL.md into .claude/skills/finalsay/ or your agent’s skills folder, or paste AGENTS.md into your AGENTS.md or CLAUDE.md. The agent learns when to ask and how to read the answer. Codex, Cursor, Aider and any agent that runs shell commands can use it.

Good to know
  • Polls from every 2 seconds, backing off to every 15, until someone answers or it stops waiting.
  • Network errors and server errors are retried while it waits.
  • The API key never goes on the command line, so it stays out of your shell history.

Questions

What if the CI job times out first?

--max-wait exits 6 and the approval stays open. Resume later with finalsay wait and the request ID.

Where is my key stored?

In ~/.config/finalsay/config.json, mode 0600. Environment variables and flags override it.

Can I pick which option means approved?

Yes, with --approve-value. Otherwise the first option exits 0.

Can I ask without waiting?

Yes. ask prints the request ID right away; run finalsay wait or finalsay status later.

Get it the day it opens

Free to start. You’ll get one email, the day it opens.

Which integration will you use first?