能力标签
代码审查工具
🛠
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 深度解析 真实文档 完整度 78/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

rag-reviewer

Русский

AI-assisted pull-request reviews grounded in whole-repository context: hybrid search, a code graph, and inline comments anchored to changed lines.

Requires Python 3.11–3.13 and external Voyage, PostgreSQL/ParadeDB, and Neo4j services. Publishing reviews also requires credentials for the selected version-control provider.

PyPI Python 3.11–3.13 License: MIT

Requirements

  • Python >=3.11,<3.14;
  • Docker for the default PostgreSQL/ParadeDB and Neo4j stack;
  • Voyage API credentials for embeddings and reranking;
  • VCS credentials for PR reads and publication;
  • a supported AI client with the reviewer MCP integration.

Required services and credentials

Run reviewer init to write the selected env file and reviewer check to validate it. Resolution order is REVIEWER_ENV_FILE$XDG_CONFIG_HOME/rag-reviewer/.env./.env.

Important groups:

- Voyage: VOYAGE_API_KEY; - stores: PG_DSN, NEO4J_URI, NEO4J_USER, NEO4J_PASSWORD; - VCS: provider token plus optional API base; - repository scope: DEFAULT_REPO, REVIEW_BRANCHES (branch allowlist fallback; a per-repo home layer takes precedence — see Repositories and branches); - board credentials: provider-specific env declared in the registry.

Published host ports of the Compose storage services are variables, not literals: PARADEDB_PUBLISH_PORT (default 5433), NEO4J_BOLT_PUBLISH_PORT (default 7687) and NEO4J_HTTP_PUBLISH_PORT (default 7474). Container ports stay fixed. reviewer init asks for them in the storage group and derives the first two from PG_DSN and NEO4J_URI, so the client string and the published port cannot drift apart silently; a mismatch on a local host prints a warning without blocking.

PARADEDB_PUBLISH_PORT=6543 NEO4J_BOLT_PUBLISH_PORT=7999 \
  docker compose -f ~/.config/rag-reviewer/docker-compose.yml up -d

reviewer start and reviewer stop manage that Compose file for you:

reviewer start   # up -d --wait, waits for the ParadeDB and Neo4j healthchecks
reviewer stop    # stops the containers; named volumes and the built index survive

reviewer stop also stops the web admin when it was started with --profile web: without an explicit profile selection docker compose does not see it. It leaves the test services (--profile test) alone — those belong to the repository clone's own Compose project. Both storages declare stop_grace_period: 60s: the default 10s are not enough for the Neo4j JVM to shut down cleanly, which left the store to be recovered on the next start.

Both run under the explicit Compose project rag-reviewer. A clone of this repository runs its own stack under the project name rag_for_git — the two publish the same host ports and keep separate volumes, so do not run them at the same time. Contributors working inside the clone should keep using docker compose up -d there.

reviewer stop never removes volumes: it runs docker compose stop, which has no -v flag at all.

On Docker Engine older than 25.0, the start_interval healthcheck key is ignored, so the first Neo4j probe only happens after the plain interval (300s) — exactly the --wait timeout used by reviewer start. On such engines reviewer start can report a timeout failure even though the stack came up fine; upgrading Docker Engine removes the issue.

Prefer variables over editing the Compose file: a hand-edited ~/.config/rag-reviewer/docker-compose.yml no longer matches its recorded hash, so `reviewer update treats it as user-modified (status preserved`) and stops delivering new Compose definitions to it. A preserved Compose file also stops receiving new healthcheck definitions, so reviewer start falls back to waiting for the running state instead of real readiness.

Credentials stay server-side. Credentials are not returned by board metadata or discovery tools and must not be placed in .review.yml.

Deploy for a team

This route assumes that team members open their AI-client sessions on one shared host under one service account. Each client launches its own reviewer-mcp stdio process; those processes share PostgreSQL/ParadeDB and Neo4j through the Compose services bound to 127.0.0.1, plus the service account's reviewer env. It is not one central MCP daemon. MCP requests carry repository, branch, project, and provider_options, and tool results return selected code context to the AI client. For separate workstations, use secured network-accessible stores and configure their DSNs and reviewer env on every workstation instead of using the loopback Compose defaults.

  1. On the shared host, start the stores and configure secrets for the service account.
   reviewer update
   docker compose -f ~/.config/rag-reviewer/docker-compose.yml up -d
   reviewer init
   

