Skip to content

Acp Adapter

Bridging Codex , Claude Code and Pi to Agent Client Protocol (ACP) with Go.

Install

$git clone https://github.com/beyond5959/acp-adapter

Install command taken from the project's README or registry entry. Always review code before running it.

ACP adapter for Codex, Claude Code, and Pi

acp-adapter is a Go ACP (Agent Client Protocol) adapter that lets ACP clients drive multiple downstream agent backends over the ACP protocol:

Backend Downstream official channel Standalone flag Library package Notes
Codex codex app-server over stdio JSON-RPC --adapter codex pkg/codexacp Most complete backend, including MCP routing.
Claude Code claude -p ... --output-format stream-json --adapter claude pkg/claudeacp Machine-readable Claude CLI bridge.
Pi pi --mode rpc over official RPC JSON lines --adapter pi pkg/piacp Official Pi RPC bridge with session load/list and ACP permission gate.

Usage Modes

This component supports two integration models:

Mode Use Case Entry Point
Standalone (process) Configure a binary in Zed or other ACP clients cmd/acp
Library (embedded) Host ACP runtime inside your Go service pkg/codexacp, pkg/claudeacp, pkg/piacp

Standalone Usage

Installation

curl -sSL https://raw.githubusercontent.com/beyond5959/acp-adapter/master/install.sh | sh

Quick Start

# Codex backend (default)
acp-adapter --adapter codex

# Claude backend
acp-adapter --adapter claude

# Pi backend
acp-adapter --adapter pi --pi-provider openai-codex --pi-model gpt-5.4-mini

Pi mode expects a working pi CLI on PATH or --pi-bin. Useful Pi-specific flags:

  • --pi-provider / PI_PROVIDER
  • --pi-model / PI_MODEL
  • --pi-session-dir / PI_SESSION_DIR
  • --pi-disable-gate / PI_DISABLE_GATE

ACP Client Config

{
  "agent_servers": {
    "acp-adapter": {
      "command": "/usr/local/bin/acp-adapter",
      "args": ["--adapter", "pi", "--pi-provider", "openai-codex", "--pi-model", "gpt-5.4-mini"]
    }
  }
}

Swap pi for codex or claude if you want a different backend.

Library Usage

The three runtime packages expose aligned entry points: DefaultRuntimeConfig, RunStdio, and NewEmbeddedRuntime.

import "github.com/beyond5959/acp-adapter/pkg/piacp"

// Stdio mode
cfg := piacp.DefaultRuntimeConfig()
cfg.DefaultProvider = "openai-codex"
cfg.DefaultModel = "gpt-5.4-mini"
err := piacp.RunStdio(ctx, cfg, os.Stdin, os.Stdout, os.Stderr)

// Embedded mode
rt := piacp.NewEmbeddedRuntime(cfg)
rt.Start(ctx)
defer rt.Close()
resp, err := rt.ClientRequest(ctx, msg)

Use pkg/codexacp for Codex and pkg/claudeacp for Claude; the runtime shape is the same, while config fields stay backend-specific.

Codex ACP Support

This section is intentionally based on the current code in internal/acp/server.go and internal/acp/types.go.

Similar plugs

Orca is the ADE for working with a fleet of parallel agents. Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies

Documented system prompts from Anthropic - Claude Fable 5.1, Opus 5.5, Claude Design, Claude Code. OpenAI - ChatGPT GPT-6-Astra, Codex. Google - Gemini 3.8 Flash, 3.1 Pro,…

Wrap Antigravity, ChatGPT Codex, Claude Code, Grok Build, Muse Code, Devin as an OpenAI/Gemini/Claude/Codex compatible API service, allowing you to enjoy the free Gemini…

Explore related