← 返回日报
🌐 机器翻译 · DeepSeek · GitHub

openai codex-plugin-cc


以下是您要求的英文文章翻译为流畅中文的结果,已按照 Markdown 格式输出,并保留了原文结构、技术术语和代码块。


openai codex-plugin-cc

Codex 插件 for Claude Code

在 Claude Code 内部使用 Codex 进行代码审查,或将任务委托给 Codex。 此插件适用于希望从现有工作流中轻松开始使用 Codex 的 Claude Code 用户。

你能获得什么

在 Claude Code 中添加市场:

/plugin marketplace add openai/codex-plugin-cc

安装插件:

/plugin install codex@openai-codex

重新加载插件:

/reload-plugins

然后运行:

/codex:setup

/codex:setup 会告诉你 Codex 是否已就绪。如果 Codex 缺失且 npm 可用,它会主动为你安装 Codex。如果你更愿意自行安装 Codex,请使用:

npm install -g @openai/codex

如果 Codex 已安装但尚未登录,请运行:

! codex login

安装完成后,你应该能看到:

一个简单的首次运行示例:

/codex:review --background
/codex:status
/codex:result

使用方法

/codex:review

对你当前的工作执行常规的 Codex 审查。它提供的代码审查质量与直接在 Codex 中运行 /review 相同。

注意:代码审查(尤其是多文件更改)可能需要一些时间。通常建议在后台运行。

在以下情况下使用:

使用 --base 进行分支审查。同时支持 --wait--background。 该命令不可引导,也不接受自定义焦点文本。当你希望挑战特定决策或风险领域时,请使用 /codex:adversarial-review

示例:

/codex:review
/codex:review --base main
/codex:review --background

此命令为只读,不会执行任何更改。在后台运行时,你可以使用 /codex:status 查看进度,使用 /codex:cancel 取消正在进行的任务。

/codex:adversarial-review

执行可引导的审查,质疑所选的实现和设计。可用于压力测试假设、权衡、故障模式,以及判断是否还有其他更安全或更简单的方案。

它使用与 /codex:review 相同的审查目标选择方式,包括使用 --base 进行分支审查。同时支持 --wait--background。 与 /codex:review 不同,它可以在标志之后接受额外的焦点文本。

在以下情况下使用:

示例:

/codex:adversarial-review
/codex:adversarial-review --base main challenge whether this was the right caching and retry design
/codex:adversarial-review --background look for race conditions and question the chosen approach

此命令为只读,不会修复代码。

/codex:rescue

通过 codex:codex-rescue 子代理将任务交给 Codex。

在以下情况下使用:

支持 --background--wait--resume--fresh。 如果省略 --resume--fresh,插件可以主动建议继续该仓库最新的 rescue 线程。

示例:

/codex:rescue investigate why the tests started failing
/codex:rescue fix the failing test with the smallest safe patch
/codex:rescue --resume apply the top fix from the last run
/codex:rescue --model gpt-5.4-mini --effort medium investigate the flaky integration test
/codex:rescue --model spark fix the issue quickly
/codex:rescue --background investigate the regression

你也可以直接要求将任务委托给 Codex:

让 Codex 重新设计数据库连接,使其更具弹性。

注意:

从当前的 Claude Code 会话创建一个持久的 Codex 线程,并打印一条 codex resume 命令。

在以下情况下使用:你在 Claude Code 中开始了调试或实现对话,并希望直接在 Codex 中继续相同的上下文。

示例:

/codex:transfer
/codex:transfer --source ~/.claude/projects/-Users-me-repo/.jsonl

插件的现有 SessionStart 钩子会自动提供当前转录路径;--source 可作为手动覆盖选项使用。 传输使用 Codex 的外部代理会话导入器,因此遵循与在 Codex App 中导入 Claude 历史相同的转换规则,并创建可在 App 或 TUI 中继续的可见轮次。 源文件必须位于 ~/.claude/projects 下,并且旧版未暴露会话导入功能的 Codex 必须升级后才能使用此命令。

/codex:status

显示当前仓库中正在运行和最近的 Codex 任务。

示例:

/codex:status
/codex:status task-abc123

用于:

显示已完成任务的最终存储的 Codex 输出。如果可用,还会包含 Codex 会话 ID,以便你可以使用 codex resume 直接在 Codex 中重新打开该运行。

示例:

/codex:result
/codex:result task-abc123

/codex:cancel

取消一个活跃的后台 Codex 任务。

示例:

/codex

如果您需要针对特定段落或术语的进一步调整,请随时告知。

📖 阅读原文 →