coderabbit-config

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

CodeRabbit Configuration

CodeRabbit 配置

Requires config protocol v2, a Git working tree, and network access to the current configuration schema.
Keep configuration generation, schema validation, previews, and repository writes in the CLI. Do not edit repository YAML yourself, copy a schema, or implement a fallback editor. Configuration is local; it does not need CodeRabbit login or start a review.
需要配置协议 v2、Git 工作树,以及访问当前配置 schema 的网络连接。
将配置生成、schema 校验、预览和仓库写入都留在 CLI 中完成。不要自行编辑仓库 YAML、复制 schema,或实现回退编辑器。配置仅保存在本地;无需登录 CodeRabbit,也无需启动审查。

Find the CLI and requested repository

查找 CLI 和目标仓库

Use the intended Git working tree for every invocation. Select the installed workflow before looking for a standalone CLI:
  • The native Claude source plugin uses the standalone CLI discovery below. Its remote MCP connection does not provide a managed local runtime.
  • For another installed package that explicitly declares a managed runtime, use its verified launcher and preparation instructions.
  • For standalone installs, resolve an official installed
    coderabbit
    to a quoted canonical absolute path, checking PATH and the documented installer location
    ~/.local/bin/coderabbit
    on macOS/Linux. Reject repository-local executables, aliases, and unknown wrappers. If the installation source is uncertain, ask the user to identify their installation. A source checkout's
    cli.json
    alone does not select a managed runtime.
The
<cli>
examples below mean that verified executable, not a literal command.
Check
<cli> --version
,
<cli> config --help
, and support for the needed subcommands. CLI 0.9.3 supports this workflow. Missing commands or an unsupported protocol require an upgrade. For a standalone CLI, follow the official installation instructions for its actual installation method (for example,
brew upgrade coderabbit
for Homebrew). For a managed runtime, update the plugin to a version with a compatible pinned CLI and follow its preparation instructions; never run
<cli> update
on the managed launcher. Do not install or upgrade without authorization. Preserve permission and network errors as such; they do not prove an upgrade is needed. After any upgrade, repeat trusted executable discovery and verification, then recheck version and command support. Do not reuse the old canonical path: an upgrade can replace a versioned installation directory or managed launcher.
每次调用都使用目标 Git 工作树。在查找独立 CLI 前,先选择已安装的工作流:
  • 原生 Claude source plugin 使用下方的独立 CLI 发现方式。其远程 MCP 连接不提供托管的本地运行时。
  • 对于明确声明了托管运行时的其他已安装包,使用经过验证的启动器及其准备说明。
  • 对于独立安装,在 macOS/Linux 中检查 PATH 和文档指定的安装位置
    ~/.local/bin/coderabbit
    ,将官方安装的
    coderabbit
    解析为带引号的规范绝对路径。拒绝使用仓库内的可执行文件、别名和未知包装器。如果无法确定安装来源,请让用户说明其安装方式。源码 checkout 中的
    cli.json
    本身不能作为选择托管运行时的依据。
下方的
<cli>
示例指该经过验证的可执行文件,而不是字面命令。
检查
<cli> --version
、
<cli> config --help
以及所需子命令是否可用。CLI 0.9.3 支持此工作流。如果缺少命令或不支持所需协议,则需要升级。对于独立 CLI,请按照官方安装说明中的实际安装方式执行操作,例如使用 Homebrew 时运行
brew upgrade coderabbit
。 对于托管运行时,请将 plugin 更新到包含兼容固定版本 CLI 的版本,并遵循其准备说明;切勿在托管启动器上运行
<cli> update
。未经授权,不得安装或升级。权限错误和网络错误应如实报告;这些错误并不能证明需要升级。 每次升级后,都要重新执行可信可执行文件发现与验证,然后重新检查版本和命令支持情况。不要复用旧的规范路径,因为升级可能会替换带版本号的安装目录或托管启动器。

Validate only

仅验证

Run
<cli> config validate --agent
for the repository configuration, or
<cli> config validate <file> --agent
for the user's explicitly selected YAML file. Require exit zero and
ok: true
; report the CLI's validation diagnostics otherwise. Do not generate or apply changes for a validation-only request.
运行
<cli> config validate --agent
以验证仓库配置,或运行
<cli> config validate <file> --agent
以验证用户明确选择的 YAML 文件。要求退出码为零且
ok: true
;否则报告 CLI 的验证诊断信息。对于仅验证的请求,不要生成或应用更改。

Create or change review style

