Complete CLI Command Reference

May 19, 2026 ยท View on GitHub

All CodeGraphContext CLI Commands - Comprehensive List


๐Ÿ“‹ Table of Contents

  1. Project Management
  2. Watching & Monitoring
  3. Code Analysis
  4. Discovery & Search
  5. Configuration & Setup
  6. Bundle Management
  7. Bundle Registry
  8. Utilities & Runtime
  9. Global Options
  10. Shortcuts

1. Project Management

CommandArgumentsDescription
cgc index[path] --forceIndex a repository. Default: current directory. Use --force to re-index. (Alias: cgc i)
cgc listNoneList all indexed repositories. (Alias: cgc ls)
cgc delete[path] --allDelete a repository from the graph. Use --all to wipe everything. (Alias: cgc rm)
cgc stats[path]Show indexing statistics for DB or specific repo.
cgc cleanNoneRemove orphaned nodes and clean up the database.
cgc add-package<name> <lang>Manually add an external package node.

2. Watching & Monitoring

CommandArgumentsDescription
cgc watch[path]Watch directory for changes and auto-reindex. (Alias: cgc w)
cgc unwatch<path>Stop watching a directory.
cgc watchingNoneList all watched directories.

3. Code Analysis

CommandArgumentsDescription
cgc analyze calls<func> --fileShow outgoing calls: what does this function call?
cgc analyze callers<func> --fileShow incoming calls: who calls this function?
cgc analyze chain<start> <end> --depthFind call path between two functions. Default depth: 5.
cgc analyze deps<module> --no-externalInspect dependencies (imports/importers) for a module.
cgc analyze tree<class> --fileVisualize class inheritance hierarchy.
cgc analyze complexity[path] --threshold --limitList functions with high cyclomatic complexity. Default threshold: 10.
cgc analyze dead-code--excludeFind potentially unused functions (0 callers).
cgc analyze overrides<class> --fileShow methods that override parent class methods.
cgc analyze variable<var_name> --fileAnalyze variable usage and assignments.

CommandArgumentsDescription
cgc find name<name> --type --fuzzy/--no-fuzzyFind code elements by name. Fuzzy matching is on by default (configurable via FUZZY_SEARCH).
cgc find pattern<pattern> --case-sensitiveFind elements using fuzzy substring matching.
cgc find type<type> --limitList all nodes of a specific type (function, class, module).
cgc find variable<name> --fileFind variables by name across the codebase.
cgc find content<text> --case-sensitiveSearch for text content within code (docstrings, comments).
cgc find decorator<name>Find all functions/classes with a specific decorator.
cgc find argument<name>Find all functions that have a specific argument name.

5. Configuration & Setup

CommandArgumentsDescription
cgc mcp setupNoneConfigure IDE/MCP Client. Creates mcp.json. (Alias: cgc m)
cgc mcp startNoneStart the MCP Server (used by IDEs).
cgc mcp toolsNoneList all available MCP tools.
cgc neo4j setupNoneConfigure Neo4j database connection. (Alias: cgc n)
cgc config showNoneDisplay current configuration values.
cgc config set<key> <value>Set a configuration value.
cgc config resetNoneReset configuration to defaults.
cgc config db<backend>Quick switch between kuzudb, ladybugdb, falkordb, or neo4j.

6. Bundle Management

CommandArgumentsDescription
cgc bundle export<output.cgc> --repo --no-statsExport graph to portable .cgc bundle. (Alias: cgc export)
cgc bundle import<bundle.cgc> --clearImport a .cgc bundle into database.
cgc bundle load<name> --clearLoad bundle (downloads from registry if needed). (Alias: cgc load)

7. Bundle Registry

CommandArgumentsDescription
cgc registry list--verbose -v --unique -uList all available bundles in the registry. Use --unique to show only most recent version per package.
cgc registry search<query>Search for bundles by name/repo/description.
cgc registry download<name> --output -o --load -lDownload bundle from registry.
cgc registry request<github-url> --waitRequest on-demand bundle generation.

8. Utilities & Runtime

CommandArgumentsDescription
cgc doctorNoneRun system diagnostics (DB, dependencies, permissions).
cgc visualize[query]Generate link to Neo4j Browser. (Alias: cgc v)
cgc query<query>Execute raw Cypher query against DB.
cgc helpNoneShow main help message with all commands.
cgc versionNoneShow application version.
cgc startNoneDeprecated. Use cgc mcp start instead.

Global Options

These work with any command:

OptionShortDescription
--database-dbOverride database backend (kuzudb, ladybugdb, falkordb, or neo4j).
--visual / --viz-VShow results as interactive graph visualization.
--help-hShow help for any command.
--version-vShow version (root level only).

Shortcuts

Quick aliases for common commands:

ShortcutFull CommandDescription
cgc mcgc mcp setupMCP client setup
cgc ncgc neo4j setupNeo4j database setup
cgc icgc indexIndex repository
cgc lscgc listList repositories
cgc rmcgc deleteDelete repository
cgc vcgc visualizeVisualize graph
cgc wcgc watchWatch directory
cgc exportcgc bundle exportExport bundle
cgc loadcgc bundle loadLoad bundle

Quick Examples

Basic Workflow

cgc index .                          # Index current directory
cgc list                             # List indexed repos
cgc find name MyFunction             # Find a function
cgc analyze callers MyFunction       # See who calls it

Bundle Workflow

cgc bundle export my-project.cgc --repo .  # Export graph
cgc registry list                          # Browse bundles
cgc load flask                             # Download & load
cgc registry search web                    # Search bundles

Advanced Analysis

cgc analyze complexity --threshold 15      # Find complex code
cgc analyze chain start end --depth 10     # Find call path
cgc analyze tree MyClass --visual          # Visualize in browser

Configuration

cgc config show                      # View config
cgc config set DEFAULT_DATABASE neo4j  # Switch to Neo4j
cgc config db falkordb               # Quick switch to FalkorDB
cgc doctor                           # Check system health

Command Count Summary

Total Commands: 55

  • Project Management: 6 commands
  • Watching & Monitoring: 3 commands
  • Code Analysis: 9 commands (added 2 new)
  • Discovery & Search: 7 commands (added 4 new)
  • Configuration & Setup: 8 commands
  • Bundle Management: 3 commands
  • Bundle Registry: 4 commands
  • Utilities & Runtime: 6 commands
  • Global Options: 4 options
  • Shortcuts: 9 aliases

All commands documented! โœ…

Newly Added Commands:

  • cgc analyze overrides - Show method overrides
  • cgc analyze variable - Analyze variable usage
  • cgc find variable - Find variables by name
  • cgc find content - Search text in code
  • cgc find decorator - Find by decorator
  • cgc find argument - Find by argument name
  • Hidden: cgc cypher (deprecated, use cgc query)