能力标签
🛠
AI工具

代码审查工具

基于 Python · 开源免费,本地部署,数据完全自主可控
英文名:rag_for_git
⭐ 11 Stars 💻 Python 📄 未公布协议 🏷 AI 8.0分
8.0AI 综合评分
代码审查AI工具Python
✦ AI Skill Hub 推荐

代码审查工具 是 AI Skill Hub 本期精选AI工具之一。综合评分 8.0 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。

📚 深度解析

代码审查工具 是一款基于 Python 的开源工具,在 GitHub 上收获 0k+ Star,是代码审查、AI工具、Python领域中的优质开源项目。开源工具的最大优势在于代码完全透明,你可以审计每一行代码的安全性,也可以根据自身需求进行二次开发和定制。

**为什么要使用开源工具而非商业 SaaS?**
对于个人开发者和有隐私需求的用户,本地部署的开源工具意味着数据不离本机,不受第三方服务商的数据政策约束。同时,开源工具通常没有使用次数限制和月度费用,一次安装即可长期使用,对于高频使用场景的总拥有成本(TCO)远低于订阅制商业工具。

**安装与环境准备**
代码审查工具 依赖 Python 运行环境。建议通过 pyenv(Python)或 nvm(Node.js)管理 Python 版本,避免全局环境污染。对于新手用户,推荐先创建虚拟环境(python -m venv venv && source venv/bin/activate),再安装依赖,这样即使出现问题也可以随时删除虚拟环境重新开始,不影响系统稳定性。

**社区与维护**
GitHub Issue 和 Discussion 是获取帮助的最快渠道。在提问前建议先检查 Closed Issues(已关闭的问题),大多数常见问题都已有解答。遇到 Bug 时,提供 pip list 的输出、完整错误堆栈和最小可复现示例,能显著提高开发者响应速度。AI Skill Hub 将持续追踪 代码审查工具 的版本更新,及时通知重要功能变化。

📋 工具概览

自动审查pull/merge请求,提高代码质量

代码审查工具 是一款基于 Python 开发的开源工具,专注于 代码审查、AI工具、Python 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

GitHub Stars
⭐ 11
开发语言
Python
支持平台
Windows / macOS / Linux
维护状态
轻量级项目,按需更新
开源协议
未公布
AI 综合评分
8.0 分
工具类型
AI工具
Forks

📖 中文文档

以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

自动审查pull/merge请求,提高代码质量

代码审查工具 是一款基于 Python 开发的开源工具,专注于 代码审查、AI工具、Python 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

📌 核心特色
  • 开源免费,支持本地部署,数据完全自主可控
  • 活跃的 GitHub 开源社区,持续迭代更新
  • 提供详细文档和使用示例,新手友好
  • 支持自定义配置,灵活适配不同使用环境
  • 可作为基础组件集成进现有技术栈或进行二次开发
🎯 主要使用场景
  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:pip 安装(推荐)
pip install rag_for_git

# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install rag_for_git

# 方式三:从源码安装(获取最新功能)
git clone https://github.com/mimfort/rag_for_git
cd rag_for_git
pip install -e .

# 验证安装
python -c "import rag_for_git; print('安装成功')"
📋 安装步骤说明
  1. 访问 GitHub 仓库页面
  2. 按照 README 文档完成依赖安装
  3. 根据系统环境完成初始化配置
  4. 参考官方示例或文档开始使用
  5. 遇到问题可在 GitHub Issues 中查找解答
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 命令行使用
rag_for_git --help

# 基本用法
rag_for_git input_file -o output_file

# Python 代码中调用
import rag_for_git

# 示例
result = rag_for_git.process("input")
print(result)
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
# rag_for_git 配置文件示例(config.yml)
app:
  name: "rag_for_git"
  debug: false
  log_level: "INFO"

# 运行时指定配置文件
rag_for_git --config config.yml

# 或通过环境变量配置
export RAG_FOR_GIT_API_KEY="your-key"
export RAG_FOR_GIT_OUTPUT_DIR="./output"
📑 README 深度解析 真实文档 完整度 75/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

rag_for_git

🇷🇺 Русская версия: README.ru.md

An agent that automatically reviews pull/merge requests using RAG + a code graph + Claude Code.

---

Optional task context: read the task from a board and check requirement compliance.

