Skip to content
Browse documentation

CLI commands

Every `cirvix` command, every flag, and what each exits with. Taken from the binary, not from a plan.

The CLI overview page introduces the commands you reach for first. This page is the exhaustive reference. Everything except why and replay works offline, because enforcement has to — those two ask about something already recorded on a control plane.

CommandNeeds a control planeWhat it does
scannoInventory what is ungoverned on this machine
checknoEvaluate one hypothetical call
policynoPrint the active rule set
gatewayoptionalRun the MCP gateway — intercepts and enforces
daemonyesRun the endpoint service — policy sync and telemetry
audit verifynoRecompute the local decision chain
whyyesExplain one decision, and name its run
replayyesRe-evaluate a recorded run under a candidate rule set
help / versionnoUsage, and the version

cirvix scan

Read-only inventory of what an agent on this machine could reach with nothing in the way. Nothing is changed and nothing is sent.

FlagMeaning
--jsonFull result as JSON
--deepInclude MCP command lines in the output
--sarif <file>Write SARIF 2.1.0 for code-scanning upload
--fail-on <level>Exit non-zero at high|medium|low findings
TerminalShell
$ cirvix scan --deep --fail-on high

SARIF is written before the exit-code gate, so a failing scan still produces the artifact CI is about to upload. Fingerprints are stable across runs, so a dismissal in code scanning sticks.

cirvix check

Evaluates one hypothetical call and executes nothing. --action and --resource are both required.

FlagMeaning
--action <action>Required. e.g. fs.read, shell.exec, k8s.apply
--resource <resource>Required. Path or URL, canonicalized before matching
--policy <file>Rule set. Omitted → the starter rules
--agent <name>Default local
--env <name>Default local
--jsonFull decision record
TerminalShell
$ cirvix check --action fs.read --resource .env.production
Note
The context check builds is deliberately minimal: path.insideWorkspace is computed from --cwd, and egress.external, egress.allowlisted, and session.touchedSecret are all false. To exercise those, use evaluate() from the SDK's testing entry point.

cirvix policy

Prints the active rule set — every rule the engine would evaluate against, in order.

FlagMeaning
--policy <file>Rule set to print. Omitted → the nine starter rules
--jsonThe rules verbatim, suitable for piping
TerminalShell
$ cirvix policy --json

cirvix gateway

Runs the MCP gateway over stdio. The agent talks to Cirvix; Cirvix talks to the upstream servers. Every tools/call is evaluated before it is forwarded, and every result is scanned on the way back.

FlagMeaning
--servers <file>Required. MCP server map — an editor's config works verbatim
--policy <file>Rule set. Omitted → the starter rules
--state <dir>Audit log and telemetry spool (default ./.cirvix)
--agent <name>Recorded against every decision (default local)
--env <name>Environment context (default local)
--api <url> / --key <cvx_…>Attach a control plane
TerminalShell
$ cirvix gateway --servers ~/.cursor/mcp.json --policy cirvix.policy.json

--servers accepts mcpServers (Claude Code, Cursor, Windsurf) or servers (VS Code), so you point at the file you already have. stdio transport only. An entry named cirvix is skipped, otherwise pointing the gateway at a governed config would make it proxy itself.

Without --api and --key the gateway still enforces, from the local rule set — the product is useful before you have an account. With them, a daemon starts alongside to supply policy, register the agent, open a run, and ship telemetry.

cirvix daemon

Runs the endpoint service on its own: policy sync, telemetry, and heartbeat. It holds no inbound port — it polls outward.

FlagMeaning
--api <url>Required. Or CIRVIX_API_URL
--key <cvx_…>Required. Or CIRVIX_API_KEY
--state <dir>Default ./.cirvix
--interval <ms>Sync interval, default 30000
TerminalShell
$ cirvix daemon --api https://api.example.com --key $CIRVIX_API_KEY

cirvix audit verify

Recomputes the local hash chain and reports the first break. verify is the only subcommand; anything else exits 2.

FlagMeaning
--file <path>Chain to verify (default .cirvix/audit.jsonl)
--json{ ok, records, brokenAt?, reason? }
TerminalShell
$ cirvix audit verify

cirvix why

Explains one recorded decision in full, and names the run it belongs to — the thread to pull in an incident.

FlagMeaning
--jsonFull decision record as JSON
--api <url> / --key <cvx_…>Control plane to read from
TerminalShell
$ cirvix why dec_01JQ8F2K7M

cirvix replay

Re-evaluates every step of a recorded run under a candidate rule set. No side effects are executed.

FlagMeaning
--policy <file>Candidate rule set. Omitted → replays against live policy
--diffShow only the steps whose verdict changed
--jsonFull result
TerminalShell
$ cirvix replay run_01JQ8F2K7M --policy candidate.json --diff

Steps recorded without enough context to re-decide are reported as not replayable rather than counted as unchanged, and changed is always stated as a fraction of replayable.

Exit codes

CodeMeaning
0Success, or a permitted/held decision
1A substantive negative: findings over the gate, a deny, a broken chain, a changed replay
2Usage error, or an unhandled exception

1 and 2 are kept distinct so CI can tell "the tool worked and the answer was no" from "the tool did not run".

Edit this page on GitHub
Was this page helpful?