OpenSource-Hub

code-review-graph

命令行工具

tirth8205/code-review-graph

本地优先的代码智能图谱,用于 AI 代码审查。

项目简介

使用 Tree-sitter 构建代码库的持久化结构图谱。增量跟踪变更,通过 MCP 为 AI 编程工具提供精准上下文。大幅减少代码审查中的令牌消耗。

README 预览

code-review-graph\n\n\n  Stop burning tokens. Start reviewing smarter.\n\n\n\n  English |\n  简体中文 |\n  日本語 |\n  한국어 |\n  हिन्दी\n\n\n\n  \n  \n  \n  \n  \n  \n  \n  \n  \n\n\n\n  Usage ·\n  Commands ·\n  FAQ ·\n  Troubleshooting ·\n  GitHub Action ·\n  Reproducing the benchmarks ·\n  Roadmap\n\n\n\n\nAI coding tools can end up re-reading large parts of your codebase on review tasks. `code-review-graph` fixes that. It builds a structural map of your code with [Tree-sitter](https://tree-sitter.github.io/tree-sitter/), tracks changes incrementally, and gives your AI assistant precise context via [MCP](https://modelcontextprotocol.io/) so it reads only what matters.\n\n\n  \n\n\n---\n\n## Quick Start\n\n```bash\npip install code-review-graph                     # or: pipx install code-review-graph\ncode-review-graph install          # auto-detects and configures all supported platforms\ncode-review-graph build            # parse your codebase\n```\n\nOne command sets up everything. `install` detects which AI coding tools you have, writes the correct MCP configuration for each one, installs platform-native hooks/skills where supported, and injects graph-aware instructions into your platform rules. It auto-detects whether you installed via `uvx` or `pip`/`pipx` and generates the right config. Restart your editor/tool after installing.\n\n\n  \n\n\nTo target a specific platform:\n\n```bash\ncode-review-graph install --platform codex       # configure only Codex\ncode-review-graph install --platform cursor      # configure only Cursor\ncode-review-graph install --platform claude-code  # configure only Claude Code\ncode-review-graph install --platform gemini-cli   # configure only Gemini CLI\ncode-review-graph install --platform kiro         # configure only Kiro\ncode-review-graph install --platform copilot      # configure only GitHub Copilot (VS Code)\ncode-review-graph install --platform copilot-cli  # configure only GitHub Copilot CLI\ncode-review-graph install --platfo