These commands are the foundation of CodeGraphContext. They allow you to add, remove, and monitor the code repositories in your graph.
Adds a code repository to the graph database. This is the first step for any project.
!!! info "Excluding Files (.cgcignore)"
Want to skip specific files or folders? CodeGraphContext supports a .cgcignore file.
📄 Read the .cgcignore Guide
Usage:
cgc index [path] [options]Common Options:
path: The folder to index (default: current directory).--force: Re-index from scratch, even if it looks unchanged.
Example:
# Index the current folder
$ cgc index .
# Index a specific project
$ cgc index /home/user/projects/backend-apiShows all repositories currently stored in your graph database.
Usage:
cgc listExample Output:
Indexed Repositories:
1. /home/user/projects/backend-api (Nodes: 1205)
2. /home/user/projects/frontend-ui (Nodes: 850)
Starts a real-time monitor. If you edit a file, the graph updates instantly.
!!! warning "Foreground Process" This command runs in the foreground. Open a new terminal tab to keep it running.
Usage:
cgc watch [path]Example:
$ cgc watch .
[INFO] Watching /home/user/projects/backend-api for changes...
[INFO] Detected change in users/models.py. Re-indexing...Removes a repository from the database. This does not delete your actual files, only the graph index.
Usage:
cgc delete [path] [options]Common Options:
--all: Dangerous. Wipes the entire database.
Tools for managing portable graph snapshots (.cgc files).
Save your graph to a file. Useful for sharing context with team members or loading into a production read-only instance.
cgc bundle export my-graph.cgc --repo /path/to/repoDownload and install a popular library bundle from our registry.
(Alias: cgc load)
cgc load flaskSearch for available pre-indexed bundles in the cloud registry.
Usage: cgc registry [query]
# List top bundles
cgc registry
# Search for a specific package
cgc registry pandas