{"id":34117337,"url":"https://github.com/coder/acp-go-sdk","last_synced_at":"2026-03-12T06:02:03.849Z","repository":{"id":316792459,"uuid":"1064706333","full_name":"coder/acp-go-sdk","owner":"coder","description":"Go SDK for the Agent Client Protocol (ACP), offering typed requests, responses, and helpers so Go applications can build ACP-compliant agents, clients, and integrations","archived":false,"fork":false,"pushed_at":"2026-02-19T16:07:16.000Z","size":214,"stargazers_count":78,"open_issues_count":7,"forks_count":16,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-19T16:36:33.674Z","etag":null,"topics":["acp","agent-client-protocol"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-09-26T12:37:32.000Z","updated_at":"2026-02-19T11:19:38.000Z","dependencies_parsed_at":"2025-09-27T07:32:44.672Z","dependency_job_id":null,"html_url":"https://github.com/coder/acp-go-sdk","commit_stats":null,"previous_names":["coder/acp-go-sdk"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/coder/acp-go-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder%2Facp-go-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder%2Facp-go-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder%2Facp-go-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder%2Facp-go-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coder","download_url":"https://codeload.github.com/coder/acp-go-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder%2Facp-go-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30416736,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T04:41:02.746Z","status":"ssl_error","status_checked_at":"2026-03-12T04:40:12.571Z","response_time":114,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acp","agent-client-protocol"],"created_at":"2025-12-14T20:30:30.454Z","updated_at":"2026-03-12T06:02:03.844Z","avatar_url":"https://github.com/coder.png","language":"Go","readme":"\u003ca href=\"https://agentclientprotocol.com/\" \u003e\n  \u003cimg alt=\"Agent Client Protocol\" src=\"https://zed.dev/img/acp/banner-dark.webp\"\u003e\n\u003c/a\u003e\n\n# ACP Go SDK\n\nGo library for the Agent Client Protocol (ACP) - a standardized communication protocol\nbetween code editors and AI‑powered coding agents.\n\nLearn more about the protocol itself at \u003chttps://agentclientprotocol.com\u003e.\n\n## Installation\n\n\u003c!-- `$ printf 'go get github.com/coder/acp-go-sdk@v%s\\n' \"$(cat schema/version)\"` as bash --\u003e\n\n```bash\ngo get github.com/coder/acp-go-sdk@v0.10.8\n```\n\n## Get Started\n\n### Understand the Protocol\n\nStart by reading the [official ACP documentation](https://agentclientprotocol.com)\nto understand the core concepts and protocol specification.\n\n### Try the Examples\n\nThe [examples directory](https://github.com/coder/acp-go-sdk/tree/main/example)\ncontains simple implementations of both Agents and Clients in Go.\nYou can run them from your terminal or connect to external ACP agents.\n\n- `go run ./example/agent` starts a minimal ACP agent over stdio.\n- `go run ./example/claude-code` demonstrates bridging to Claude Code.\n- `go run ./example/client` connects to a running agent and streams a sample turn.\n- `go run ./example/gemini` bridges to the Gemini CLI in ACP mode (flags: -model, -sandbox, -debug, -gemini /path/to/gemini).\n\nYou can watch the interaction by running `go run ./example/client` locally.\n\n### Explore the API\n\nBrowse the Go package docs on pkg.go.dev for detailed API documentation:\n\n- \u003chttps://pkg.go.dev/github.com/coder/acp-go-sdk\u003e\n\nIf you're building an [Agent](https://agentclientprotocol.com/protocol/overview#agent):\n\n- Implement the `acp.Agent` interface (and optionally `acp.AgentLoader` for `session/load`).\n- Create a connection with `acp.NewAgentSideConnection(agent, os.Stdout, os.Stdin)`.\n- Send updates and make client requests using the returned connection.\n\nIf you're building a [Client](https://agentclientprotocol.com/protocol/overview#client):\n\n- Implement the `acp.Client` interface (and optionally `acp.ClientTerminal` for\n  terminal features).\n- Launch or connect to your Agent process (stdio), then create a connection with\n  `acp.NewClientSideConnection(client, stdin, stdout)`.\n- Call `Initialize`, `NewSession`, and `Prompt` to run a turn and stream updates.\n\nHelper constructors are provided to reduce boilerplate when working with union types:\n\n- Content blocks: `acp.TextBlock`, `acp.ImageBlock`, `acp.AudioBlock`,\n  `acp.ResourceLinkBlock`, `acp.ResourceBlock`.\n- Tool content: `acp.ToolContent`, `acp.ToolDiffContent`, `acp.ToolTerminalRef`.\n- Utility: `acp.Ptr[T]` for pointer fields in request/update structs.\n\n### Extension methods\n\nACP supports **extension methods** for custom JSON-RPC methods whose names start with `_`.\nUse them to add functionality without conflicting with future ACP versions.\n\n#### Handling inbound extension methods\n\nImplement `acp.ExtensionMethodHandler` on your Agent or Client. Your handler will be\ninvoked for any incoming method starting with `_`.\n\n```go\n// HandleExtensionMethod handles ACP extension methods (names starting with \"_\").\nfunc (a MyAgent) HandleExtensionMethod(ctx context.Context, method string, params json.RawMessage) (any, error) {\n\tswitch method {\n\tcase \"_example.com/hello\":\n\t\tvar p struct {\n\t\t\tName string `json:\"name\"`\n\t\t}\n\t\tif err := json.Unmarshal(params, \u0026p); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn map[string]any{\"greeting\": \"hello \" + p.Name}, nil\n\tdefault:\n\t\treturn nil, acp.NewMethodNotFound(method)\n\t}\n}\n```\n\n\u003e Note: Per the ACP spec, unknown extension notifications should be ignored.\n\u003e This SDK suppresses noisy logs for unhandled extension notifications that return\n\u003e “Method not found”.\n\n#### Calling extension methods\n\nFrom either side, use `CallExtension` / `NotifyExtension` on the connection.\n\n```go\nraw, err := conn.CallExtension(ctx, \"_example.com/hello\", map[string]any{\"name\": \"world\"})\nif err != nil {\n\treturn err\n}\n\nvar resp struct {\n\tGreeting string `json:\"greeting\"`\n}\nif err := json.Unmarshal(raw, \u0026resp); err != nil {\n\treturn err\n}\n\nif err := conn.NotifyExtension(ctx, \"_example.com/progress\", map[string]any{\"pct\": 50}); err != nil {\n\treturn err\n}\n```\n\n#### Advertising extension support via `_meta`\n\nACP uses the `_meta` field inside capability objects as the negotiation/advertising\nsurface for extensions.\n\n- Client -\u003e Agent: `InitializeRequest.ClientCapabilities.Meta`\n- Agent -\u003e Client: `InitializeResponse.AgentCapabilities.Meta`\n\nKeys `traceparent`, `tracestate`, and `baggage` are reserved in `_meta` for W3C trace\ncontext/OpenTelemetry compatibility.\n\n### Study a Production Implementation\n\nFor a complete, production‑ready integration, see the\n[Gemini CLI Agent](https://github.com/google-gemini/gemini-cli) which exposes an\nACP interface. The Go example client `example/gemini` demonstrates connecting\nto it via stdio.\n\n## Resources\n\n- [Go package docs](https://pkg.go.dev/github.com/coder/acp-go-sdk)\n- [Examples (Go)](https://github.com/coder/acp-go-sdk/tree/main/example)\n- [Protocol Documentation](https://agentclientprotocol.com)\n- [Agent Client Protocol GitHub Repository](https://github.com/agentclientprotocol/agent-client-protocol)\n\n## License\n\nApache 2.0. See [LICENSE](./LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoder%2Facp-go-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoder%2Facp-go-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoder%2Facp-go-sdk/lists"}