Commands
The cairn CLI surface beyond the core run/spec/authoring commands. Each page below documents one command family — flags, flow, and when to reach for it. Every command supports --format json|yaml|md and has a stable JSON schema; no interactive prompts on --json/--yaml paths.
Maintenance
- Doctor & clean —
cairn doctorprobes the environment;cairn cleanprunes old run directories.
Page inspection
- Discover & snapshot —
cairn discover/cairn snapshotreturn the accessibility tree and locator inventory for a live page.
Sessions
- Checkpoints & login —
cairn logincaptures a session by hand;cairn checkpointmanages resumable checkpoints.
Evidence
- Stash —
cairn stashpersists run packs in the local file.cheap vault for retention-safe search. - Clip —
cairn clipcuts named clips from a run video via vidtrace. - Process monitoring —
--monitorsamples the browser process tree; themonitorstep andprocessverifier assert on it. - Stats —
cairn stats --group-by <label-key>aggregates labeled runs (cairn run --label key=value) into A/B cohorts with pass rate, duration percentiles, optional domain metrics fromoutcomes/*.raw.json, and ASCII charts in markdown. Pair with--beforehooks for domain path flips before a suite.
Failure → code
- Investigate & audit —
cairn investigatestashes an existing run for optional code search;cairn auditrecords a Playwright video and uses file.cheap/vecgrep only when stash or connection is requested. - Annotate —
cairn annotatepins cairntrace findings to codemap symbols;--auto-annotatedoes it per run.
Environment
- Secrets —
cairn secretschecks the TinyVault secrets provider. - Services —
cairn services statusand the config-driven docker/seed/tmux lifecycle.
The core commands
The run/spec/authoring surface is documented elsewhere and is not duplicated here:
- Quickstart —
cairn run, first spec. - Authoring — tags, labels,
--before/--afterhooks,cairn stats. - Steps / Verifiers — the typed vocabularies.
- Snippets —
imports:/use:. - MCP —
cairn mcp serveand thecairn_*tool family.
Run cairn explain --format json (or MCP cairn_explain) for the machine-readable current surface, including every flag.
See also
- Overview — what cairntrace is
- Configuration — config keys the commands read
- Troubleshooting — common command failure modes