One-click install prompt

Copy and paste into any AI coding assistant (Claude Code, Cursor, Gemini CLI, Mimo Code, OpenCode, Kimi Code, Codex, Copilot…):

Set up the rag-reviewer MCP server in this AI tool.

Rules:
- Use `uvx --from rag-reviewer@latest reviewer-mcp` to run the server — do NOT pip install, do NOT clone the repo.
- The `bash -lc` wrapper is required on macOS/Linux so uvx is found by GUI tools: command="/bin/bash", args=["-lc", "uvx --from rag-reviewer@latest reviewer-mcp"]. On Windows use command="uvx", args=["--from","rag-reviewer@latest","reviewer-mcp"].
- Detect which AI tool you are running in, then write the MCP entry to the correct config file:
  - Claude Code / generic: .mcp.json in project root ({"mcpServers":{"reviewer":{"command":"/bin/bash","args":["-lc","uvx --from rag-reviewer@latest reviewer-mcp"]}}})
  - Cursor: ~/.cursor/mcp.json (same format)
  - Gemini CLI: ~/.gemini/settings.json ({"mcpServers":{"reviewer":{"command":"/bin/bash","args":["-lc","uvx --from rag-reviewer@latest reviewer-mcp"]}}})
  - Antigravity: ~/.gemini/antigravity/mcp_config.json (same mcpServers format)
  - Windsurf: ~/.codeium/windsurf/mcp_config.json (same mcpServers format)
  - Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows (same mcpServers format)
  - Mimo Code: ~/.config/mimocode/mimocode.json ({"mcp":{"reviewer":{"type":"local","command":["/bin/bash","-lc","uvx --from rag-reviewer@latest reviewer-mcp"],"enabled":true}}})
  - OpenCode: ~/.config/opencode/opencode.json ({"mcp":{"reviewer":{"type":"local","command":["/bin/bash","-lc","uvx --from rag-reviewer@latest reviewer-mcp"]}}})
  - Kimi Code: ~/.kimi-code/mcp.json ({"mcpServers":{"reviewer":{"command":"/bin/bash","args":["-lc","uvx --from rag-reviewer@latest reviewer-mcp"]}}})
  - Codex CLI: ~/.codex/config.toml ([mcp_servers.reviewer] command="/bin/bash" args=["-lc","uvx --from rag-reviewer@latest reviewer-mcp"])
  - VS Code: ~/Library/Application Support/Code/User/mcp.json (key is "servers" not "mcpServers": {"servers":{"reviewer":{"command":"/bin/bash","args":["-lc","uvx --from rag-reviewer@latest reviewer-mcp"]}}})
- After writing the config, run: uvx --from rag-reviewer reviewer check
- Report what config file was written and whether the check passed.

---

Installation

The MCP server is published on PyPI as rag-reviewer and runs via uvxno clone of this repo required.

Requirements: Docker, uv (includes uvx), a Voyage API key, a GitHub token.

0) Install the reviewer CLI — once, globally

uv tool install rag-reviewer

uv and uvx are the same binary; installing uv gives you both.

or a specific one: reviewer install cursor|vscode|claude-code|windsurf|gemini|antigravity|mimo|opencode|kimi|trae|codex

3. Install skills globally (optional)

Skills (reviewer_review-pr, reviewer_solve-task, reviewer_sync-codebase, reviewer_sync-tasks, reviewer_performance-review, reviewer_maintainability-review, reviewer_ask) let you invoke the full review workflow with a single command. Without them you can still call MCP tools directly, but the skills wrap them into a guided flow.

reviewer install already installs them for clients that support file-based skills (Gemini, Mimo, Kimi). To (re)install just the skills — or pick a specific client — use:

uvx --from rag-reviewer reviewer install-skills --all     # all detected skills-capable clients
uvx --from rag-reviewer reviewer install-skills gemini    # a specific one
uvx --from rag-reviewer reviewer install-skills --list    # show targets + directories

It downloads the skills from GitHub (no repo clone) and unpacks them into each client's global skills directory, with a path-traversal guard. Manual fallback (equivalent):

