Look something up
CLI
Look up every coco and trustcoco command, with its options and exit codes.
Look up every coco and trustcoco command.
| Command | Package | Used for |
|---|---|---|
coco | trustcoco-sdk | A project: policy, contracts, decisions, escalations, and the record. |
trustcoco | @trustcoco/cli | Installing Coco into Claude Code. |
coco
Every coco command works from any folder inside a project, and reads the project's .env first.
Project
| Command | What it does |
|---|---|
coco init NAME [--dir D] [--force] [--key KEY] [--url URL] [--policy-url URL] [--project ID] | Creates a project: coco.yaml, agent.py, tools/, contracts/, policies/ with sample_policy.pdf, .env.example, and .gitignore. Refuses to overwrite without --force. With --key, it connects the project as coco connect does. --url, --policy-url, and --project need --key. |
coco connect --key KEY [--url URL] [--policy-url URL] [--project ID] | Checks the key, writes both URLs to coco.yaml and the key to .env, and says when local and gate contracts differ. See Connect to the gate. |
coco status | Shows the mode, contracts by status, classifier, gate, decision counts, and open escalations. The counts come from the local ledger. |
coco run [PROMPT] [--script FILE] | Runs agent.py, or the file named, with the project's guard. |
Record and escalations
| Command | What it does |
|---|---|
coco ledger [--limit N] [--verdict V] [--json] [--local] | Shows receipts, newest last. 20 by default. |
coco verify [--local] | Walks the receipt chain. Prints Chain intact: N receipts., or the receipt where it breaks and exits 1. |
coco escalations [list] [--local] | Shows what waits on a person. |
coco escalations approve ID [--by EMAIL] [--reason R] [--local] | Approves an escalation. |
coco escalations reject ID [--by EMAIL] --reason R [--local] | Rejects an escalation. A rejection needs a reason. |
Once a project is connected, these read and decide on the gate, and --local reads this machine's ledger instead. On the gate, you act as a reviewer with a sign-in token in COCO_REVIEWER_TOKEN. Locally, --by names the person deciding and is required.
Policy and contracts
| Command | What it does |
|---|---|
coco policy extract [FILES] [--from-output DIR] | Runs the policy pipeline on policies/ or the files named, on this machine. --from-output imports a folder the pipeline already wrote. |
coco policy upload [FILES] [--keep] [--no-publish] [--no-wait] [--name NAME] [--model NAME] | Runs the same on the hosted document service, and pulls the results into .coco/policy/<stem>-<sha8>/. Takes policies/*.pdf and *.docx by default. The service then deletes the document, and the draft contracts stay on the dashboard. --keep keeps the document. --no-publish writes no drafts. --no-wait prints the job ids and returns. --name names the policy. --model picks a preset. Exits 2 when a job fails. |
coco policy models | Lists the presets the service offers: id, provider, available or the key the service lacks, and (default). |
coco policy jobs [--limit N] | Lists the project's documents on the service, newest first, with job status, id, and model. 50 by default. |
coco policy pull JOB_ID [--keep] | Pulls a finished job's output into .coco/policy/, then deletes the document on the service. --keep keeps what the service still holds. A failed job prints its reason and keeps its document. |
coco policy retry JOB_ID [--model NAME] [--no-wait] [--keep] | Runs a failed job again on the source the service kept, then pulls it. The service returns 409 once the source is gone. |
coco contracts compile [SOURCE] | Compiles canonical policy to draft contracts, with boundary cases in .coco/cases/. SOURCE is one pipeline output folder. The default is everything extracted. |
coco contracts review [ID] [--all] | Shows drafts with their citations, checks, and review issues. --all shows every contract. |
coco contracts list | Lists every contract, one line each. |
coco contracts activate ID... --testing|--live|--retire [--force] | Moves status. --testing records and never enforces. --live enforces. A contract with open review issues goes live only with --force. all names every contract. Works on files holding a contracts: list, and keeps only comment lines that start a line. |
coco contracts push --admin-token T [--url URL] | Sends the project's contracts to the gate. An administrator's step. |
Evaluate
| Command | What it does |
|---|---|
coco eval cases [--classifier URL] | Replays the project's compiled boundary cases. |
coco eval vault|tau3|agentdojo|policy [options] | Runs a benchmark suite from an SDK checkout. --help after the suite name lists its options. |
For what each suite measures, see Evaluate.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success. |
| 1 | verify found a break, or eval cases got a case wrong. |
| 2 | A usage or project error, or a coco policy job that failed. |
trustcoco
npx @trustcoco/cli claude-code [--mode monitor|enforce] [--key KEY] [--url URL] [--home DIR] [--python PATH]
npx @trustcoco/cli uninstall claude-codeKeep in mind: The package isn't published yet. Until it is, run node dist/src/cli.js from a build. See Claude Code.
| Command | What it does |
|---|---|
trustcoco claude-code | Writes COCO_HOME and adds Coco's PreToolUse hook to Claude Code's settings. Mode defaults to monitor. |
trustcoco uninstall claude-code | Removes Coco's hook entries and leaves COCO_HOME. |
It reads COCO_HOME (default ~/.coco), COCO_CLAUDE_DIR (default ~/.claude), and COCO_PYTHON.