创建或修改审查风格

  1. Run
    <cli> config --agent
    . Require exit zero,
    ok: true
    ,
    protocolVersion: 2
    ,
    operation: inspect
    , and
    writable: true
    . Preserve the returned repository root, target, and
    baseHash
    (
    none
    for a new file). Respect authority warnings, including TypeScript, remote configuration, symlinks, and multiple YAML files; do not delete or bypass them.
  2. Run
    <cli> config --agent --generate
    . For a requested style, add
    --profile chill
    (Balanced),
    --profile quiet
    (Focused),
    --profile assertive
    (Thorough), or
    --profile default
    (remove the local style override). Without a profile, the CLI generates its baseline for a new file and preserves an existing file. Do not infer a style change from a general request to check configuration.
  3. Require a successful protocol-v2
    operation: generate
    response with the inspected target and base hash. Copy its exact
    after
    string into a temporary proposal file outside the repository; do not rewrite or extend that YAML.
  4. Preview with
    <cli> config apply <proposal> --agent --dry-run --base <baseHash>
    . Require exit zero and a successful protocol-v2
    operation: apply
    result. If unchanged, re-inspect the same base hash and report that no save is needed. Otherwise show the returned before/after diff and obtain approval for it.
  5. Save the same proposal with
    <cli> config apply <proposal> --agent --yes --base <baseHash>
    . Require a successful protocol-v2 result with
    applied: true
    . Re-inspect and verify the target and saved hash against the approved
    proposedHash
    , then report the local change. Remove your temporary proposal; preserve any CLI-reported recovery file.
On changed input, inspect and preview again instead of bypassing the base hash. On schema, validation, permission, or network errors, report the diagnostic and stop without an alternate writer. An interrupted save has an unknown outcome: inspect the file before retrying or reporting success.
  1. 运行
    <cli> config --agent
    。要求退出码为零,且返回
    ok: true
    、
    protocolVersion: 2
    、
    operation: inspect
    和
    writable: true
    。保留返回的仓库根目录、目标和
    baseHash
    (新文件为
    none
    )。遵循所有权威性警告,包括 TypeScript、远程配置、符号链接和多个 YAML 文件相关警告;不要删除或绕过这些警告。
  2. 运行
    <cli> config --agent --generate
    。对于指定的审查风格,添加
    --profile chill
    (平衡)、
    --profile quiet
    (专注)、
    --profile assertive
    (全面),或
    --profile default
    (移除本地风格覆盖)。未指定 profile 时,CLI 会为新文件生成基线配置,并保留现有文件。不要根据常规配置检查请求推断需要更改审查风格。
  3. 要求成功返回协议 v2 的
    operation: generate
    响应,其中包含检查过的目标和基础哈希。将返回的
    after
    字符串原样复制到仓库外的临时提案文件中;不要重写或扩展该 YAML。
  4. 使用
    <cli> config apply <proposal> --agent --dry-run --base <baseHash>
    进行预览。要求退出码为零,并成功返回协议 v2 的
    operation: apply
    结果。如果内容未发生变化,应基于同一基础哈希重新检查,并报告无需保存。否则,展示返回的修改前后差异,并获得用户批准。
  5. 使用
    <cli> config apply <proposal> --agent --yes --base <baseHash>
    保存同一提案。要求成功返回协议 v2 的结果,且
    applied: true
    。重新检查配置,将目标和保存后的哈希与已批准的
    proposedHash
    进行核对,然后报告本地更改。删除临时提案文件,但保留 CLI 报告的任何恢复文件。
如果输入发生变化,应重新检查并再次预览,而不是绕过基础哈希。遇到 schema、校验、权限或网络错误时,报告相应的诊断信息并停止操作,不要改用其他写入方式。保存被中断时,结果处于未知状态:先检查文件,再决定是否重试或报告成功。

Guided path settings

引导式路径设置

For path-guidance requests, run
<cli> config --detailed
in an interactive terminal to enter the manual review-style and path-guidance flow directly. For general interactive setup, use
<cli> config
or
<cli> config --generate
. Relay the CLI's actual prompts and preview, using settled user preferences and asking for missing choices. Confirm the displayed changes only after approval. If the host cannot interact with a terminal, give the user the exact command to run in the selected repository and resume after they finish. Do not simulate the wizard with piped answers. For settings the installed CLI cannot edit, explain the capability gap instead of inventing flags or editing YAML yourself.
After a successful save, validate and inspect the resulting configuration. Saving locally does not activate settings on hosted PR reviews. Commit, push, dashboard changes, and running a review require their own user-requested scope.
对于路径指引请求,在交互式终端中运行
<cli> config --detailed
,直接进入手动审查风格和路径指引流程。 对于常规交互式设置,使用
<cli> config
或
<cli> config --generate
。 转述 CLI 的实际提示和预览,依据已明确的用户偏好,并询问缺失的选项。只有在获得批准后,才能确认所显示的更改。 如果宿主无法与终端交互,请向用户提供应在所选仓库中运行的准确命令,并在用户完成后继续操作。不要通过管道传入回答来模拟向导。 如果已安装的 CLI 无法编辑某些设置,请说明功能能力缺口,不要虚构参数或自行编辑 YAML。
成功保存后,验证并检查生成的配置。本地保存不会在托管的 PR 审查中启用这些设置。提交、推送、dashboard 更改和运行审查均需要用户明确提出相应的操作范围。