Production actions, from your terminal.
Invoke actions, approve what your agents are waiting on and read the record, from a shell, a script or CI. The same permissions, policies and approvals as the API and the dashboard, enforced on the server.
$ npm install -g @anlyonhq/cli
$ anlyon auth login
Log in. Invoke. Wait for a yes.
A refund that needs approval waits in the terminal exactly as it would in the SDK, and the result is read back when a person decides.
Same rules as everywhere else. A terminal can't do anything the dashboard wouldn't let it.
The CLI submits requests. Policy evaluation, approvals and the provider call stay on Anlyon.
The server decides, not your terminal
Every command runs with the permissions of the credential you logged in with. An invoke that needs approval waits for a person, exactly as it would from the SDK.
$ anlyon actions invoke refund_payment --wait 10m
→ waiting for approval
Safe to run twice
Every write carries an idempotency key: yours, or one the CLI generates and prints. Re-run an interrupted command with the same key and you get the recorded result, never a second refund.
$ anlyon actions invoke refund_payment --idempotency-key refund-42
→ recorded result returned
No key in your shell history
Browser login is OAuth 2.1 with PKCE, and the refresh token lives in your OS credential store. API keys are piped in on stdin, never read from argv. Output masks credentials and anything shaped like a key or token.
$ anlyon auth login
→ stored in the OS credential store
It can't approve its own request
Deciding needs a scope you grant on the consent screen, and a credential can never decide an approval it requested. Not the API key, and not the CLI login that asked for it.
$ anlyon approvals approve apr_91Kd
→ a credential cannot decide its own request
Pinned to one environment
--environment asserts the target and never switches it. If a login now resolves somewhere else, the command stops with exit 10 instead of guessing.
$ anlyon whoami --environment production
→ exit 10 on a target mismatch
Built to be scripted
--json puts exactly one JSON document on stdout. Progress and errors go to stderr, and exit codes say whether an action is pending, failed, or may have happened.
$ anlyon actions invoke refund_payment --json
→ one JSON document on stdout
Exit codes your pipeline can branch on. Pending and unknown each get their own code.
Set ANLYON_API_KEY, pass --yes, and the exit code tells the job what happened.
- 0
- Succeeded
- 3
- Not logged in, or the credential was rejected
- 4
- Missing scope or role
- 10
- Target mismatch: wrong environment or binding
- 12
- Accepted, not finished: waiting for approval or running
- 13
- Outcome unknown. It may have happened: reconcile, don't retry
- 14
- Did not succeed: failed, denied or approval expired
- name: Refund via Anlyon env: ANLYON_API_KEY: ${{ secrets.ANLYON_API_KEY }} run: | set +e npx @anlyonhq/cli actions invoke refund_payment \ --data '{"charge":"ch_3P9x","amount":1200}' \ --idempotency-key "refund-${{ github.run_id }}" \ --wait 10m --yes --json > result.json code=$? case $code in 0) echo "Refund succeeded" ;; 13) echo "Outcome unknown: reconcile before retrying"; exit 1 ;; *) exit $code ;; esacEvery command, by resource. Each one explains itself with --help.
Writes ask you to confirm before they run.
Account
01$anlyon auth login
Browser login, or an API key on stdin
$anlyon auth status | logout | scopes
What this login is and allows
$anlyon profile list | use <name>
Named targets, one per environment
$anlyon whoami
Who, which workspace, which environment
$anlyon doctor
Check config, credential and server
Actions
02$anlyon actions list | get <ref>
What your workspace has defined
$anlyon actions versions <ref>
Every published version
$anlyon actions invoke <ref> --data '…'write
Run it. Idempotent, and --wait follows an approval
$anlyon invocations list | get <id>
Each call and its outcome
$anlyon runs list | get <id>
Agent runs, filtered by status or agent
Approvals
03$anlyon approvals list --status pending
What is waiting on a person
$anlyon approvals get <id>
The exact request under review
$anlyon approvals approve <id> --note …write
Approve, with the reason on record
$anlyon approvals deny <id> --note …write
Deny, with the reason on record
Controls
04$anlyon policies list | get | versions
Approval policies and history
$anlyon effects list --unresolved
Governed effects still to reconcile
$anlyon impact-limits list | get <id>
Shared limits, consumed and reserved
Install in one line. One npm package, the SDK bundled in.
No runtime dependencies. Node 20.3 or later on macOS, Linux and Windows.
macOS
Login kept in login Keychain
Windows
Login kept in Credential Manager
Linux
Login kept in Secret Service (gnome-keyring, KWallet)
No shell? Give your agent the server instead.
- Claude Code
claude mcp add --transport http anlyon https://api.anlyon.com/mcp - Codex
codex mcp add anlyon --url https://api.anlyon.com/mcp - Cursor
"anlyon": { "url": "https://api.anlyon.com/mcp" }
Questions about the CLI. Install, scripting, credentials and what an exit code means.
anlyon is the command-line interface for Anlyon. It lets you log in, list and invoke actions, approve or deny pending approvals, and read invocations, runs, policies, effects and impact limits from a terminal, with the same permissions and execution guarantees as the API and the dashboard.
Run npm install -g @anlyonhq/cli (Node 20.3 or later), then anlyon auth login. pnpm add -g and bun add -g work too, and npx @anlyonhq/cli runs it without a global install.
Yes. Set ANLYON_API_KEY, pass --yes to confirm writes non-interactively, and use --json for one machine-readable document on stdout. Exit codes distinguish success (0), waiting for approval (12), an unknown outcome (13) and failure (14).
No. Deciding approvals needs the approvals:decide scope, and a credential can never decide an approval it requested: not the requesting API key, and not the CLI login that made the request. Decide those from the dashboard or a separate login.
If the destination may have received the request but the outcome can't be confirmed, the CLI exits 13. Do not retry with a new idempotency key. Reconcile first. Re-running with the same key returns the recorded result and never runs the action twice.
The refresh token is kept in the operating system's credential store: macOS Keychain, Windows Credential Manager or Linux Secret Service. Access tokens last 15 minutes and refresh automatically. An unused login expires after 7 days. On a headless machine use an API key.
The CLI is MIT-licensed and free to install. What it does counts against your workspace's plan the same way an API call would.
