The CLI mirrors the MCP surface exactly: nine domains, each a real clap subcommand group
(basemind <domain> <mode>). tests/cli_parity/ enforces it: every MCP mode maps to a CLI command
with the same parameters and the same answer, and any command with no MCP counterpart is declared
CLI-only with a reason. Some MCP modes live at the top level rather than under their domain
(status, rescan, cache, delta, checkpoint, detect-waste). Multi-word mode names are kebab-cased on the CLI (by_path → by-path) but
keep their snake_case spelling on the wire (MCP mode name, --json field names). Add --json to
any tool subcommand for machine-readable output.
Flags with a closed set of values (--direction, --edges, --algorithm, --granularity, --format,
--lane, --level, --window, --field, --hash-mode, --kind on memory proposals, shell
names) are validated by clap: a typo fails with exit code 2 and the valid choices listed, and the
completions offer them. The MCP parameters carry the same values as free strings.
Commands that return lists share a set of paging and budget flags where their MCP mode takes them:
A file’s structure: symbols, lines, signatures. --l2 adds calls + docs. Read this instead of the file. Code files only; documents are searched with memory documents.
symbols <name> [--kind --limit]
Find a definition by name (case-sensitive substring) across every indexed file.
The rest of the former admin verbs live at the top level: status, rescan, cache stats|gc|clear, delta,
checkpoint and detect-waste (see Other commands).
Command
Purpose
repo
Repository identity: workdir, branch, HEAD sha.
telemetry [--window --tool]
Aggregate recorded tool calls into a usage and token-savings summary.
Shrink content for re-use in a smaller context: an indexed file’s outline, or a prose pass read from --text/stdin.
tokens --stdin
Count tokens in stdin with the o200k tokenizer and print just the integer (needs the tokenizer feature, which documents includes). CLI-only; no --json envelope.
eval --tasks <FILE> [...]
Score retrieval quality, latency and token savings over a JSONL task file. CLI-only; see Evaluation.
Requires --features comms. A thread is addressed by at least two of --subject, --path, and
--member; thread-start rejects fewer than two. Every command accepts --as-agent <id> to act as
a named sub-identity instead of the CLI’s default agent (used for orchestrating several named
subagents).
Requires --features comms. This is the ONLY surviving basemind comms surface — the messaging
verbs it used to carry (register, agents, thread-start, threads, join, post, read,
inbox, wait, …) now live under basemind agents (above); comms read <id> became
agents message <id>, comms agents became agents list, comms threads became
agents thread-list.
Terminal window
basemindcommsdaemon
basemindcommsstart
basemindcommsstop [--all]
basemindcommsstatus
basemindcommsdoctor [--probe --clear-fatal]
Command
Purpose
daemon
Run the broker loop in the foreground: bind the singleton socket, serve front-ends, block until shutdown.
start
Ensure the daemon is running (spawn if needed); no-op when already alive.
stop [--all]
Ask the running daemon to drain and stop. --all stops every live daemon registered on this machine, not just the current one.
status
Report the daemon’s pid / version / uptime / room + subscriber counts.
doctor [--probe --clear-fatal]
List every live daemon on this machine (pid / comms dir / version / uptime), flag a pile-up over the ceiling, and prune dead registry entries. Reports process liveness only unless --probe is given, which also asks each daemon whether it can serve. --clear-fatal acknowledges and deletes the recorded fatal store error for this comms dir.
Full index of the project. --staged indexes the git index instead of the working tree; --rev indexes a revision into a separate rev-<sha7> view. The --documents-* and --llm-* flags override the matching [documents] / [llm] keys for this run (each also has a BASEMIND_DOCUMENTS_* / BASEMIND_LLM_* env var). Ctrl-C stops the scan cleanly.
Update one or more paths incrementally, or the whole tree with --full. When the daemon is running the rescan is forwarded to it (the daemon is the sole index writer); otherwise it runs in-process under the workspace writer lock. Ctrl-C stops it cleanly. The summary (also when forwarded to the daemon) reports docs_degraded and doc_timeouts when non-zero.
watch
Long-running watcher; keeps the code map current as files change (no server).
serve
Ensure the daemon is up and relay this process’s stdio to it as the MCP server. The daemon keeps the index fresh.
status
Index health for this workspace: file counts, languages, scan age.
doctor
Check root, config, index, grammars, pre-commit hook and daemon; exits 1 when a check fails.
Re-runnable onboarding: write basemind.toml, select capabilities, inject usage rules into a gitignored local rules file by default, optionally auto-approve basemind’s tools in Claude Code settings. See Get started.
lang list|install|clean
Manage downloaded tree-sitter grammars. install also fetches every grammar marked preload = true under [languages.<name>].
hook install [--force]
Add a git pre-commit hook that runs basemind scan --staged. Honours core.hooksPath, works in linked worktrees, never blocks a commit, and refuses to replace a hook basemind did not write unless --force (the old one is kept as pre-commit.bak).
Offline path directly against the machine-global cache. gc runs the real cross-workspace reference-counted sweep (blobs younger than six hours are kept; BASEMIND_BLOB_GC_GRACE_SECS overrides) and prints what it removed. clear is the only way to clear views/all, which the MCP admincache_clear mode refuses because they back the live index. gc --dry-run only counts blobs and deletes nothing. --component is blobs, views, lance, git-cache (default), telemetry, all, or views:<name> for one view. Everything except git-cache is destructive: it prompts on a terminal and requires --yes otherwise (exit 2). clear exits 3 while a writer holds the workspace lock, and for blobs while the daemon runs; blobs is the machine-global extraction store shared by every workspace.
daemon ensure
Ensure the daemon’s streamable-HTTP MCP transport is up; idempotent. Needs --features comms.
statusline
Print a one-line summary of the daemon’s hot workspaces, for a shell statusline. Silent and exits 0 when no daemon is running.
compress-output [--family]
Backend for the output-compression guardrail: compress stdin (e.g. piped command output) by detected or given family.
delta --old <FILE> [--new <FILE>]
Backend for the delta-reads guardrail: diff the --old file against --new (stdin when omitted), emitting a compact +N/-M line diff.
checkpoint
Extract decisions/errors/changed-files from session text on stdin into a JSON checkpoint.
detect-waste
Flag wasteful tool use from a JSON-Lines tool-call log on stdin.
Human output is a generic table or key/value view. Table cells and outline signatures wider than 200
characters are cut with an ellipsis (key/value fields never are), and the number of cut cells is
reported on stderr; --json always carries the full values. The timing footer (startup time plus the
tool’s own latency) and other diagnostics go to stderr, so stdout stays pipeable.
Exit code
Meaning
0
Success.
1
Runtime error (I/O, scan failure, a tool reported an error, a failed doctor check).
2
Usage error: a bad flag or value (clap), a path outside the repo, or a destructive command without --yes.
3
Busy: another process holds the workspace writer lock. Retry later, or start the daemon so the call is forwarded.
4
Unavailable: the operation needs the comms daemon and none is reachable.
130
Interrupted (Ctrl-C). Work committed before the interrupt is kept; a second Ctrl-C aborts immediately.
When the comms daemon is running it is the sole index writer, so the one-shot tool subcommands open
the store without the index and forward index-dependent work to the daemon: memory, code references / callers, the code grep trigram prefilter, and rescan. Without a daemon they read
the index directly and read-only.