Reference
Command line
The treason command: alerts, waiting, heartbeats, wrapping commands, verifying webhooks.
The CLI ships in the SDK package.
npm install -g @treason/sdk # or: npx treason ...
export TREASON_API_KEY=trk_...
export TREASON_API_URL=https://api.treason.appGlobal options: --json (machine-readable output), --api-key, --api-url, -h/--help, -v/--version.
Exit codes: 0 success, 1 error, 2 you asked for an answer and did not get one in time (alert create --wait). treason run passes the wrapped command's exit code through.
#Alerts
treason alert create "Disk almost full" --alias disk:db1 --priority P1 \
--tag prod --detail host=db1 --detail free=3%
treason alert create "Approve deploy?" --alias deploy-42 --wait 10m # wait for a human
treason alert get <id> # events and every notification attempt
treason alert ack <id> treason alert close <id> treason alert note <id> "restarted the pod"
treason alerts --status open --limit 20--wait takes a duration (30s, 5m, 2h, 1d) and defaults to five minutes.
treason alert snooze <id> --for 30m # acknowledged now; pages again if still open after 30 minutes#Noise control
See Noise control for what each does.
treason maintenance start "Deploy v42" --for 2h --tag env:staging # hold matching alerts while you work
treason maintenance list --active
treason maintenance end <id> # what it held pages now
treason rules list # routing rules, in the order they run
treason report noise --days 30 # which alerts are noise, with suggestions
treason report noise --days 30 --apply # create the rules it suggests#Alert sources
treason integration create "Prod Datadog" --source datadog --team <team-id> # prints the URL to give Datadog
treason integration list
treason integration preview --source datadog payload.json # what would this payload do?See Alert sources for each tool's setup.
#On call
treason oncall payments
treason oncall payments --at 2026-12-24T09:00:00Z#Heartbeats
treason heartbeat set nightly --every 1d --grace 15m --priority P1 --message "Nightly job did not report in" # admin key
treason heartbeat ping nightly
treason heartbeat list
treason heartbeat delete nightly#Wrap a command
treason run --heartbeat nightly -- ./job.sh
treason run --heartbeat nightly --alert "Nightly job failed" --priority P1 -- ./job.sh- Success: pings the heartbeat and closes the open alert with the same alias.
- Failure: opens the alert (alias derived from the message, or
--alias) with the exit code and the last 3,000 characters of output. - If reporting to treason.app itself fails, that is printed, and the command's own exit code is still returned.
#Webhooks
treason webhook verify --secret "$TREASON_WEBHOOK_SECRET" --signature "t=...,v1=..." payload.json
treason webhook verify --secret ... --signature ... < payload.jsonOffline: needs no API key. Add --tolerance 1h to accept older timestamps while debugging.
#Check your key
treason whoami # Acme (beta)