An Agent Client Protocol (ACP) bridge that integrates Aider into editors like Zed. This project allows you to use Aider as an AI coding assistant inside Zed, review diffs, and apply changes seamlessly.
- Runs as a standalone ACP agent: Zed spawns this project as an external process.
- Communicates with Zed via ACP (JSON-RPC over stdio).
- Communicates with Aider via subprocess: calls the
aider
CLI binary under the hood. - Diff workflow:
- Zed sends a prompt via ACP.
- This bridge launches Aider with the request.
- Aider applies edits directly to disk.
- Changes are returned in SEARCH/REPLACE code block.
- Zed shows the changes (unformatted!!)
aider-acp/
├── src/
│ ├── index.ts # ACP entrypoint (JSON-RPC loop)
│ ├── acp-agent.ts # Main ACP protocol implementation
│ ├── aider-output-parser.ts # Parses Aider output to extract changes and format it for ACP.
│ ├── aider-runner.ts # Helper to run aider subprocess
│ ├── utils.ts # Utility functions
│ └── types.ts # Shared TypeScript types
├── package.json
├── tsconfig.json
└── README.md
-
Node.js 20+
-
TypeScript (installed as dev dependency)
-
Aider (Python package) installed globally or in your environment:
pip install aider-chat
-
Git (Aider expects a git repo to track changes)
-
Zed Editor or other editor with ACP support (v0.201.5+)
git clone <your-repo-url>
cd aider-acp
pnpm install # or npm install
pnpm run build
# Test the ACP agent directly
node test-acp.js
Add this configuration to your Zed settings (cmd/ctrl + ,
→ Open settings.json
):
{
"agent_servers": {
"Aider": {
"command": "node",
"args": ["/absolute/path/to/your/aider-acp/dist/index.js"]
}
}
}
Important: Replace
/absolute/path/to/your/aider-acp/
with the actual absolute path to your cloned project.
- Open the Agent Panel:
cmd/ctrl + ?
- Click the
+
button in the top right - Select "Aider" from the dropdown
- Start chatting with Aider directly in Zed!
You: "Add error handling to the main function in src/index.ts"
Aider: *analyzes code and applies changes*
Zed: *shows real-time diff updates*
You: "Refactor this function to use async/await"
*Select code in editor before sending*
Aider: *receives context and makes improvements*
- Initialization: Zed sends
initialize
→ Agent responds with capabilities - Session Creation: Zed sends
session/new
→ Agent creates session context - Prompt Processing: Zed sends
session/prompt
→ Agent processes with Aider - Real-time Updates: Agent sends
session/update
notifications during execution - Completion: Agent responds with
stopReason: "end_turn"
- JSON-RPC 2.0 communication over stdin/stdout
- Subprocess execution of Aider CLI with proper argument handling
- Git diff parsing to capture and report changes
- Streaming updates for real-time progress feedback
- Error handling with proper ACP error codes
- Open Command Palette (
cmd/ctrl + shift + p
) - Run
dev: open acp logs
- This opens a dedicated panel showing all JSON-RPC messages between Zed and the agent in real-time
- You'll see the complete protocol flow: initialize, session/new, session/prompt, session/update, etc.
- ✅ Basic ACP loop (initialize + session management + prompt and response)
- ✅ Aider subprocess integration with proper argument handling and file editing.
- ✅ Real-time streaming updates via session/update notifications
- Diff parsing to ACP edits: Convert SEARCH/REPLACE blocks to structured file_edit blocks
- Model selection: UI for choosing Aider's LLM models
- File context: Better integration with Zed's file selection
- Slash commands: Implement aider slash commands for quick actions
- Format Output: Correctly format all aider mensajes (ask for user input, error mensages, additional info, etc)
This project follows the Agent Client Protocol specification. Contributions are welcome!
- Fork the repository
- Create a feature branch
- Make your changes
- Test with both standalone and Zed integration
- Submit a pull request
Apache License, Version 2.0