codex-bridge
by Eureka-THU
README.md
# codex-bridge
An Antigravity plugin and MCP/CLI bridge that connects **Antigravity (Gemini)** to **OpenAI Codex / GPT** over [Agent Client Protocol (ACP)](https://agentclientprotocol.com/) via `@agentclientprotocol/codex-acp`.
[中文说明](README.zh-CN.md)
## Why `codex-bridge`?
- **Play to each model's strengths**: Keep Gemini for natural communication, brainstorming, copywriting, and UI/aesthetic design; delegate heavy implementation, debugging, refactoring, test loops, and Codex-managed repositories to Codex/GPT.
- **Zero migration of Codex assets**: `codex-acp` inherits your existing `~/.codex` authentication, skills, plugins, MCP servers, `AGENTS.md`, and memories.
- **Session continuity**: Search and resume existing Codex Desktop threads via `codex_sessions` + `codex_run(session_id)`.
- **Adaptive sync/async + context economy**: Short tasks return within `wait_seconds` (default 60s); longer runs seamlessly return a `job_id` controllable via `codex_wait`, `codex_status`, `codex_steer`, and `codex_cancel`. Full transcripts stay on disk (`log_path`) so coordinator context stays lean.
- **GPT extra capabilities & quota offload**: Built-in presets for `develop`, `debug`, `review`, `research` (web search), `image` (native image generation), `gif`, and `offload` (thin-coordinator mode when Gemini quota is tight).
## Architecture
```text
Antigravity (Gemini)
├── MCP stdio ──▶ dist/mcp-server.mjs ──┐
└── CLI / Swarm ─▶ dist/cli.mjs ──┼──▶ AcpClient (NDJSON stdio) ──▶ @agentclientprotocol/codex-acp
└── ~/.codex (auth, skills, plugins, MCP, sessions)
```
## Prerequisites
1. Node.js 20+
2. `@agentclientprotocol/codex-acp` installed globally (or `CODEX_ACP_PATH` set):
```bash
npm install -g @agentclientprotocol/codex-acp
```
3. Codex authenticated (e.g., via Codex Desktop / ChatGPT login in `~/.codex` or `CODEX_API_KEY` / `OPENAI_API_KEY`).
## Installation (Antigravity Plugin)
Clone this repository and deploy it into `~/.gemini/config/plugins/codex-bridge`:
**Windows (PowerShell):**
```powershell
.\scripts\install.ps1
```
**macOS / Linux:**
```bash
chmod +x scripts/install.sh
./scripts/install.sh
```
Antigravity automatically discovers `~/.gemini/config/plugins/codex-bridge`. Whenever you pull or edit source code in this repository, run `npm run deploy` to rebuild and sync the runtime plugin files cleanly.
## MCP Tools
| Tool | Description |
| :--- | :--- |
| `codex_run` | Run a task in a new or resumed Codex session (`prompt`, `cwd`, `session_id`, `preset`, `mode`, `model`, `wait_seconds`, `images`) |
| `codex_wait` | Wait for a background `running` job to finish or report progress |
| `codex_status` | Inspect a job's status or check global ACP health & available models |
| `codex_steer` | Send mid-flight steering or follow-up instructions to a job |
| `codex_cancel` | Cancel a running job via ACP `session/cancel` |
| `codex_sessions` | List/search existing Codex Desktop & ACP sessions |
## CLI Usage
```bash
node dist/cli.mjs health
node dist/cli.mjs sessions --query "my-project" --limit 10
node dist/cli.mjs run --cwd "/path/to/repo" --preset develop --prompt "Fix failing unit tests"
```
## Verification
```bash
npm run typecheck
npm run build
npm test
```
## License
MIT
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues