feat(claude): add idempotent installer for openai/codex-plugin-cc
One-liner script that: - Verifies/installs Node.js >= 18, git, codex CLI - Adds 'openai-codex' marketplace (github.com/openai/codex-plugin-cc) - Installs/updates 'codex@openai-codex' plugin - Verifies result via 'claude plugin list' Re-runs are safe — auto-detects what is already installed and only fills gaps or pulls newer plugin versions. Three platforms covered: Linux (apt/dnf/yum), macOS (brew), Windows (winget) via .sh and .ps1 wrappers + CMD entry-point. Plugin commands inside Claude Code: /codex:review, /codex:adversarial-review, /codex:rescue, /codex:status, /codex:result, /codex:cancel Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
105
claude/CODEX_PLUGIN.md
Normal file
105
claude/CODEX_PLUGIN.md
Normal file
@@ -0,0 +1,105 @@
|
||||
# OpenAI Codex Plugin for Claude Code
|
||||
|
||||
Официальный plugin от OpenAI ([github.com/openai/codex-plugin-cc](https://github.com/openai/codex-plugin-cc)),
|
||||
который добавляет в Claude Code команды `/codex:review`, `/codex:rescue` и т.д. для делегирования
|
||||
задач OpenAI Codex прямо изнутри Claude Code.
|
||||
|
||||
## Установка одной командой
|
||||
|
||||
> Установщик идемпотентен — при повторном запуске обновит plugin до последней версии,
|
||||
> компоненты которые уже стоят (Node.js, git, codex CLI) пропустит.
|
||||
|
||||
**Linux (Debian/Ubuntu/RHEL/Fedora):**
|
||||
```bash
|
||||
curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \
|
||||
https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/claude/install_codex_plugin.sh \
|
||||
-o /tmp/install_codex_plugin.sh && sudo bash /tmp/install_codex_plugin.sh
|
||||
```
|
||||
|
||||
**macOS:**
|
||||
```bash
|
||||
curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \
|
||||
https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/claude/install_codex_plugin.sh \
|
||||
-o /tmp/install_codex_plugin.sh && bash /tmp/install_codex_plugin.sh
|
||||
```
|
||||
|
||||
**Windows (PowerShell as Administrator):**
|
||||
```powershell
|
||||
$h=@{Authorization="token cadffcb0a6a3be728ac1ff619bb40c86588f6837"}
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||
iwr "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/claude/install_codex_plugin.ps1" -OutFile "$env:TEMP\install_codex_plugin.ps1" -Headers $h
|
||||
. "$env:TEMP\install_codex_plugin.ps1"
|
||||
```
|
||||
|
||||
**Windows (CMD as Administrator):**
|
||||
```cmd
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -Command "$h=@{Authorization='token cadffcb0a6a3be728ac1ff619bb40c86588f6837'}; iwr 'https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/claude/install_codex_plugin.ps1' -OutFile \"$env:TEMP\install_codex_plugin.ps1\" -Headers $h; & \"$env:TEMP\install_codex_plugin.ps1\""
|
||||
```
|
||||
|
||||
## Алгоритм установки (что делает скрипт)
|
||||
|
||||
| # | Шаг | Что проверяет / устанавливает |
|
||||
|---|-----|------------------------------|
|
||||
| 1 | **Node.js >= 18** | `node -v`. Если нет — apt/dnf/brew/winget. Если версия < 18 — exit 1. |
|
||||
| 2 | **Claude Code CLI** | `claude --version`. Если нет — exit с инструкцией поставить. |
|
||||
| 3 | **git** | `git --version`. Если нет — apt/dnf/brew/winget. |
|
||||
| 4 | **Codex CLI** (`@openai/codex`) | `codex --version`. Если нет — `npm install -g @openai/codex`. |
|
||||
| 5 | **Marketplace `openai-codex`** | `claude plugin marketplace list`. Если нет — `claude plugin marketplace add https://github.com/openai/codex-plugin-cc`. |
|
||||
| 6 | **Plugin `codex@openai-codex`** | `claude plugin list`. Если нет — `claude plugin install codex@openai-codex`. Если есть — `claude plugin update`. |
|
||||
| 7 | **Verify** | повторный `claude plugin list` + grep на `codex@openai-codex`. |
|
||||
|
||||
### Где что лежит после установки
|
||||
|
||||
| Компонент | Путь |
|
||||
|-----------|------|
|
||||
| Plugin manifest | `~/.claude/plugins/cache/openai-codex/codex/<VERSION>/.claude-plugin/plugin.json` |
|
||||
| Installed registry | `~/.claude/plugins/installed_plugins.json` |
|
||||
| Marketplace registry | `~/.claude/plugins/known_marketplaces.json` |
|
||||
| Codex CLI | `$(npm root -g)/@openai/codex/` + бинарь в PATH |
|
||||
|
||||
### Идемпотентность
|
||||
|
||||
Скрипт безопасно перезапускается:
|
||||
- если Node.js / git уже стоят — шаги 1, 3 пропускаются
|
||||
- если Codex CLI стоит — `npm install -g` не запускается
|
||||
- если marketplace добавлен — `marketplace add` пропускается
|
||||
- если plugin установлен — выполняется `plugin update` (подтянет более свежую версию из репо)
|
||||
|
||||
Версия плагина определяется upstream'ом (`openai/codex-plugin-cc` на GitHub). На момент написания
|
||||
последняя — 1.0.4 (commit `807e03a`). При выходе 1.0.5+ повторный запуск установщика обновит.
|
||||
|
||||
## Команды плагина внутри Claude Code
|
||||
|
||||
После установки и перезапуска `claude` доступны slash-команды:
|
||||
|
||||
| Команда | Действие |
|
||||
|---------|----------|
|
||||
| `/codex:review` | стандартное code review текущего diff |
|
||||
| `/codex:adversarial-review` | проверка дизайна и неявных предположений |
|
||||
| `/codex:rescue` | делегирование задачи в Codex (фикс / большой рефакторинг) |
|
||||
| `/codex:status` | статус background-jobs |
|
||||
| `/codex:result` | получение результата завершённого job |
|
||||
| `/codex:cancel` | отмена running job |
|
||||
|
||||
## Аутентификация
|
||||
|
||||
Plugin использует **существующую auth Codex CLI** — отдельной auth не нужно.
|
||||
- Если уже выполнен `codex login` — plugin работает
|
||||
- Либо установлен `OPENAI_API_KEY` env var
|
||||
|
||||
На пропатченной нашей сборке Codex (через `ucodex_install.sh/.ps1`) уже настроен `OPENAI_BASE_URL`
|
||||
на наш AI proxy — plugin будет ходить туда же, без прямого обращения к OpenAI.
|
||||
|
||||
## Удаление
|
||||
|
||||
```bash
|
||||
claude plugin uninstall codex@openai-codex
|
||||
claude plugin marketplace remove openai-codex
|
||||
npm uninstall -g @openai/codex
|
||||
```
|
||||
|
||||
## Источники
|
||||
|
||||
- Репозиторий plugin: https://github.com/openai/codex-plugin-cc
|
||||
- Anthropic plugins docs: https://docs.claude.com/en/docs/claude-code/plugins
|
||||
- Community announcement: https://community.openai.com/t/introducing-codex-plugin-for-claude-code/1378186
|
||||
Reference in New Issue
Block a user