ACP (Agent Client Protocol) adapter for pi coding agent (fka shitty coding agent).
pi-acp communicates ACP JSON-RPC 2.0 over stdio to an ACP client (e.g. Zed editor) and spawns pi --mode rpc, bridging requests/events between the two.
This is an MVP-style adapter intended to be useful today and easy to iterate on. Some ACP features may be not implemented or are not supported (see Limitations). Development is centered around Zed editor support, other clients may have varying levels of compatibility.
Expect some minor breaking changes.
agent_message_chunktool_call / tool_call_update
edit, pi-acp attempts to infer a 1-based line number from a unique oldText match in the pre-edit file snapshot and includes it in the emitted tool location when possibleedit, pi-acp snapshots the file before the tool runs and emits an ACP structured diff (oldText/newText) on completion when possible~/.pi/agent/sessions/...pi-acp stores a small mapping file at ~/.pi/pi-acp/session-map.json so session/load can reattach to a previous pi session file/skill:skill-name in the ACP client)get_session_stats → contextUsage) to the client as ACP usage_update after each turn, on session/new and session/load, and after a model switchget_session_stats response includes contextUsage; otherwise no usage is reportedpi-acp emits “startup info” block into the session (pi version, context, skills, prompts, extensions - similar to pi in the terminal). You can disable it by setting quietStartup: true in pi settings (~/.pi/agent/settings.json or <project>/.pi/settings.json). When quietStartup is enabled, pi-acp will still emit a 'New version available' message if the installed pi version is outdated.v0.225.0. Session loading / history maps to pi's session files. Sessions can be resumed both in pi and in the ACP client.Make sure pi is installed
npm install -g @earendil-works/pi-coding-agent
pi v0.81.0+ installed and available on your PATH (the adapter runs the pi executable)pi separately for your model providers/API keysIn Zed launch the registry with zed: acp registry command and select pi ACP adapter from the list. This will automatically add the agent server configuration to your settings.json and keep it up to date:
"agent_servers": {
"pi-acp": {
"type": "registry",
},
}
npx (no global install needed, always loads the latest version):Add the following to your Zed settings.json:
"agent_servers": {
"pi": {
"type": "custom",
"command": "npx",
"args": ["-y", "pi-acp"],
"env": {}
}
}
npm install -g pi-acp
"agent_servers": {
"pi": {
"type": "custom",
"command": "pi-acp",
"args": [],
"env": {}
}
}
npm install
npm run build
Point your ACP client to the built dist/index.js:
"agent_servers": {
"pi": {
"type": "custom",
"command": "node",
"args": ["/path/to/pi-acp/dist/index.js"],
"env": {}
}
}
PI_ACP_ENABLE_EMBEDDED_CONTEXT=true advertises ACP promptCapabilities.embeddedContext support to the client.false.resource blocks. If they send them anyway, pi-acp still degrades gracefully by converting them into plain-text prompt context.You can add the environment variable in the Zed settings with:
"agent_servers": {
"pi": {
"type": "custom",
"command": "node",
"args": ["/path/to/pi-acp/dist/index.js"],
"env": {
"PI_ACP_ENABLE_EMBEDDED_CONTEXT": "true",
}
}
}
pi-acp supports slash commands:
Loaded from:
~/.pi/agent/prompts/**/*.md<cwd>/.pi/prompts/**/*.md/compact [instructions...] – run pi compaction (optionally with custom instructions)/autocompact on|off|toggle – toggle automatic compaction/export – export the current session to HTML in the session cwd/session – show session stats (tokens/messages/cost/session file)/name <name> – set session display name/queue all|one-at-a-time – set pi queue mode (unstable feature)/changelog – print the installed pi changelog (best-effort)/steering - maps to pi Steering Mode, get/set/follow-up - pats to pi Follow-up Mode, get/setOther built-in commands:
/model - not implemented (use the model selector UI in Zed)/thinking - maps to 'mode' selector in Zed/clear - not implemented (use ACP client 'new' command)/skill:skill-name.Note: Slash commands provided by pi extensions are not currently supported.
This agent supports Terminal Auth for the ACP Registry. In Zed, this will show an Authenticate banner that launches pi in a terminal. Launch pi in a terminal for interactive login/setup:
pi-acp --terminal-login
Your ACP client can also invoke this automatically based on the agent's advertised authMethods.
npm install
npm run dev # run from src via tsx
npm run build
npm run lint
npm run test
Project layout:
src/acp/* – ACP server + translation layersrc/pi-rpc/* – pi subprocess wrapper (RPC protocol)fs/*) and no ACP terminal delegation (terminal/*). pi reads/writes and executes locally.agent_message_chunk (no separate thought stream).one-at-a-timepi-acp can be /resumed in pi directlyMIT (see LICENSE).
(top 24 of 31)
1,014 followers · starred Aug 2026
907 followers · starred Apr 2026
951 followers · starred Mar 2026
1,058 followers · starred Apr 2026
TypeScript
93.9%
JavaScript
6.1%
ACP (Agent Client Protocol) adapter for pi coding agent (fka shitty coding agent).
pi-acp communicates ACP JSON-RPC 2.0 over stdio to an ACP client (e.g. Zed editor) and spawns pi --mode rpc, bridging requests/events between the two.
This is an MVP-style adapter intended to be useful today and easy to iterate on. Some ACP features may be not implemented or are not supported (see Limitations). Development is centered around Zed editor support, other clients may have varying levels of compatibility.
Expect some minor breaking changes.
agent_message_chunktool_call / tool_call_update
edit, pi-acp attempts to infer a 1-based line number from a unique oldText match in the pre-edit file snapshot and includes it in the emitted tool location when possibleedit, pi-acp snapshots the file before the tool runs and emits an ACP structured diff (oldText/newText) on completion when possible~/.pi/agent/sessions/...pi-acp stores a small mapping file at ~/.pi/pi-acp/session-map.json so session/load can reattach to a previous pi session file/skill:skill-name in the ACP client)get_session_stats → contextUsage) to the client as ACP usage_update after each turn, on session/new and session/load, and after a model switchget_session_stats response includes contextUsage; otherwise no usage is reportedpi-acp emits “startup info” block into the session (pi version, context, skills, prompts, extensions - similar to pi in the terminal). You can disable it by setting quietStartup: true in pi settings (~/.pi/agent/settings.json or <project>/.pi/settings.json). When quietStartup is enabled, pi-acp will still emit a 'New version available' message if the installed pi version is outdated.v0.225.0. Session loading / history maps to pi's session files. Sessions can be resumed both in pi and in the ACP client.Make sure pi is installed
npm install -g @earendil-works/pi-coding-agent
pi v0.81.0+ installed and available on your PATH (the adapter runs the pi executable)pi separately for your model providers/API keysIn Zed launch the registry with zed: acp registry command and select pi ACP adapter from the list. This will automatically add the agent server configuration to your settings.json and keep it up to date:
"agent_servers": {
"pi-acp": {
"type": "registry",
},
}
npx (no global install needed, always loads the latest version):Add the following to your Zed settings.json:
"agent_servers": {
"pi": {
"type": "custom",
"command": "npx",
"args": ["-y", "pi-acp"],
"env": {}
}
}
npm install -g pi-acp
"agent_servers": {
"pi": {
"type": "custom",
"command": "pi-acp",
"args": [],
"env": {}
}
}
npm install
npm run build
Point your ACP client to the built dist/index.js:
"agent_servers": {
"pi": {
"type": "custom",
"command": "node",
"args": ["/path/to/pi-acp/dist/index.js"],
"env": {}
}
}
PI_ACP_ENABLE_EMBEDDED_CONTEXT=true advertises ACP promptCapabilities.embeddedContext support to the client.false.resource blocks. If they send them anyway, pi-acp still degrades gracefully by converting them into plain-text prompt context.You can add the environment variable in the Zed settings with:
"agent_servers": {
"pi": {
"type": "custom",
"command": "node",
"args": ["/path/to/pi-acp/dist/index.js"],
"env": {
"PI_ACP_ENABLE_EMBEDDED_CONTEXT": "true",
}
}
}
pi-acp supports slash commands:
Loaded from:
~/.pi/agent/prompts/**/*.md<cwd>/.pi/prompts/**/*.md/compact [instructions...] – run pi compaction (optionally with custom instructions)/autocompact on|off|toggle – toggle automatic compaction/export – export the current session to HTML in the session cwd/session – show session stats (tokens/messages/cost/session file)/name <name> – set session display name/queue all|one-at-a-time – set pi queue mode (unstable feature)/changelog – print the installed pi changelog (best-effort)/steering - maps to pi Steering Mode, get/set/follow-up - pats to pi Follow-up Mode, get/setOther built-in commands:
/model - not implemented (use the model selector UI in Zed)/thinking - maps to 'mode' selector in Zed/clear - not implemented (use ACP client 'new' command)/skill:skill-name.Note: Slash commands provided by pi extensions are not currently supported.
This agent supports Terminal Auth for the ACP Registry. In Zed, this will show an Authenticate banner that launches pi in a terminal. Launch pi in a terminal for interactive login/setup:
pi-acp --terminal-login
Your ACP client can also invoke this automatically based on the agent's advertised authMethods.
npm install
npm run dev # run from src via tsx
npm run build
npm run lint
npm run test
Project layout:
src/acp/* – ACP server + translation layersrc/pi-rpc/* – pi subprocess wrapper (RPC protocol)fs/*) and no ACP terminal delegation (terminal/*). pi reads/writes and executes locally.agent_message_chunk (no separate thought stream).one-at-a-timepi-acp can be /resumed in pi directlyMIT (see LICENSE).
(top 24 of 31)
1,014 followers · starred Aug 2026
907 followers · starred Apr 2026
951 followers · starred Mar 2026
1,058 followers · starred Apr 2026
TypeScript
93.9%
JavaScript
6.1%