curl -sL https://github.com/mimfort/rag_for_git/archive/refs/heads/main.tar.gz -o /tmp/rag-reviewer.tgz
mkdir -p ~/.gemini/skills
tar xz -C ~/.gemini/skills --strip-components=3 -f /tmp/rag-reviewer.tgz 'rag_for_git-main/plugin/skills'
rm /tmp/rag-reviewer.tgz
ToolGlobal skills directory
Gemini CLI~/.gemini/skills/
Mimo Code~/.config/mimocode/skills/
Kimi Code~/.kimi-code/skills/ + extra_skill_dirs in ~/.kimi-code/config.toml
OpenCode~/.config/opencode/skills/
Claude Codebundled in the plugin (step above)
Cursorproject-level via .cursor-plugin/plugin.json

---

That's it. Build the base index (recommended — see CLI) and review a PR (see Plugin usage).

Register the MCP server (and skills) in installed AI clients automatically (cross-platform).

--all auto-detects installed clients; or name one: cursor, claude-desktop, claude-code,

Skills are installed for clients that support them (Gemini/Mimo/Kimi); --no-skills to skip.

Install only the skills into a client's global skills directory (Gemini/Mimo/Kimi).

Build/update the base index of the target branch from a local clone (vectors + graph).

Build the index for a second tracked branch (isolated index, same deployment).

uvx --from rag-reviewer reviewer index /path/to/repo --ref master --repo owner/name

Plugin usage

With the plugin installed (see Installation) and Claude Code open at the repo root, call a skill:

/rag-reviewer:reviewer_review-pr owner/repo#42     # review a PR (prepare_review → subagents → publish_review)
/rag-reviewer:reviewer_sync-codebase               # build/update vector store + code graph from local clone
/rag-reviewer:reviewer_sync-tasks                  # warm the task graph & vector store (server-side ETL via sync_board)
/rag-reviewer:reviewer_solve-task <key | free text>  # gather disciplined context for a task, then hand off to dev

A typical end-to-end run:

```bash git clone https://github.com/ORG/REPO /tmp/REPO reviewer index /tmp/REPO --ref main # build base index + graph for main reviewer index /tmp/REPO --ref master # optionally index a second branch (REVIEW_BRANCHES=main,master)

2) Configure keys and settings interactively

reviewer init

Interactive wizard: fills VOYAGE_API_KEY, GITHUB_TOKEN, and optional groups

(stores, multi-repo, task board). Re-run any time to update settings.

Create ~/.config/rag-reviewer/.env from template (fill in VOYAGE_API_KEY + GITHUB_TOKEN).

Check environment readiness: keys, Postgres, Neo4j, GitHub. Prints ✓/✗ per item;

or DEFAULT_REPO is set in .env.

uvx --from rag-reviewer reviewer index /path/to/repo --ref main --repo owner/name

Update CLI later:

uv tool upgrade rag-reviewer ```

reviewer install is cross-platform (Windows / macOS / Linux). It injects the absolute path to uvx automatically — no bash -lc wrapper needed. The manual JSON configs below use bash -lc for macOS/Linux only; on Windows use reviewer install or set "command": "uvx" with `"args": ["--from", "rag-reviewer@latest", "reviewer-mcp"]` directly.
Claude Code: tools work out of the box. reviewer install claude-code also writes an allowlist rule mcp__reviewer__* into your global ~/.claude/settings.json (permissions.allow), so the reviewer MCP tools run in every project without hitting the auto-mode safety classifier — no manual settings edits. Being global, it also covers the plugin (marketplace) install, where the server is available everywhere but ships no permission grants.
Where keys are read from. The reviewer resolves its .env from a fixed location, not the current working directory — MCP clients launch the server with an arbitrary CWD, so a project-local .env is unreliable. Lookup order: $REVIEWER_ENV_FILE$XDG_CONFIG_HOME/rag-reviewer/.env (default ~/.config/rag-reviewer/.env) → ./.env (handy when running from a repo clone). Real environment variables always win over the file, so you can instead pass keys via an "env": { "VOYAGE_API_KEY": "…", "GITHUB_TOKEN": "…" } block in your MCP client config — works in every client.

- Voyage (VOYAGE_API_KEY): https://dashboard.voyageai.com/ — free token pool; attach a card to lift the 3 RPM / 10K TPM limit (charged only beyond the free pool). - GitHub (GITHUB_TOKEN): a PAT with Pull requests: Read and write + Contents: Read (fine-grained) or the repo scope (classic). Quick option: gh auth token.