2. Choose repository and branch scope. Set DEFAULT_REPO as the fallback repo, and either the ordered REVIEW_BRANCHES CSV allowlist in server env or (preferred) a per-repo home layer — see Repositories and branches. Put repository-specific policy, ignored paths, context limits, and non-secret board metadata in .review.yml.

  1. Build and verify every tracked branch.
   reviewer index /srv/rag_for_git --ref main --repo mimfort/rag_for_git
   reviewer check
   reviewer status /srv/rag_for_git --branch main --json
   
  1. Connect team clients.
   reviewer install --all
   reviewer install codex --dry-run
   

Run installation on the shared host as the same service account. --all configures the supported clients for that account; --dry-run reports planned config writes. Open a new chat or CLI session afterwards; IDE integrations may also require Reload Window.

5. Add optional board context. Select a registered provider in .review.yml, keep its credentials in the reviewer env, and validate the exact project:

   reviewer check --board-project TYPE=PROJECT
   

Repeat --board-project for additional providers. See Task boards and the provider reference.

Installation and configuration

Installation and updates

Persistent CLI:

uv tool install rag-reviewer
reviewer update

uv tool install takes the package name and installs both of its commands, reviewer and reviewer-mcp. Its --from option only pins a different source for the same package (--from rag-reviewer==0.4.3, --from git+…); --from PACKAGE COMMAND is uvx syntax and uv tool install rejects it.

For the one-time transition from 0.4.3, start the new lifecycle through latest uvx and explicitly allow it to upgrade the existing persistent tool:

uvx --refresh --from rag-reviewer@latest reviewer update --upgrade-tool

Every later update is the short command reviewer update. It performs one lifecycle:

  • checks PyPI and upgrades the persistent uv tool package when a newer version exists;
  • refreshes every detected AI-client MCP integration, native plugin, and file-based skill set;
  • synchronizes $XDG_CONFIG_HOME/rag-reviewer/docker-compose.yml from the canonical repository;
  • records the managed Compose content hash in .reviewer-update.json.

If the Compose file differs from its recorded hash, reviewer treats it as user-modified, leaves it unchanged, and prints a warning. Update does not run docker compose pull, restart services, remove containers, or delete volumes, so existing databases, indexes, tasks, and subsystem summaries stay intact. Apply a new Compose definition when convenient with the documented `docker compose ... up -d` command.

Temporary/latest invocation:

uvx --from rag-reviewer@latest reviewer --help

An ordinary uvx invocation never mutates a separate persistent tool; only the explicit --upgrade-tool bootstrap does. Use reviewer install CLIENT --dry-run to inspect a named integration write.

`sync-codebase` — build or update the base index

  • When: initialize an index, refresh stale code, or rebuild the graph.
  • Invoke: /rag-reviewer:sync-codebase --path /srv/repo --ref main.
  • Needs: git clone, uvx, reviewer services, Voyage, and optional SCIP.
  • Reads/writes: reads the selected git ref and writes branch-scoped vectors/graph nodes.
  • Result: incremental index report; failures name the missing prerequisite.

`pr-walkthrough` — human reading guide

  • When: orient a human reviewer without running a bug review.
  • Invoke: /rag-reviewer:pr-walkthrough owner/repo#123.
  • Needs: reviewer MCP, PR access, base index, and graph.
  • Reads/writes: reads impact/diffs/callers; posts only on explicit request.
  • Result: centrality-first reading order, per-file summary, and grounded impact notes.

Reviewer grounding in plan/review phases (optional)

Reviewer grounding in plan/review phases lets planning and review phases reuse session-less reviewer tools when the base index is current.

Reviewer grounding (plan/review, optional, fail-open). Run reviewer status /path/to/repo --branch main --json first. When drift == 0, prefer search_codebase for cross-file facts and use callers, related_symbols, definition, implementations, or family only for central symbols. The base index does not see uncommitted edits, so read changed files from disk. If reviewer or the index is unavailable, fall back to local search/read tools instead of blocking.

