@chitmark/cli
v0.6.5
Published
CLI for Chitmark by Open Agent Ledger: trust decisions on agent-mediated actions (verify, feedback, challenge) from the terminal
Maintainers
Readme
@chitmark/cli
Terminal interface for Chitmark: trust decisions on agent-mediated actions (verify / feedback / challenge). Wraps @chitmark/sdk.
Score a signup from the command line, walk an interactive TUI, or script all three verbs in CI. Verdicts render as JSON with decision-coded exit codes.
Requires Node >= 24.
Install
npm install -g @chitmark/cliAuth
export CHITMARK_API_KEY=ck_live_...
# optional
export CHITMARK_BASE_URL=https://api.chitmark.comOr pass --api-key / --base-url per command.
Commands
Interactive mode (default)
On a terminal, chitmark verify with no flags opens an Ink TUI: pick an action with the arrow keys, walk through subject fields (email / IP are hashed client-side), review, and run. The verdict renders as a colored panel: green ALLOW, yellow CHALLENGE, red DENY, with confidence bar, reasons, principal, and a [v] toggle to inspect verdictToken claims.
chitmark verify # interactive
chitmark feedback # interactive: eventId, outcome, value (unit asked only with a value)
chitmark challenge # interactive: eventId, method, sessionIn the verdict panel: enter/q done, r re-run, c copy eventId, v claims.
Flag mode (scripting / CI)
Passing the required flags skips the TUI and prints JSON. Same on non-TTY (piped input) or with --json.
# Verify an action
chitmark verify \
--action signup \
--email [email protected] \
--ip 203.0.113.7 \
--session sess_9f3a \
--surface app.acme.com/signup
# Report credit burn (store eventId from verify on the account)
chitmark feedback --event-id evt_2f9c --outcome credit_burn --value 87.4
# Issue a challenge
chitmark challenge --event-id evt_2f9c --session sess_9f3a \
--prefer payment_preauth,proof_of_work
# Force JSON on a terminal
chitmark verify --action signup --jsonTimeouts and transport errors return a degraded challenge verdict (exit 2) and never an allow.
Exit codes
| Code | Meaning |
| :--- | :------------------------------------------------------------- |
| 0 | Explicit non-degraded allow only |
| 2 | challenge, degraded, or any non-allow decision (fail closed) |
| 3 | deny |
| 1 | error (bad flags, auth, network) |
Script on the exit code, parse the JSON for the details. Unknown decisions never exit 0.
Global options
| Flag | Default | Purpose |
| :------------------- | :----------------- | :----------------------------------------- |
| -k, --api-key | CHITMARK_API_KEY | API key |
| -u, --base-url | production API | API base URL override |
| -e, --env | production | production / staging / development |
| -t, --timeout <ms> | 800 | Client timeout; validated positive integer |
| --pii-mode <mode> | hashed | hashed / raw / none |
| -j, --json | off | JSON output, skips the TUI |
Operator notes
--sessionis a binding id you supply: prefer a high-entropy, server-generated value (UUID v4 / CSPRNG). It binds challenge andverdictToken; reuse it across verify → challenge → re-verify for that attempt only. Client-generated or guessable values weaken binding.- The default
--user-agentischitmark-cli, and a non-browser UA scores like automation: expectchallengeon signup-shaped verifies unless you pass a real browser UA with--user-agent. --valuemust be a finite number;--unitisusd|credits|count(defaultusd) and ships only alongside a value, matching the SDKs. Optional--sourceis label provenance (billing|usage_metering|trust_queue|manual_review|customer_system|automated_detector).- Invalid
--timeoutor--valuefail fast with a local error: no API call is made. - Verdict tokens: every signed JWT requires
kid. Respect JWKSCache-Control/ETag(andLast-Modifiedwhen present) via conditional requests; refresh on unknownkid(see Verdict tokens). Empty JWKS means verification is impossible: fail closed (localunsigned.<eventId>is not a trust path).
Agent integration
Using Cursor, Claude Code, Codex, or another coding agent? Point it at
chitmark.com/SKILL.md, or paste this into your
prompt: Integrate Chitmark into my app following https://chitmark.com/SKILL.md.
Resources
License
Proprietary: see LICENSE.
