This repository packages the Codex ↔ Agent Client Protocol adapter for Zed as a standalone Node.js project. It is the not official Codex adapter and is not affiliated with, endorsed by, or sponsored by OpenAI or Zed Industries. The package wraps the Codex SDK with the ACP transport so Zed can talk to Codex over stdio.
- Node.js 18 or later
- A Codex account authenticated either by running
codex loginor exportingCODEX_API_KEY - Zed 0.153.0 or later (any build that supports external ACP agents)
-
Install dependencies:
npm install
This recreates the
node_modules/directory that is intentionally not checked in. -
Build the TypeScript sources (generates
dist/):npm run build
Every install or publish will also run this automatically via the
preparescript. -
Choose your Codex authentication path:
# Interactive device-login flow npx codex login # —or— provide an API key explicitly export CODEX_API_KEY=<your token>
The adapter works with either method—pick whichever fits your environment.
Add an entry to ~/.config/zed/settings.json under "agent_servers":
{
"agent_servers": {
"codex": {
"command": ["node", "/path/to/codex-acp-agent/dist/bin.js"],
"env": {
"CODEX_API_KEY": "<optional if using codex login>",
"CODEX_SKIP_GIT_CHECK": "true"
}
}
}
}Restart Zed and pick the Codex agent from the AI panel.
- Built-in slash commands include
/plan,/test, and/web. - Drop additional prompt files (Markdown,
.prompt, or plain text) into~/.codex/promptsto create your own commands. - Each file becomes a slash command named after the first
#/command-nameheading (or the filename if no heading exists). Arguments like$1or$ARGUMENTSare expanded automatically. - Point the agent at alternate prompt folders with
CODEX_PROMPTS_DIR,--prompts-dir, or the Zedenvblock.
You can also run the adapter directly for testing:
node dist/bin.js --log-level debugIt reads ACP JSON over stdin/stdout, so you can pair it with the TypeScript example client from the main ACP repository or your own tooling.
npm run prepare(triggered automatically) builds the project beforenpm publishor when the package is installed from git.- To ship a binary-like CLI, run
npm run buildand distribute the resultingdist/directory withpackage.json.
npm run build– compile TypeScript ➜dist/npm test– run Vitest suitenpm run dev– launch the agent in watch mode viatsxnpm run typecheck– stricttsc --noEmit
If you make local customizations (extra slash commands, logging tweaks, etc.), keep them under version control—only node_modules/ is intentionally ignored.