Commands to manage the CodeGraphContext engine, contexts, and global settings.
Self-diagnostic: validates the installation and default graph backend (FalkorDB Lite, FalkorDB Remote, KuzuDB, or Neo4j), Python version, and core dependencies.
Usage:
cgc doctorInteractive wizard for AI client integration.
What it does:
- Detects installed clients (Cursor, VS Code, Claude, and others).
- Writes MCP config fragments (for example
mcp.json). - Prepares environment variables for
DEFAULT_DATABASEand backend credentials.
Usage:
cgc mcp setupWizard for the Neo4j server backend (Docker, local install, or Aura-style remote).
Usage:
cgc neo4j setupInspect and change settings without editing .env by hand. Persistent values are stored under ~/.codegraphcontext/.env unless a project-local .codegraphcontext/.env overrides them.
cgc config show— Print merged configuration.cgc config set <key> <value>— Set a key (for exampleDEFAULT_DATABASE,SCIP_INDEXER,INDEX_SOURCE).cgc config db <backend>— Shortcut forcgc config set DEFAULT_DATABASE <backend>.cgc config reset— Restore defaults (with confirmation).
DEFAULT_DATABASE quick switch — valid values: falkordb, falkordb-remote, kuzudb, neo4j.
cgc config set DEFAULT_DATABASE falkordb-remote
cgc config db falkordb
cgc config db falkordb-remote
cgc config db kuzudb
cgc config db neo4jNamed and per-repo contexts isolate databases and ignore rules. Configuration lives in ~/.codegraphcontext/config.yaml plus optional per-repo .codegraphcontext/.
cgc context list— Show mode (global/per-repo/named), default named context, and all registered contexts with database type and paths.cgc context create <name>— Create a named context. Optional--database/-d(falkordb,kuzudb,neo4j; defaults toDEFAULT_DATABASE). Optional--db-pathfor a custom on-disk location.cgc context delete <name>— Remove a context from the registry (database files remain on disk unless you delete them manually).cgc context mode <global|per-repo|named>— Set how the CLI resolves which graph to use.cgc context default <name>— Default named context when mode isnamedand no--contextflag is passed.
Examples:
cgc context list
cgc context create MyMonolith --database kuzudb
cgc context mode per-repo
cgc context default MyMonolith
cgc context delete OldProjectIndex or query with a specific named context using --context / -c on commands that support it (for example cgc index . --context MyMonolith).
- Graph queries: use
cgc queryfor read-only Cypher. The hidden aliascgc cypherremains for backward compatibility but prints a deprecation notice—prefercgc query. - Structured search: use the
cgc findcommand group (cgc find name,cgc find pattern, and other subcommands), not a legacycgc searchcommand.
cgc query "MATCH (f:Function) RETURN f.name LIMIT 10"
cgc find name MyClass- Configuration reference —
DEFAULT_DATABASE, SCIP flags,INDEX_SOURCE, and backend connection variables. - MCP tool overview — Tools exposed to IDEs, including
discover_codegraph_contextsandswitch_context.