CodeGraphContext is highly configurable through environment files and the CLI.
View and modify settings directly from the terminal.
Shows the current effective configuration (merged from defaults and .env).
cgc config showUpdate a setting permanently. This writes to ~/.codegraphcontext/.env.
Syntax: cgc config set <KEY> <VALUE>
# Switch to Neo4j backend
cgc config set DEFAULT_BACKEND neo4j
# Increase max file size to index (MB)
cgc config set MAX_FILE_SIZE_MB 20
# Enable automatic watching after index
cgc config set ENABLE_AUTO_WATCH trueA shortcut to toggle between falkordb and neo4j.
cgc config db neo4jHere are the available settings you can configure.
| Key | Default | Description |
|---|---|---|
DEFAULT_BACKEND |
falkordb |
The database engine to use (neo4j or falkordb). |
ENABLE_AUTO_WATCH |
false |
If true, cgc index will automatically start watching for changes. |
PARALLEL_WORKERS |
4 |
Number of parallel threads to use during indexing. |
CACHE_ENABLED |
true |
Caches file hashes to speed up re-indexing. |
| Key | Default | Description |
|---|---|---|
MAX_FILE_SIZE_MB |
5 |
Files larger than this (in MB) are skipped. |
IGNORE_TESTS |
false |
If true, skips folders named tests or spec. |
IGNORE_HIDDEN |
true |
Skips hidden files (.git, .vscode). |
INDEX_VARIABLES |
true |
Creates nodes for variables. Set to false for a smaller graph. |
| Key | Description |
|---|---|
NEO4J_URI |
Connection URI (e.g., bolt://localhost:7687). |
NEO4J_USERNAME |
Database user (default: neo4j). |
NEO4J_PASSWORD |
Database password. |
CodeGraphContext uses the following hierarchy:
- Project Level:
.cgcignorein your project root (files to exclude). - User Level:
~/.codegraphcontext/.env(global settings). - Defaults: Built-in application defaults.
To reset everything to defaults:
cgc config reset