CLI
codegraph # Run interactive installercodegraph install # Run installer (explicit)codegraph uninstall # Remove CodeGraph from your agents (inverse of install)codegraph init [path] # Initialize in a project (--index to also index)codegraph uninit [path] # Remove CodeGraph from a project (--force to skip prompt)codegraph index [path] # Full index (--force to re-index, --quiet for less output)codegraph sync [path] # Incremental updatecodegraph status [path] # Show statisticscodegraph query <search> # Search symbols (--kind, --limit, --json)codegraph files [path] # Show file structure (--format, --filter, --max-depth, --json)codegraph context <task> # Build context for AI (--format, --max-nodes)codegraph callers <symbol> # Find what calls a function/method (--limit, --json)codegraph callees <symbol> # Find what a function/method calls (--limit, --json)codegraph impact <symbol> # Analyze what code is affected by changing a symbol (--depth, --json)codegraph affected [files...] # Find test files affected by changescodegraph serve --mcp # Start MCP serverQuery commands
Section titled “Query commands”query, callers, callees, and impact all accept --json for machine-readable output.
codegraph query UserService --kind class --limit 10codegraph callers handleRequest --jsoncodegraph impact AuthMiddleware --depth 3affected
Section titled “affected”Traces import dependencies transitively to find which test files are affected by changed source files. See Affected Tests in CI for options and a CI example.