NxtSoftLabs
CGRAPH DOCS — CONTENTS
CGRAPH

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.

cgraph [--root PATH] [--out PATH]
FlagMeaning
--rootSource tree to scan (defaults to the current directory).
--outDirectory for the graph and exports.

Enrichment subcommands

cgraph also drives the host-side semantic enrichment workflow:

cgraph enrich-plan [--root PATH] [--out PATH] [--drop DIR] cgraph enrich-ingest [--root PATH] [--out PATH] [--drop DIR]
FlagMeaning
enrich-planProduce a chunk plan for host-written enrichment fragments.
enrich-ingestValidate and fold host-written fragments into the graph.
--dropThe semantic drop directory for enrichment fragments.

graphd

The daemon: keep the graph warm and watch the tree.

graphd --root PATH [--idle-timeout SECONDS] [--no-watch] graphd --benchmark-query --graph PATH --query TEXT graphd --version
FlagMeaning
--rootProject tree to index and watch.
--idle-timeoutShut down after this many idle seconds.
--no-watchDon't watch the tree; update only on explicit ops.
--benchmark-queryRun a one-off benchmark query against a graph.
--graph / --queryThe graph path and query text for --benchmark-query.
--versionPrint the version.

cgraph-client

The thin client: send an operation and a JSON payload to a running daemon.

operations
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 shutdown

The 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.

Note

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.