πΊπΈ English | π°π· νκ΅μ΄
A Go implementation of the Agent Client Protocol (ACP), which standardizes communication between code editors (interactive programs for viewing and editing source code) and coding agents (programs that use generative AI to autonomously modify code).
This is an unofficial implementation of the ACP specification in Go. The official protocol specification and reference implementations can be found at the official repository.
Note
The Agent Client Protocol is under active development. This implementation may lag behind the latest specification changes. Please refer to the official repository for the most up-to-date protocol specification.
Learn more about the protocol at agentclientprotocol.com.
go get github.com/ironpark/go-acpSee the docs/example directory for complete working examples:
- Agent Example - Comprehensive agent implementation demonstrating session management, tool calls, and permission requests
- Client Example - Client implementation that spawns the agent and communicates with it
This implementation provides a clean, modern architecture with bidirectional JSON-RPC 2.0 communication:
Connection: Unified bidirectional transport layer handling stdin/stdout communication with concurrent request/response correlationAgentSideConnection: High-level ACP interface for implementing agents, wraps Connection for agent-specific operationsClientSideConnection: High-level ACP interface for implementing clients, wraps Connection for client-specific operationsTerminalHandle: Resource management wrapper for terminal sessions with automatic cleanup patterns- Generated Types: Complete type-safe Go structs generated from the official ACP JSON schema
This implementation supports ACP Protocol Version 1 with the following features:
initialize- Initialize the agent and negotiate capabilitiesauthenticate- Authenticate with the agent (optional)session/new- Create a new conversation sessionsession/load- Load an existing session (if supported)session/set_mode- Change session mode (unstable)session/prompt- Send user prompt to agentsession/cancel- Cancel ongoing operations
session/update- Send session updates (notifications)session/request_permission- Request user permission for operationsfs/read_text_file- Read text file from client filesystemfs/write_text_file- Write text file to client filesystem- Terminal Support (unstable):
terminal/create- Create terminal sessionterminal/output- Get terminal outputterminal/wait_for_exit- Wait for terminal exitterminal/kill- Kill terminal processterminal/release- Release terminal handle
This is an unofficial implementation. For protocol specification changes, please contribute to the official repository.
For Go implementation issues and improvements, please open an issue or pull request.
- Official ACP Repository: zed-industries/agent-client-protocol
- Rust Implementation: Part of the official repository
- Protocol Documentation: agentclientprotocol.com
- Zed
- neovim through the CodeCompanion plugin
- yetone/avante.nvim: A Neovim plugin designed to emulate the behaviour of the Cursor AI IDE
