|
1 | 1 | # ACP adapter for Codex CLI |
| 2 | + |
2 | 3 | [](https://www.npmjs.com/package/@agentclientprotocol/codex-acp) |
3 | 4 |
|
| 5 | +Use [OpenAI Codex](https://github.com/openai/codex) from [Agent Client Protocol](https://agentclientprotocol.com/) clients. |
| 6 | + |
| 7 | +`codex-acp` is a stdio ACP agent server. It starts the Codex App Server, translates ACP requests into Codex operations, and maps Codex events back into the client. |
| 8 | + |
| 9 | +## Features |
| 10 | + |
| 11 | +- ChatGPT, API key, and client-provided custom gateway authentication. |
| 12 | +- Model, reasoning effort, fast mode, approval, and sandbox mode configuration. |
| 13 | +- Text prompts, embedded context, images, resource links, and additional workspace directories. |
| 14 | +- Shell command, file change, permission request, MCP tool call, terminal output, reasoning, plan, web search, image generation, image view, token usage, and review events. |
| 15 | +- Client-provided MCP servers over command-based stdio config and HTTP transport. |
| 16 | +- Slash commands: `/status`, `/mcp`, `/skills`, `/review`, `/review-branch`, `/review-commit`, `/compact`, and `/logout`, as well as configured skills. |
| 17 | + |
| 18 | +## Installation |
| 19 | + |
| 20 | +Run the published package directly: |
| 21 | + |
| 22 | +```bash |
| 23 | +npx -y @agentclientprotocol/codex-acp |
| 24 | +``` |
| 25 | + |
| 26 | +Or install it globally: |
| 27 | + |
| 28 | +```bash |
| 29 | +npm install -g @agentclientprotocol/codex-acp |
| 30 | +codex-acp --version |
| 31 | +``` |
| 32 | + |
| 33 | +The npm package includes a compatible `@openai/codex` dependency. Set `CODEX_PATH` only when you want the adapter to run a different Codex binary: |
| 34 | + |
| 35 | +```bash |
| 36 | +CODEX_PATH=/path/to/codex npx -y @agentclientprotocol/codex-acp |
| 37 | +``` |
| 38 | + |
| 39 | +## Authentication |
| 40 | + |
| 41 | +The adapter advertises ACP auth methods during initialization. Clients can authenticate with: |
| 42 | + |
| 43 | +- ChatGPT login. |
| 44 | +- OpenAI API key. |
| 45 | +- A custom OpenAI-compatible gateway, when the client opts in to the gateway auth capability. |
| 46 | + |
| 47 | +## Runtime options |
| 48 | + |
| 49 | +- `CODEX_PATH` - run a specific Codex executable instead of the bundled package dependency. |
| 50 | +- `CODEX_CONFIG` - JSON object merged into the Codex session config. |
| 51 | +- `MODEL_PROVIDER` - model provider to pass to Codex for new sessions. |
| 52 | +- `DEFAULT_AUTH_REQUEST` - ACP auth request JSON used when Codex requires authentication. |
| 53 | +- `INITIAL_AGENT_MODE` - initial mode id: `read-only`, `agent`, or `agent-full-access`. |
| 54 | +- `APP_SERVER_LOGS` - directory for adapter logs. |
| 55 | + |
| 56 | +## Development |
| 57 | + |
| 58 | +```bash |
| 59 | +npm install |
| 60 | +npm run start |
| 61 | +npm run typecheck |
| 62 | +npm test |
| 63 | +``` |
| 64 | + |
| 65 | +Build standalone binaries in `dist/bin` with: |
| 66 | + |
| 67 | +```bash |
| 68 | +npm run bundle:all |
| 69 | +``` |
| 70 | + |
| 71 | +See [readme-dev.md](readme-dev.md) for local client configuration, binary packaging, and Codex type regeneration. |
4 | 72 |
|
5 | | -## Documentation |
| 73 | +## License |
6 | 74 |
|
7 | | -- **[Development Guide](readme-dev.md)** - Setup, configuration, and building binaries |
| 75 | +By contributing, you agree that your contributions will be licensed under the Apache 2.0 License. |
0 commit comments