- family(repo, node_id, branch) — the family of look-alike symbols ("who else is like this"): inheritance plus structural contract match. For roll-out tasks ("add a field to every provider"), where one file found is a representative of a family of N.

Configuration ownership

LocationOwnerStoresMust not store
global .envdeployment/operatorsecrets, credentials, DSNs, runtime infrastructure and compatibility fallbacksrepository policy
home global YAMLOS account running reviewershared non-secret defaultscredentials
home per-repo YAMLOS account running reviewerrepository.primary_branch, repository.index_branches, operator-owned repo policycredentials
committed .review.ymlrepository teamteam-visible review policy and non-secret task-board metadatacredentials or repository
git remote / CLIrepository/operatorcanonical owner/name identity and explicit command overridespersisted secrets
Postgres / Neo4jreviewer runtimederived indexes, task/review state and code graphsource-of-truth configuration

Single repository

Run reviewer init from the clone, inspect the global .env and home per-repo previews, then run reviewer check and reviewer config show --repo owner/name.

Second repository

Run reviewer init --scope repo from the second clone. It creates or previews only that repository's home per-repo YAML and does not rewrite global .env or the first repository's config.

CI / server

Inject secrets into global .env or the process from a secret manager. Use noninteractive init only for deterministic preview/write, mount home YAML for the service account, and keep team-owned policy in committed .review.yml. Pass --repo owner/name when no usable git remote is present.

`configure-review` — update layered policy and branches

- When: tune tracked branches, ignored paths, retrieval limits, summary clustering, or board metadata. - Invoke: /rag-reviewer:configure-review. - Needs: a git repository; MCP and databases are not required for baseline analysis. - Reads/writes: reads tracked Python structure/history and changes approved YAML fields in either home:repos/<owner>/<name>.yml or committed .review.yml; branch values always go to the home per-repo YAML. - Result: preserved foreign keys/comments plus exact rebuild guidance.

CLI reference

GoalCommands
Configure and integrateinit, install, install-skills, update
Validate environmentcheck
Manage local infrastructurestart, stop
Manage indexesindex, status, search, migrate-branches, gc
Run observability UIserve
Start MCP directlyreviewer-mcp

Use reviewer COMMAND --help for the current option set. status does not spend Voyage tokens; search and indexing do.

Skills reference

The examples below use Claude-style /rag-reviewer:... invocation. Codex exposes the same namespaced skills with $rag-reviewer:....

Core workflows

Reviewer workflows are delivered as namespaced skills. Each skill defines its own read/write boundaries and confirmation gates; the MCP server performs storage, graph, VCS, and board work.

Ask a grounded codebase question

Use ask for onboarding and codebase Q&A. Answers cite real path:line locations from the base index and code graph. It reads and explains; it neither reviews a PR nor modifies code.

`ask` — grounded codebase Q&A

  • When: ask where code lives or how a subsystem works.
  • Invoke: /rag-reviewer:ask how does index freshness work?.
  • Needs: a built base index and graph.
  • Reads/writes: reads repository context and local files; does not modify or review code.
  • Result: a Russian explanation with real path:line citations.

Operations, troubleshooting, and limitations

🇨🇳 中文文档镜像 AI 翻译 2026-06-20
英文原文章节由系统翻译为中文摘要,便于快速理解。完整原文见上方 "📑 README 深度解析"。
📌 简介

rag_for_git 是一个基于 RAG(检索增强生成)技术、代码图谱(Code Graph)以及 Claude Code 构建的智能 Agent。它能够自动对 Pull Request (PR) 或 Merge Request 进行深度审查,通过结合上下文感知能力,为开发者提供精准的代码变更分析与质量评估。

📋 环境依赖

运行本项目需要 Docker 环境以及 uv 工具(包含 uvx)。此外,用户需要准备 Voyage API key 用于向量检���,以及 GitHub token 用于访问代码仓库。若需结合任务看板功能,还需配置相应的任务上下文读取权限。

🛠 安装步骤(Docker/pip/源码)

推荐使用一键安装方式:直接将提供的 Prompt 复制并粘贴到任何 AI 编程助手(如 Claude Code, Cursor, Copilot 等)中即可完成 MCP server 的设置。本项目通过 PyPI 发布的 `rag-reviewer` 包运行,建议使用 `uvx --from rag-reviewer@latest reviewer-mcp` 命令,无需手动 clone 仓库或使用 pip install。

