CLI Reference
CGraph ships four binaries. This page is the reference for the command-line surface; see Quick Start for a guided walkthrough.
cgraph
The one-shot CLI: scan a tree, build the graph, write exports, exit.
| Flag | Meaning |
|---|---|
--root | Source tree to scan (defaults to the current directory). |
--out | Directory for the graph and exports. |
Enrichment subcommands
cgraph also drives the host-side semantic enrichment workflow:
| Flag | Meaning |
|---|---|
enrich-plan | Produce a chunk plan for host-written enrichment fragments. |
enrich-ingest | Validate and fold host-written fragments into the graph. |
--drop | The semantic drop directory for enrichment fragments. |
graphd
The daemon: keep the graph warm and watch the tree.
| Flag | Meaning |
|---|---|
--root | Project tree to index and watch. |
--idle-timeout | Shut down after this many idle seconds. |
--no-watch | Don't watch the tree; update only on explicit ops. |
--benchmark-query | Run a one-off benchmark query against a graph. |
--graph / --query | The graph path and query text for --benchmark-query. |
--version | Print the version. |
cgraph-client
The thin client: send an operation and a JSON payload to a running daemon.
cgraph-client --root /path/to/project query '{"q":"Parser"}'
cgraph-client context '{"q":"Parser","budget":5000}'
cgraph-client update '{"path":"."}'
cgraph-client status
cgraph-client shutdownThe operations mirror the MCP tools: query, explain, impact, path,
context, update, status, and shutdown.
cgraph-mcp
The MCP server, run by an agent over stdio. It takes --root and --daemon
and otherwise resolves both from the environment — see
MCP Integration.
Flags shown here are those stated in the public README. Additional flags and
defaults (for example, the --idle-timeout default) are not enumerated publicly
and are left out rather than guessed.