Quick reference for building this pure-C11 project from source and running it as a local CLI to generate and query a code graph. For the full walkthrough with a diagram, see CLI_BUILD_RUN_GUIDE.md.
This is the CLI-only, no-MCP, no-network fork. See the "About this fork" section in the top-level README. There is no Go toolchain here — the project was rewritten from Go to pure C11 at upstream v0.5.0. Do not run
go build.
A C11 toolchain (clang or gcc), make, and — only if you want the graph UI bundled — node.
Everything else (tree-sitter grammars, SQLite, yyjson, mimalloc, …) is vendored and compiled
into the binary. No language runtime, no network fetch at build time.
The repo also ships a .devcontainer (Docker Compose); JetBrains IDEs and VS Code will offer to
reopen the project in the container, where your workspace is mounted at /workspace.
Standard release build:
scripts/build.sh
# -> build/c/codebase-memory-mcpWith the localhost graph-viz UI bundled in (needs node):
scripts/build.sh --with-uiEquivalent via make:
make -f Makefile.cbm cbmFork roadmap: a dedicated CLI-only binary (
codebase-memory-cli, built viascripts/build.sh --cli-only, with the MCP server and coordination daemon compiled out) is tracked on the roadmap and not yet wired up. Until then, use the standard build above and theclisubcommand below — the query behavior is identical.
The binary runs any tool locally and exits via the cli subcommand:
build/c/codebase-memory-mcp --help
build/c/codebase-memory-mcp cli --json <tool> [args]# Build/refresh the code graph for the current repo
build/c/codebase-memory-mcp cli --json index_repository
# Structural search
build/c/codebase-memory-mcp cli --json search_graph --query cbm_mcp_handle_tool
# Orient on module structure
build/c/codebase-memory-mcp cli --json get_architecture
# Callers/callees of a symbol
build/c/codebase-memory-mcp cli --json trace_path --from run_cliAvailable tools include: index_repository, search_graph, query_graph (Cypher), trace_path,
get_code_snippet, get_architecture, search_code, list_projects, index_status,
check_index_coverage, detect_changes, manage_adr, and more — run --help to list them.
The 3D graph visualization is served over HTTP on 127.0.0.1:9749 — loopback only, never a
non-loopback interface. Build with --with-ui to bundle it. (In this fork the UI is started
on-demand by the CLI rather than by a background daemon; the dedicated ui subcommand is tracked
on the roadmap.)
- Machine-readable output:
cli --json <tool>prints the raw result envelope; most query tools also accept--format jsonfor a stable per-tool JSON shape. This is the intended path for scripting and for driving the tool from an editor/agent. - Confirm exact subcommands and flags with
build/c/codebase-memory-mcp --helpand... cli <tool> --help.