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 in cli.py (lines 13-22).
  • uninstall – Removes all generated data, git hooks, and skill files from the system. Found in cli.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 in cli.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 including callers_of and callees_of lookups. 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.


# 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 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.


# 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-graph executable defined in cli.py.
  • Lifecycle Coverage: Commands span from initial install through build, update, and watch to maintenance tasks like forget and postprocess.
  • Analysis Depth: Tools range from simple status checks to sophisticated impact analysis via detect-changes, impact, and query.
  • Multi-Repo Support: The register, repos, and daemon commands enable centralized management of multiple codebases.
  • AI Integration: Native MCP server support via serve and context enrichment 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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →