Reference

Command Reference

The five core verbs that cover ~80% of agent workflows, plus the most-used commands grouped by intent. Run roam --help for the full 202-command surface; roam <cmd> --help for any command's flags.

Every command supports --json for machine output and (where applicable) --sarif for CI Code Scanning. Verdicts use VERDICT: first-line convention.

The 5 Core Verbs

These are the "start here" commands. Most agents need only these.

VerbWhat it doesExample
understand Landing-pad summary of the codebase: layers, sizes, hotspots, entry points. roam understand
retrieve Free-form natural-language task → budget-bounded ranked spans (graph-aware FTS5 + rerank). roam retrieve "where is auth?"
context Files + line ranges to read before changing a symbol, prioritised by callers and tests. roam context AuthService
preflight Blast radius, affected tests, complexity, fitness rules — all in one verdict. roam preflight AuthService
critique Patch verifier. Pipe a diff in; get clones-not-edited + blast-radius severity. Exits 5 on high-severity findings. git diff | roam critique

Exploration

CommandWhat it does
roam search <pattern>FTS5 symbol search (BM25-ranked, qname-aware)
roam symbol <path>File skeleton — top-level symbols + line ranges
roam file <path>Detailed file info: complexity, ownership, recent changes
roam impact <name>Caller list — what breaks if you change this symbol
roam trace <a> <b>k-shortest paths between two symbols in the call graph
roam tourWalk through the most architecturally-central symbols
roam diagnose <name>Root-cause ranking for a failing symbol
roam ask "<question>"Natural-language intent dispatch over the recipe registry

Health & Quality

CommandWhat it does
roam healthComposite health score (0-100) with risk breakdown
roam health --gateSame, but exits non-zero on threshold breach
roam complexitySonarSource-compatible cognitive complexity per symbol
roam debtTech-debt aggregate; --roi ranks refactor candidates
roam check-rulesRun all built-in + community rule packs
roam test-gapsSymbols that no test covers; --changed for diff scope
roam why-slowRuntime hotspots from ingested traces

Refactoring

CommandWhat it does
roam suggest-refactoringTop-N refactor candidates by ROI
roam plan-refactor <name>Step-by-step plan to refactor without breaking callers
roam mutate move <sym> <file>Apply a structural transform with import rewriting
roam simulate move <sym> <file>What-if architecture — clone the graph and apply a move
roam clones --persistDetect AST-level clones; persist to clone_pairs for critique
roam migration-planCurrent architecture → target architecture roadmap

Security & Governance

CommandWhat it does
roam taintGraph-reach BFS for vulnerability reachability (OpenVEX-correct)
roam vuln-reachMap a CVE to reachable code paths
roam adversarialAttack-surface review per symbol
roam cga emitSign an in-toto v1 Code Graph Attestation
roam cga verifyVerify a CGA attestation (cosign-aware)
roam attestSLSA-style provenance for the index itself

Multi-Agent & MCP

CommandWhat it does
roam mcpStart the MCP server (stdio transport)
roam mcp --list-toolsPrint all 136 MCP tools the server exposes
roam mcp-setup <client>Generate config for Claude Code, Cursor, Gemini, Codex
roam fleet planPartition work across N agents (Louvain + co-change + PageRank)
roam orchestrateMulti-agent coordination plan with zero-conflict guarantees
roam skill-generateEmit a SKILL.md file from the Capability Registry

Output Modes

Every command supports these flags at the top level (before the subcommand):

FlagEffect
--jsonStable JSON envelope with schema versioning. For agent + script consumption.
--sarifSARIF 2.1.0 — for GitHub Code Scanning. Supported on health, debt, complexity, rules, secrets.
--agentCompact JSON + 500-token default budget. Optimised for sub-agent CLI calls.
--budget <n>Cap output to N tokens (0 = unlimited).

Where to find more