cli-review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

CLI Review

CLI 审查

Run a Greptile review from the local checkout and summarize the findings.
从本地检出的代码库运行 Greptile 审查并总结结果。

Instructions

使用说明

1. Confirm repository context

1. 确认仓库上下文

Start from the current repository root:
bash
git rev-parse --show-toplevel
If the command fails, tell the user that the Greptile CLI review must be run from a git repository.
从当前仓库根目录开始操作:
bash
git rev-parse --show-toplevel
如果该命令执行失败,请告知用户 Greptile CLI 审查必须在 git 仓库中运行。

2. Check for the Greptile CLI

2. 检查 Greptile CLI 是否安装

Check whether
greptile
is installed:
bash
command -v greptile
If it is missing, do not install it automatically. Ask the user for permission, then show the recommended install command:
bash
npm i -g greptile
If npm is unavailable, offer the shell installer fallback:
bash
curl -fsSL "https://greptile.com/cli/install" | sh
After installation, re-run
command -v greptile
.
检查是否已安装
greptile
:
bash
command -v greptile
若未安装,请勿自动执行安装。需先征得用户同意,再展示推荐的安装命令:
bash
npm i -g greptile
如果无法使用 npm,提供 shell 安装脚本作为备选方案:
bash
curl -fsSL "https://greptile.com/cli/install" | sh
安装完成后,重新执行
command -v greptile
命令验证。

3. Ensure authentication

3. 确保身份验证已完成

Check the signed-in account:
bash
greptile whoami
If the CLI reports that authentication is missing, run:
bash
greptile login
Wait for the user to complete the login flow before continuing.
检查当前登录账号:
bash
greptile whoami
如果 CLI 提示未完成身份验证,请运行:
bash
greptile login
等待用户完成登录流程后再继续后续操作。

4. Run the review

4. 运行审查

Prefer JSON output:
bash
greptile review --json
If JSON output is unsupported or fails with a usage error, fall back to:
bash
greptile review --agent
Do not hide the raw command failure if both commands fail. Summarize the failing command and the next action the user needs to take.
优先使用 JSON 格式输出:
bash
greptile review --json
如果不支持 JSON 输出或因使用错误导致执行失败,请回退使用以下命令:
bash
greptile review --agent
若两个命令均执行失败,请勿隐藏原始命令报错。需总结失败的命令以及用户需要采取的下一步操作。

5. Summarize results

5. 总结结果

Parse JSON output when available and report:
  • Review status
  • Number of findings
  • Highest severity findings first
  • Files that need edits
  • Suggested next command or fix path
When output is plain text, preserve the same structure as much as possible. Keep the summary concise and focused on actionable findings.
若存在 JSON 输出,对其进行解析并报告以下内容:
  • 审查状态
  • 问题数量
  • 按严重程度从高到低排序展示问题
  • 需要修改的文件
  • 建议的下一步命令或修复路径
若输出为纯文本格式,尽可能保持相同的结构。总结需简洁明了,聚焦于可落地处理的问题。