🚀 使用教程

安装完成后,在 Claude Code 的仓库根目录下,可以通过特定的 Skill 命令进行交互。例如,使用 `/rag-reviewer:reviewer_review-pr` 来审查指定的 PR;使用 `/rag-reviewer:reviewer_sync-codebase` 来构建或更新本地代码库的向量存储与代码图谱;或使用 `sync-tasks` 来同步任务看板信息。

⚙️ 配置说明(含 MCP / env)

项目提供交互式配置向导,通过运行 `reviewer init` 命令,可以方便地设置 VOYAGE_API_KEY、GITHUB_TOKEN 以及配置存储、多仓库模式和任务看板(task board)等参数。对于 macOS/Linux 用户,手动配置 JSON 时需注意使用 `bash -lc` 包装器以确保能正确找到 uvx 路径。

🔌 API 说明

可以通过执行 `uv tool upgrade rag-reviewer` 来升级 CLI 工具。在 Windows 环境下,建议优先使用 `reviewer install` 命令进行跨平台安装,它会自动注入 uvx 的绝对路径,避免手动配置复杂的环境变量。

🔄 工作流/模块

本项目采用 MCP server (stdio transport) 架构,由 AI 助手自动启动。其核心工作流结合了 RAG 与代码图谱技术:即使在未进行全量 index 的情况下,Agent 也能基于 diff 和 overlay 进行初步审查;若需进行全仓库级别的变更影响分析,建议先针对目标分支运行 index 命令以构建完整的上下文。

📚 实用指南(长尾问题)
适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
  • 构建多智能体协作系统的 Agent 开发者
  • 构建企业知识库 / RAG 检索应用的团队
最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
  • 生产部署优先使用 Docker Compose 隔离依赖,并挂载 volume 持久化数据
  • 分块大小建议 256-512 tokens,向量库优选 pgvector 或 Qdrant
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
  • 容器内无法访问宿主机 localhost — 使用 host.docker.internal
  • embedding 模型与查询模型不一致导致检索失效
  • Python 依赖冲突:建议用 venv / uv 隔离环境
部署方案
  • Docker:rag_for_git 提供官方镜像,docker compose up 一键启动
  • CLI:直接 npm install -g / pip install,命令行调用
  • 云端托管:可放在 Vercel / Railway / Fly.io 等 PaaS 平台
相关搜索
rag_for_git 中文教程rag_for_git 安装报错怎么办rag_for_git MCP 配置rag_for_git Docker 部署rag_for_git Agent 工作流rag_for_git 与同类工具对比rag_for_git 最佳实践rag_for_git 适合谁用

⚡ 核心功能

👥 适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
  • 构建多智能体协作系统的 Agent 开发者
  • 构建企业知识库 / RAG 检索应用的团队
⭐ 最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
  • 生产部署优先使用 Docker Compose 隔离依赖,并挂载 volume 持久化数据
  • 分块大小建议 256-512 tokens,向量库优选 pgvector 或 Qdrant
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
⚠️ 常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
  • 容器内无法访问宿主机 localhost — 使用 host.docker.internal
  • embedding 模型与查询模型不一致导致检索失效

👥 适合人群

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

🎯 使用场景

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

⚖️ 优点与不足

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

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

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

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

🔗 相关工具推荐

📚 相关教程推荐
📰 相关 AI 新闻
🍿 AI 圈相关吃瓜
🗺️ 相关解决方案
🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合

❓ 常见问题 FAQ

rag_for_git 是一款Python开发的AI辅助工具。开源AI工具:Агент ревью pull/merge request'ов: RAG + граф кода + LLM (OpenRouter/Voyage)。⭐11 · Python 主要应用场景包括:自动化代码审查。
💡 AI Skill Hub 点评

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

📚 深入学习 代码审查工具
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 rag_for_git
原始描述 开源AI工具:Агент ревью pull/merge request'ов: RAG + граф кода + LLM (OpenRouter/Voyage)。⭐11 · Python
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 与自动化工具推送
加入频道 →