Code Review Graph CLI Commands: Complete Guide to All Available Tools
Code Review Graph exposes over 20 subcommands through a single code-review-graph executable, covering graph construction, incremental updates, impact analysis, visualization, and AI assistant integration.
The open-source repository tirth8205/code-review-graph implements its entire command-line interface in [code_review_graph/cli.py](https://github.com/tirth8205/code-review-graph/blob/main/code_review_graph/cli.py). These CLI commands for Code Review Graph transform raw source code into queryable knowledge graphs while providing tools for continuous maintenance and change-impact detection.
Core Setup Commands
The installation group handles MCP (Multi-Chat-Platform) configuration for AI coding assistants and cleanup operations.
install/init– Registers MCP configs for detected AI coding platforms. Implemented incli.py(lines 13-22).uninstall– Removes all generated data, git hooks, and skill files from the system. Found incli.py(lines 92-106).
# Register MCP configs for all detected platforms
code-review-graph install --yes
# Clean all generated artifacts
code-review-graph uninstall
Graph Lifecycle Management
These commands control the creation, updating, and maintenance of the codebase knowledge graph.
build– Performs a full parse of every source file to construct the initial graph. Located at lines 36-55 incli.py.update– Executes incremental rebuilds based on git diff detection. See lines 57-78.watch– Runs a continuous file system monitor that auto-updates the graph as changes occur. Lines 40-48.status– Displays statistics about the current graph state, with optional JSON output via--json. Lines 50-60.postprocess– Runs community detection algorithms, execution flow analysis, and rebuilds full-text search indexes. Lines 80-89.forget– Selectively drops specific files from the graph without triggering a full rebuild. Lines 66-89.
# Full initial build
code-review-graph build
# Incremental update after commits
code-review-graph update --brief
# Continuous monitoring
code-review-graph watch
# Check graph statistics
code-review-graph status --json
Change Impact and Query Tools
This extensive category provides read-only analysis, blast-radius calculation, and code quality inspection.
detect-changes– Analyzes git diffs for impact risk scoring and token-saving recommendations. Lines 82-100.query– Executes generic graph traversals includingcallers_ofandcallees_oflookups. Lines 150-164.impact– Calculates blast-radius for specified changed files. Lines 166-176.search– Performs semantic or keyword searches across the graph nodes. Lines 178-188.flows/flow– Lists stored execution flows or inspects specific flow details by criticality. Lines 190-211.communities/community– Lists detected graph communities or inspects specific community structure. Lines 213-232.architecture– Generates high-level architecture overviews. Lines 234-241.large-functions– Identifies oversized nodes exceeding configured thresholds. Lines 242-251.refactor– Previews rename suggestions and dead-code elimination candidates. Lines 252-262.dead-code– Lists functions or classes with no callers or test coverage. Lines 264-274.
# Analyze last commit impact
code-review-graph detect-changes --brief
# Find all callers of a specific function
code-review-graph query callers_of my_module.my_func
# Calculate blast radius for changed files
code-review-graph impact --files src/core.py,src/utils.py
# Semantic search
code-review-graph search "database connection handling"
Visualization and Documentation
Generate human-readable artifacts from the graph structure.
visualize– Creates interactive HTML graphs or exports to alternative formats like GraphML. Implemented incli.py(lines 91-103) using [code_review_graph/visualization.py](https://github.com/tirth8205/code-review-graph/blob/main/code_review_graph/visualization.py).wiki– Generates markdown wiki pages from detected community structures. Lines 115-124, backed by [code_review_graph/wiki.py](https://github.com/tirth8205/code-review-graph/blob/main/code_review_graph/wiki.py).
# Launch interactive browser visualization
code-review-graph visualize --serve
# Generate community wiki
code-review-graph wiki --force
Repository and Daemon Management
Manage multiple repositories and background processes.
register– Adds a repository to the multi-repo registry with optional alias. Lines 306-313.unregister– Removes a repository from the registry. Lines 315-321.repos– Lists all registered repositories. Lines 322-324.daemon– Controls a background watch daemon with sub-operations:start,stop,restart,status,logs,add, andremove. Lines 328-376, utilizing [code_review_graph/daemon_cli.py](https://github.com/tirth8205/code-review-graph/blob/main/code_review_graph/daemon_cli.py).
# Register additional repository
code-review-graph register /path/to/repo --alias backend
# Start background daemon
code-review-graph daemon start
# View daemon logs
code-review-graph daemon logs
AI Assistant Integration
Commands for MCP server operation and context enrichment.
serve/mcp– Launches the MCP server (stdio by default, optional HTTP mode) exposingqueryandsearchtools. Lines 378-416 and 418-426.embed– Computes vector embeddings for semantic search, supporting multiple provider/model combinations. Lines 408-430.enrich– Runs the Claude-Code "pre-tool-use" hook, reading JSON from stdin and augmenting with graph context. Lines 480-486, implemented in [code_review_graph/enrich.py](https://github.com/tirth8205/code-review-graph/blob/main/code_review_graph/enrich.py).
# Start MCP server over HTTP
code-review-graph serve --http --tools query,search
# Compute local embeddings
code-review-graph embed --provider local
# Hook integration
code-review-graph enrich < request.json
Evaluation and Benchmarking
eval– Executes benchmark suites measuring token-efficiency, impact-accuracy, and retrieval precision. Lines 442-563.
# Run full evaluation suite
code-review-graph eval --all --report
Summary
- Unified Entry Point: All functionality routes through the
code-review-graphexecutable defined incli.py. - Lifecycle Coverage: Commands span from initial
installthroughbuild,update, andwatchto maintenance tasks likeforgetandpostprocess. - Analysis Depth: Tools range from simple
statuschecks to sophisticated impact analysis viadetect-changes,impact, andquery. - Multi-Repo Support: The
register,repos, anddaemoncommands enable centralized management of multiple codebases. - AI Integration: Native MCP server support via
serveand contextenrichment hooks bridge the graph with AI coding assistants.
Frequently Asked Questions
What is the main entry point for Code Review Graph commands?
The primary executable is code-review-graph, which acts as a dispatcher to over 20 subcommands. The argument parser and command routing logic reside in [code_review_graph/cli.py](https://github.com/tirth8205/code-review-graph/blob/main/code_review_graph/cli.py), with specific implementations delegated to modules like tools.py, daemon_cli.py, and main.py.
How do I update the graph after making code changes?
Use the update command for incremental rebuilds based on git diffs, or watch for continuous automatic updates. The update command (lines 57-78) processes only changed files, while watch (lines 40-48) monitors the filesystem in real-time. For selective removal without rebuilding, use forget.
Can Code Review Graph analyze multiple repositories simultaneously?
Yes. The register command adds repositories to a central registry (lines 306-313), while the daemon command (lines 328-376) can supervise multiple registered repositories simultaneously. Use repos to list registered locations and daemon start to enable background monitoring across all registered projects.
How does the MCP server integration work?
The serve (or mcp) command launches a Multi-Chat-Platform server (lines 378-426) that exposes graph tools like query and search to AI assistants. It supports stdio transport for direct editor integration or HTTP mode via --http. The enrich command (lines 480-486) provides a hook mechanism for Claude-Code that injects graph context into tool calls.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →