code-review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCodeRabbit Code Review
CodeRabbit代码审查
AI-powered code review using CodeRabbit. Enables developers to implement features, review code, and fix issues in autonomous cycles without manual intervention.
使用CodeRabbit的AI驱动代码审查。让开发者能够在无需人工干预的自主循环中实现功能、审查代码并修复问题。
Capabilities
功能特性
- Finds bugs, security issues, and quality risks in changed code
- Groups findings by severity (Critical, Warning, Info)
- Works on staged, committed, or all changes; supports base branch/commit
- Provides fix suggestions () or minimal output for agents (
--plain)--prompt-only
- 发现变更代码中的bug、安全问题和质量风险
- 按严重程度(Critical、Warning、Info)对发现的问题进行分组
- 支持暂存、已提交或所有变更;支持基准分支/提交
- 提供修复建议()或面向Agent的极简输出(
--plain)--prompt-only
When to Use
使用场景
When user asks to:
- Review code changes / Review my code
- Check code quality / Find bugs or security issues
- Get PR feedback / Pull request review
- What's wrong with my code / my changes
- Run coderabbit / Use coderabbit
当用户要求:
- 审查代码变更 / 审查我的代码
- 检查代码质量 / 查找bug或安全问题
- 获取PR反馈 / 拉取请求审查
- 我的代码/变更有什么问题
- 运行coderabbit / 使用coderabbit
How to Review
审查步骤
1. Check Prerequisites
1. 检查先决条件
bash
coderabbit --version 2>/dev/null || echo "NOT_INSTALLED"
coderabbit auth status 2>&1If CLI not installed, tell user:
text
Please install CodeRabbit CLI first:
curl -fsSL https://cli.coderabbit.ai/install.sh | shIf not authenticated, tell user:
text
Please authenticate first:
coderabbit auth loginbash
coderabbit --version 2>/dev/null || echo "NOT_INSTALLED"
coderabbit auth status 2>&1如果未安装CLI,告知用户:
text
请先安装CodeRabbit CLI:
curl -fsSL https://cli.coderabbit.ai/install.sh | sh如果未认证,告知用户:
text
请先进行认证:
coderabbit auth login2. Run Review
2. 运行审查
Use for minimal output optimized for AI agents:
--prompt-onlybash
coderabbit review --prompt-onlyOr use for detailed feedback with fix suggestions:
--plainbash
coderabbit review --plainOptions:
| Flag | Description |
|---|---|
| All changes (default) |
| Committed changes only |
| Uncommitted changes only |
| Compare against specific branch |
| Compare against specific commit hash |
| Minimal output optimized for AI agents |
| Detailed feedback with fix suggestions |
Shorthand: is an alias for :
crcoderabbitbash
cr review --prompt-only使用获取面向AI Agent优化的极简输出:
--prompt-onlybash
coderabbit review --prompt-only或者使用获取包含修复建议的详细反馈:
--plainbash
coderabbit review --plain可选参数:
| 标志 | 描述 |
|---|---|
| 所有变更(默认) |
| 仅已提交的变更 |
| 仅未提交的变更 |
| 与特定分支对比 |
| 与特定提交哈希对比 |
| 面向AI Agent优化的极简输出 |
| 包含修复建议的详细反馈 |
简写: 是的别名:
crcoderabbitbash
cr review --prompt-only3. Present Results
3. 展示结果
Group findings by severity:
- Critical - Security vulnerabilities, data loss risks, crashes
- Warning - Bugs, performance issues, anti-patterns
- Info - Style issues, suggestions, minor improvements
Create a task list for issues found that need to be addressed.
按严重程度分组展示结果:
- Critical - 安全漏洞、数据丢失风险、崩溃问题
- Warning - Bug、性能问题、反模式
- Info - 样式问题、建议、小改进
为需要解决的问题创建任务列表。
4. Fix Issues (Autonomous Workflow)
4. 修复问题(自主工作流)
When user requests implementation + review:
- Implement the requested feature
- Run
coderabbit review --prompt-only - Create task list from findings
- Fix critical and warning issues systematically
- Re-run review to verify fixes
- Repeat until clean or only info-level issues remain
当用户要求实现+审查时:
- 实现所需功能
- 运行
coderabbit review --prompt-only - 根据发现的问题创建任务列表
- 系统地修复Critical和Warning级别的问题
- 重新运行审查以验证修复
- 重复直到无问题或仅剩余Info级别问题
5. Review Specific Changes
5. 审查特定变更
Review only uncommitted changes:
bash
cr review --prompt-only -t uncommittedReview against a branch:
bash
cr review --prompt-only --base mainReview a specific commit range:
bash
cr review --prompt-only --base-commit abc123仅审查未提交的变更:
bash
cr review --prompt-only -t uncommitted与某分支对比审查:
bash
cr review --prompt-only --base main审查特定提交范围:
bash
cr review --prompt-only --base-commit abc123Documentation
文档
For more details: https://docs.coderabbit.ai/cli