All other settings have defaults (documented in .env.example). DEFAULT_REPO (optional) sets the default owner/name for single-repo deployments. REVIEW_BRANCHES (optional, CSV, default main) lists the branches to track — each gets its own isolated base index; PRs targeting a branch outside this list are silently skipped by prepare_review. TASK_BOARD_TYPE / TASK_BOARD_MCP / TASK_BOARD_KEY_PATTERN / TASK_BOARD_URL_TEMPLATE (optional) configure the task board once for the whole deployment, so it need not be repeated in every repo's .review.yml (see Per-repo policy below).

MCP server (stdio transport) — started automatically by the plugin.

uvx --from rag-reviewer@latest reviewer-mcp ```

Reviewing works even without a prior index — context is then limited to the diff and the overlay (RAG/graph are "thin"). For full whole-repo impact analysis, run index against the target branch.

The board (MCP) is connected by the user on the Claude Code side; the plugin does not bundle it.

task_board: type: yougile # yougile | jira — selects the skill playbook mcp: yougile # name of the connected board MCP server (tools are mcp<mcp>*) key_pattern: "[A-Z]+-\\d+" # optional; matches Yougile PRI-34/ID-34 and Jira PROJ-123 ```

The task_board block is a deploy-wide default, not a per-repo requirement. A board connection is the same for every repo of one team, so configure it once in the reviewer .env (TASK_BOARD_TYPE / TASK_BOARD_MCP / TASK_BOARD_KEY_PATTERN / TASK_BOARD_URL_TEMPLATE) and every repo inherits it — no .review.yml needed just for the board. A task_board block in a repo's .review.yml overrides that default for that repo; an explicit empty task_board: disables the board for it. review-pr reads this through the policy; solve-task reads it via the get_board_config MCP tool (and the board-MCP, LLM-side) as a fallback when the local .review.yml has no block.

Bulk task sync is server-side, not LLM (sync_board). The sync-tasks skill is a thin trigger: it calls one MCP tool, sync_board(board, limit, purge_orphaned, keep_with_prs), and the reviewer server enumerates the board over REST itself (reviewer/tasks/boards/, behind a TaskBoardProvider interface — Yougile is the reference), normalizes each task into a TaskBrief in Python, and indexes it via the existing batch indexer. The LLM passes no task text, so a sync costs O(1) tokens regardless of board size. It is incremental via a per-board timestamp watermark in index_meta (ref="tasks:<board>"): a repeat sync touches ~0 tasks; --limit disables purge and the watermark advance. The board REST credentials live only in the reviewer-mcp environment (TASK_BOARD_API_KEY / TASK_BOARD_API_BASE). This inverts the "reviewer Python never touches the board" rule for bulk sync only — single-task reads in solve-task / review-pr still go through the board-MCP on the LLM side.

Manual setup (alternative)

If you prefer to configure your client config by hand rather than using reviewer install:

Each AI coding tool has its own config file. Pick yours:

ToolGlobal config fileProject configInstall guide
**Claude Code**/plugin marketplace add (see below).claude-plugin/
**Cursor**~/.cursor/mcp.json.cursor/mcp.json
**Windsurf**~/.codeium/windsurf/mcp_config.json
**Claude Desktop**macOS: ~/Library/Application Support/Claude/claude_desktop_config.json; Windows: %APPDATA%\Claude\claude_desktop_config.json
**Antigravity**~/.gemini/antigravity/mcp_config.json
**Mimo Code**~/.config/mimocode/mimocode.json.mimocode/mimocode.json[INSTALL.md](.mimocode/INSTALL.md)
**OpenCode**~/.config/opencode/opencode.json.opencode/opencode.json[INSTALL.md](.opencode/INSTALL.md)
**Kimi Code**~/.kimi-code/mcp.json.kimi-code/mcp.json[INSTALL.md](.kimi-code/INSTALL.md)
**Gemini CLI**~/.gemini/settings.json.gemini/settings.json[GEMINI.md](GEMINI.md)
**Codex CLI**~/.codex/config.toml.codex-plugin/plugin.json[AGENTS.md](AGENTS.md)
**Copilot CLI**.github-copilot/plugin.json
**Trae IDE**~/Library/Application Support/Trae/User/mcp.json
**VS Code**~/Library/Application Support/Code/User/mcp.json (key: servers, not mcpServers)

