← 返回日报
🌐 机器翻译 · 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。

在以下情况下使用它,让 Codex:

它支持 --background--wait--resume--fresh。如果省略 --resume--fresh,插件可以提供继续该仓库最新救援线程的选项。

示例:

/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:

Ask Codex to redesign the database connection to be more resilient.

注意事项:

从当前的 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:cancel
/codex:cancel task-abc123
📖 阅读原文 →