CLI reference
Every command, flag, and exit code. All commands read from shotoku.config.json by default. Flags override the config file.
Global flags
These flags are available on every command and override the values in shotoku.config.json.
| Flag | What it does |
|---|---|
| --policy <path> | Path to the policy YAML file |
| --ledger <path> | Path to the decision ledger (JSONL) |
Precedence order: CLI flags → environment variables → config file → built-in defaults (policy.yaml and data/decisions.jsonl).
init
Scaffolds Shotoku in the target directory (defaults to the current directory). Creates three things:
shotoku.config.json— points to the policy file and ledger pathpolicy.yaml— a starter policy with OpenAI and Anthropic allowlisteddata/— directory where decisions will be recorded
Safe to re-run — it will not overwrite existing files.
authorize
Evaluates a single request against your policy and local ledger. Records the decision.
| Flag | Required | Description |
|---|---|---|
| --actor | yes | Agent identifier |
| --action | yes | One of: purchase, api_call, execute_code, send_email, mcp_tool, custom |
| --resource | yes | Target domain or service (e.g. api.openai.com) |
| --amount | no | Monetary amount in USD. Must be non-negative if provided. |
Exit codes: 0 if approved, 1 if denied or pending.
status
Shows all decisions currently waiting for human review, plus the most recent decision. Each pending entry includes the actor, resource, amount, age, and a hint to approve or deny.
history
Lists past decisions as a formatted table with ✓ / ✗ / ◷ icons and a summary line.
| Flag | Values | Description |
|---|---|---|
| --actor | any string | Filter to decisions made by this actor |
| --since | 24h · 7d · 30d | Rolling time window to filter by |
| --status | approved · denied · pending_approval | Filter by decision outcome |
decision
Shows the full record for a single decision — the original request, outcome, all reasons, and any associated approval or denial that followed.
approve
Approves a pending decision. Shotoku appends a new approval record — it never modifies the original decision. Both are preserved in the local ledger.
Fails with a clear error if the decision does not exist, is not pending, or was already actioned.
deny
Denies a pending decision. Same constraints and append-only behavior as approve.
tui
Launches the interactive terminal UI. Polls the ledger every 3 seconds and lets you navigate pending decisions with the keyboard. See the TUI guide →
snapshot
Creates and verifies cryptographically signed snapshots of your policy and ledger. Requires the SHOTOKU_SNAPSHOT_SECRET environment variable. See the Snapshots guide →