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

openai codex-plugin-cc


以下是根据您的要求翻译的中文版本,保留了原文结构、技术术语和代码块,并采用 Markdown 格式输出。


openai codex-plugin-cc

Codex 插件 for Claude Code

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

功能概览

  1. 在 Claude Code 中添加市场插件:
  2.    /plugin marketplace add openai/codex-plugin-cc
  3. 安装插件:
  4.    /plugin install codex@openai-codex
  5. 重新加载插件:
  6.    /reload-plugins
  7. 然后运行:
  8.    /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:

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
📖 阅读原文 →