Files marked ✓ are already present in this repo — if you open rag_for_git as a project in that tool, the MCP server auto-connects. For a global install (works from any project), add the entry to the corresponding global config file.

The MCP entry format by tool (macOS/Linux — use reviewer install on Windows):

Mimo Code (mimocode.json):

{
  "$schema": "https://mimo.xiaomi.com//config.json",
  "mcp": {
    "reviewer": {
      "type": "local",
      "command": ["/bin/bash", "-lc", "uvx --from rag-reviewer@latest reviewer-mcp"],
      "enabled": true
    }
  }
}

OpenCode (opencode.json):

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "reviewer": {
      "type": "local",
      "command": ["/bin/bash", "-lc", "uvx --from rag-reviewer@latest reviewer-mcp"]
    }
  }
}

Kimi Code / Cursor / Gemini CLI / Codex CLI / Trae / Claude Desktop / Windsurf / Antigravity (standard mcpServers JSON):

{
  "mcpServers": {
    "reviewer": {
      "command": "/bin/bash",
      "args": ["-lc", "uvx --from rag-reviewer@latest reviewer-mcp"]
    }
  }
}

VS Code (mcp.json — note: key is servers, not mcpServers):

{
  "servers": {
    "reviewer": {
      "command": "/bin/bash",
      "args": ["-lc", "uvx --from rag-reviewer@latest reviewer-mcp"]
    }
  }
}

Codex CLI (~/.codex/config.toml):

[mcp_servers.reviewer]
command = "/bin/bash"
args = ["-lc", "uvx --from rag-reviewer@latest reviewer-mcp"]

After adding, restart the tool — reviewer will appear alongside other MCP servers.

Claude Code

Two commands, from any project:

/plugin marketplace add mimfort/rag_for_git
/plugin install rag-reviewer@rag-reviewer-marketplace

You get:

- Skills: /rag-reviewer:reviewer_review-pr, /rag-reviewer:reviewer_solve-task, /rag-reviewer:reviewer_sync-codebase, /rag-reviewer:reviewer_sync-tasks (plus /rag-reviewer:reviewer_maintainability-review, /rag-reviewer:reviewer_performance-review, and /rag-reviewer:reviewer_ask). - MCP server reviewer exposing: prepare_review, publish_review, search_code, get_related_symbols, read_file, get_definition, find_callers, get_changed_file_diff, index_task, search_tasks, get_task_context, search_codebase. Alongside search_codebase, session-less graph tools related_symbols/callers/definition (graph traversal without a PR session) are available — used by the /rag-reviewer:reviewer_ask skill for grounded codebase Q&A.

Run /plugin to confirm rag-reviewer is installed and enabled.

⚡ 核心功能

👥 适合人群

AI 技术爱好者研究人员和学生开发者和工程师技术创业者

🎯 使用场景

  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发

⚖️ 优点与不足

✅ 优点
  • +完全开源免费,无授权费用
  • +本地部署,数据完全自主可控
  • +开发者社区支持,遇问题可查可问
⚠️ 不足
  • 未明确开源协议,商用场景需谨慎评估
  • 安装和初始配置可能需要一定技术基础
  • 功能完整性通常不如成熟商业产品
  • 技术支持主要依赖开源社区,响应速度不稳定
⚠️ 使用须知

该工具未明确声明开源协议,商业使用前请联系原作者确认授权范围,避免侵权风险。

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

🔗 相关工具推荐

🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合

❓ 常见问题 FAQ

参考README.md
💡 AI Skill Hub 点评

经综合评估,代码审查工具 在AI工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。

📚 深入学习 代码审查工具
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 rag_for_git
Topics 代码审查AI工具Python
GitHub https://github.com/mimfort/rag_for_git
语言 Python
🔗 原始来源
🐙 GitHub 仓库  https://github.com/mimfort/rag_for_git

收录时间:2026-06-20 · 更新时间:2026-06-20 · License:未公布 · AI Skill Hub 不对第三方内容的准确性作法律背书。

📺 订阅 AI Skill Hub Daily Telegram 频道
每天 8 条精选 AI Skill、MCP、Agent 与自动化工具推送
加入频道 →