This package uses the bundled @openai/codex dependency by default.
Set CODEX_PATH to run a different Codex binary; versions other than the one specified in package.json may not be compatible.
CODEX_API_KEY- API key used when the API-key auth method is selected. Takes precedence overOPENAI_API_KEY.OPENAI_API_KEY- fallback API key used when the API-key auth method is selected.CODEX_PATH- run a specific Codex executable instead of the bundled package dependency.CODEX_CONFIG- JSON object merged into the Codex session config.MODEL_PROVIDER- model provider to pass to Codex for new sessions.DEFAULT_AUTH_REQUEST- ACP auth request JSON used when Codex requires authentication.INITIAL_AGENT_MODE- initial mode id:read-only,agent, oragent-full-access.NO_BROWSER- hide browser-based ChatGPT auth when set.APP_SERVER_LOGS- directory for adapter logs.
- Download and install C++ redistributable package
Run from sources
- Install dependencies
npm install - Adjust ACP client config
{
"agent_servers": {
"Codex (app-server)": {
"command": "npm",
"args": ["run", "start", "--prefix", "/path/to/project/"],
"env": {
"CODEX_PATH": "node_modules/.bin/codex",
"APP_SERVER_LOGS": "optional/path/to/existing/log/directory"
}
}
}
}Run from binaries
- Download a
codex-acp-<platform>.ziparchive from https://github.com/agentclientprotocol/codex-acp/releases (<platform>is one of:linux,darwin,win32) - Unzip the archive:
unzip codex-acp-<platform>.zip
- Adjust ACP client config
{
"agent_servers": {
"Codex (app-server)": {
"command": "/path/to/codex-acp",
"env": {
"CODEX_PATH": "/path/to/codex"
}
}
}
}Building standalone binaries requires bun.
Build single-file executables in dist/bin directory:
npm run bundle:allPackage binaries into zip archives:
npm run package:all- Update the
@openai/codexversion inpackage.json(underdependencies). - Regenerate Codex types in
src/app-server/:npm run generate-types - Ensure there are no type errors or failed tests:
npm run typecheckandnpm run test