02

CLI reference

Exit codes 0 Success 1 Verification failed · fail-closed 2 Usage error

This is every canon subcommand and its arguments, generated from node src/cli.mjs’s own usage text: npm run check:cli fails the build if the two disagree. The home page shows the condensed form of the same groups.

2.1

Author & inspect

Compile, verify, store, point an alias.

canon status [--root <store>] [--state-dir <dir>] canon brief <report.json> [--store <store>] --alias <name> [--out <dir>] [--render-policy 1|2] [--reissue-of <packet-dir>] [--allow-render-policy-1] canon sitrep <site-input.json> [--store <store>] --alias <name> [--out <dir>] canon --version | -v canon --help | -h
2.2

Build, verify & archive

Low-level steps, each checkable alone.

canon build <report.json> --out <dir> [--receipt <file>] [--render-policy 1|2] [--reissue-of <packet-dir>] canon verify <packet-dir> [--json] [--reissue-of <old-packet-dir>] canon build-site <site-input.json> --out <dir> [--receipt <file>] canon verify-site <bundle-dir> [--json] canon build-docs <manifest.doc-set.json> --out <dir> [--receipt <file>] canon verify-docs <bundle-dir> [--json] canon archive <packet-dir> --out <file.tar>
2.3

Store & aliases

Compare-and-swap prevents lost updates.

canon publish <packet-dir> [--root <store>] [--build-receipt <file>] [--receipt <file>] [--allow-render-policy-1] canon alias set <name> <content-id> [--root <store>] --expect-generation <n> canon alias get <name> [--root <store>] canon alias list [--root <store>]
2.4

Workstation server

Loopback by default; backs Canon.app.

canon serve --root <store> [--port <n>] [--host <ip> | --tailscale] [--expect-tailscale-address <ipv4> --expect-tailscale-name <dns-name>] [--allow-host <name>]... [--state-file <file>] [--pid-file <file>] canon service start --root <store> [--state-dir dist/service] [--port 8791] [--host <ip> | --tailscale] [--expect-tailscale-address <ipv4> --expect-tailscale-name <dns-name>] [--allow-host <name>]... canon service status|stop|restart [--state-dir dist/service] canon service clean [--state-dir dist/service] [--store <store>]
2.5

Remote targets

Gated: explicit grants, dry-run, zero delete.

canon key generate --out <path> | --print-once canon publish <packet-dir> --target <name> --targets <file> [--grant upload] [--dry-run] [--allow-render-policy-1] canon publish --site <site-bundle-dir> --target <name> --targets <file> [--grant upload] [--dry-run] canon promote --target <name> --targets <file> --alias <name> --content-id <id> --expect-generation <n> [--grant promote] [--dry-run] canon rollback --target <name> --targets <file> --alias <name> --to <content-id> --expect-generation <n> [--grant promote] [--dry-run] canon reconcile --target <name> --targets <file> [--grant promote]
2.6

Served routes

Mutable aliases → immutable editions.

/a/<alias>/ · /a/<alias>/report.md · /a/<alias>.json /p/sha256-<hex>/ · manifest.json /healthz
2.5

Remote targets are gated

--target commands never delete, change DNS, or expose a target publicly on their own. A real Cloudflare target is refused unless its target file sets an https://<worker>.workers.dev endpoint, its credential variable is set, and the command carries an explicit --grant. --dry-run prints the writes a command would send and sends nothing. Exit 1 means verification failed: Canon is fail-closed and never repairs a packet.