Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Codex plugin for Claude Code

This repository can also be installed as a Gemini CLI extension so Gemini users can trigger the same local Codex review flows from inside Gemini.

Use Codex from inside Claude Code for code reviews or to delegate tasks to Codex.

This plugin is for Claude Code users who want an easy way to start using Codex from the workflow
Expand Down Expand Up @@ -66,6 +68,26 @@ One simple first run is:
/codex:result
```

## Gemini CLI Extension

If you use Gemini CLI, you can install this repository as a Gemini extension and run the local Codex review helpers from inside Gemini:

```bash
gemini extensions link /path/to/codex-plugin-cc
```

Then restart Gemini and use:

```text
/codex:setup
/codex:review
/codex:adversarial-review focus on rollback and failure handling
/codex:status
/codex:result
```

These Gemini commands are intercepted by an extension `BeforeModel` hook before Gemini starts its own workflow. The hook dispatches to the same local `plugins/codex/scripts/codex-companion.mjs` runtime used by the Claude Code plugin and injects Codex's stdout back into the chat, so they still require a working local Codex CLI login.

## Usage

### `/codex:review`
Expand Down
12 changes: 12 additions & 0 deletions commands/codex/adversarial-review.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description = "Run a local adversarial Codex review against the current workspace."
prompt = """
Use the MCP tool `codex_adversarial_review` exactly once.
Pass `raw_args` as the exact argument text from this slash command: `{{args}}`.
After the tool returns successfully, do not repeat or summarize the tool output.
Reply with exactly: `Codex adversarial review complete. See the MCP tool output above.`
If the tool fails, reply with exactly: `Codex adversarial review failed. See the MCP tool output above.`
Do not use `run_shell_command`.
Do not perform your own review.
"""
11 changes: 11 additions & 0 deletions commands/codex/cancel.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description = "Cancel a local Codex background run for the current workspace."
prompt = """
Use the MCP tool `codex_cancel` exactly once.
Pass `raw_args` as the exact argument text from this slash command: `{{args}}`.
After the tool returns successfully, do not repeat or summarize the tool output.
Reply with exactly: `Codex cancel complete. See the MCP tool output above.`
If the tool fails, reply with exactly: `Codex cancel failed. See the MCP tool output above.`
Do not use `run_shell_command`.
"""
11 changes: 11 additions & 0 deletions commands/codex/result.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description = "Show the stored local Codex result for the current workspace."
prompt = """
Use the MCP tool `codex_result` exactly once.
Pass `raw_args` as the exact argument text from this slash command: `{{args}}`.
After the tool returns successfully, do not repeat or summarize the tool output.
Reply with exactly: `Codex result complete. See the MCP tool output above.`
If the tool fails, reply with exactly: `Codex result failed. See the MCP tool output above.`
Do not use `run_shell_command`.
"""
12 changes: 12 additions & 0 deletions commands/codex/review.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description = "Run a local Codex review against the current workspace."
prompt = """
Use the MCP tool `codex_review` exactly once.

Pass `raw_args` as the exact argument text from this slash command: `{{args}}`.

After the tool returns successfully, do not repeat or summarize the tool output.
Reply with exactly: `Codex review complete. See the MCP tool output above.`
If the tool fails, reply with exactly: `Codex review failed. See the MCP tool output above.`
Do not use `run_shell_command`.
Do not perform your own review.
"""
11 changes: 11 additions & 0 deletions commands/codex/setup.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description = "Check whether the local Codex CLI is ready for review commands."
prompt = """
Use the MCP tool `codex_setup` exactly once.
Pass `raw_args` as the exact argument text from this slash command: `{{args}}`.
After the tool returns successfully, do not repeat or summarize the tool output.
Reply with exactly: `Codex setup complete. See the MCP tool output above.`
If the tool fails, reply with exactly: `Codex setup failed. See the MCP tool output above.`
Do not use `run_shell_command`.
"""
11 changes: 11 additions & 0 deletions commands/codex/status.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description = "Show local Codex background review status for the current workspace."
prompt = """
Use the MCP tool `codex_status` exactly once.
Pass `raw_args` as the exact argument text from this slash command: `{{args}}`.
After the tool returns successfully, do not repeat or summarize the tool output.
Reply with exactly: `Codex status complete. See the MCP tool output above.`
If the tool fails, reply with exactly: `Codex status failed. See the MCP tool output above.`
Do not use `run_shell_command`.
"""
14 changes: 14 additions & 0 deletions gemini-extension.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "codex-companion",
"version": "1.0.0",
"description": "Run local Codex review commands from inside Gemini CLI.",
"mcpServers": {
"codex-companion": {
"command": "node",
"args": [
"${extensionPath}${/}plugins${/}codex${/}scripts${/}gemini-mcp-server.mjs"
],
"cwd": "${workspacePath}"
}
}
}
Loading