@ttiimmaahh/pi-xcode
v0.2.3
Published
Use the Pi coding agent as an Xcode Intelligence ACP agent.
Maintainers
Readme
pi-xcode
Use the Pi coding agent as a custom ACP agent in Xcode Intelligence.
pi-xcode is intentionally focused on Xcode. It speaks the Agent Client Protocol (ACP) shape Xcode expects over stdio, then embeds Pi through the Pi SDK. It is not currently intended to be a universal ACP compatibility layer for every ACP client.
Status
pi-xcode 0.2.3 is validated as an Xcode-launched ACP adapter:
- Xcode can add and launch
pi-xcodeas an ACP agent. - Xcode conversations stream Pi responses.
- Pi runs in the Xcode project working directory.
- Provider/model overrides can be passed from Xcode argument rows.
- Pi extension-registered providers are loaded before model selection.
- Xcode-provided MCP tools are connected by default and manually validated for read, search, write/delete, and allowlist filtering.
- Plan-mode workflows expose ACP
default/planmodes and Claude-compatible plan tools (EnterPlanMode,ExitPlanMode,TodoWrite). ask_user_questionis bridged toward ACP form elicitation when available, with a manual chat fallback while Xcode 27 beta does not advertiseelicitation.formto custom ACP agents.
Requirements
- Xcode 27 or newer. Xcode custom ACP agents are an Xcode 27+ feature. Xcode 27 is currently beta-only; Xcode 26 and earlier cannot launch
pi-xcodeas an Intelligence custom agent. - Node.js 20 or newer. Node 24 is recommended and is used for release validation.
- A working Pi configuration with an authenticated provider/model.
Check your Node version with:
node --versionInstall
Install the published package globally:
npm install -g @ttiimmaahh/pi-xcodeVerify the executable is available:
which pi-xcode
pi-xcode --help
pi-xcode --versionUpdate an existing global install with:
npm update -g @ttiimmaahh/pi-xcode
# or force the latest published version
npm install -g @ttiimmaahh/pi-xcode@latestpi-xcode is a standalone ACP executable that Xcode launches directly. It is not currently loaded as a normal Pi extension package, so pi update --extensions does not update the globally installed pi-xcode binary unless you intentionally installed and pointed Xcode at a Pi-managed package copy. For the recommended setup, use npm's global update command above.
For local development from a source checkout:
git clone https://github.com/ttiimmaahh/pi-xcode.git
cd pi-xcode
npm install
npm run buildMake sure Pi itself is authenticated/configured before launching from Xcode:
pi
/loginor configure provider API keys in your shell environment / Pi auth storage.
Xcode setup
Requires Xcode 27+. If your Xcode Settings → Intelligence pane does not have custom agent support, you are probably running Xcode 26 or earlier. Install/use the Xcode 27 beta or newer before configuring
pi-xcode.
Recommended setup: installed npm package
After installing globally, find the exact paths Xcode needs.
Print the pi-xcode executable path:
command -v pi-xcodePrint the Node executable path:
node -p 'process.execPath'The outputs might look like one of these, depending on your Node/npm setup:
/opt/homebrew/bin/pi-xcode
/usr/local/bin/pi-xcode
/Users/you/.nvm/versions/node/<node-version>/bin/pi-xcode/opt/homebrew/bin/node
/usr/local/bin/node
/Users/you/.nvm/versions/node/<node-version>/bin/nodeThen configure Xcode:
Open Xcode Settings.
Go to Intelligence.
In Agents, click Add an Agent….
Fill the sheet:
| Xcode field | Value | | --- | --- | | Name |
Piorpi-xcode| | Executable | the absolute path fromcommand -v pi-xcode| | Interpreter | usually blank for the npm-installed executable; if launch fails, use the absolute path fromnode -p 'process.execPath'| | Arguments | optional; enter one argv token per Xcode row |
Recommended first-run Arguments rows:
--debug
--xcode-mcp-tools
XcodeRead,XcodeGrep,XcodeGlobThose three rows enable debug logging and expose only read/search Xcode tools. Remove the --xcode-mcp-tools rows later if you want write/build/run/device tools available.
If Xcode does not launch the agent, set Interpreter to the absolute Node executable path from:
node -p 'process.execPath'Then check the debug log:
tail -f ~/.pi/agent/pi-xcode/debug.logLocal checkout setup
Use this only if you are developing pi-xcode from source rather than using the published package.
Build the local checkout:
git clone https://github.com/ttiimmaahh/pi-xcode.git cd pi-xcode npm install npm run buildFind your Node executable:
node -p 'process.execPath'Configure Xcode:
| Xcode field | Value | | --- | --- | | Name |
Piorpi-xcode| | Executable | the absolute path to<repo>/dist/cli.js| | Interpreter | the absolute path returned bynode -p 'process.execPath'| | Arguments | optional; enter one argv token per Xcode row |
For local dist/cli.js, do not leave Interpreter blank. The script may work in Terminal while Xcode still fails to launch it without an explicit Node interpreter.
Xcode Arguments examples
Xcode Arguments are not a shell command line. Each row is one argv token. Put flags and values on separate rows unless you intentionally use a supported --flag=value form.
Use Pi's normal defaults
Use your normal Pi configured provider/model/thinking settings:
--debugSAP AI Core / extension-registered provider
--debug
--provider
sap-aicore-foundation
--model
gpt-5.5
--thinking
highOpenAI
--debug
--provider
openai
--model
gpt-5.2-codex
--thinking
highCloudflare Workers AI
Cloudflare model ids can contain /, so pass provider and model separately:
--debug
--provider
cloudflare-workers-ai
--model
@cf/openai/gpt-oss-120b
--thinking
mediumProvider/model shorthand
When the model id itself does not contain / ambiguity for that provider, you can use shorthand:
--debug
--model
openai/gpt-5.2-codex
--thinking
highThis is parsed as provider openai, model gpt-5.2-codex.
Tool filters
By default, pi-xcode uses Pi's normal default tools plus Xcode MCP tools when Xcode provides them.
Filter Pi tools:
--tools
read,bash,edit,write--exclude-tools
bashDisable Xcode MCP entirely:
--no-xcode-mcpAllow only selected Xcode MCP tools:
--xcode-mcp-tools
XcodeRead,XcodeGrep,XcodeGlobDeny selected Xcode MCP tools while keeping the rest:
--exclude-xcode-mcp-tools
XcodeWrite,UpdateTargetBuildSetting,DeviceInteractionStartSessionCLI options
--debug
--debug-log <path>
--provider <provider>
--model <model-or-provider/model>
--thinking <off|minimal|low|medium|high|xhigh>
--tools <comma,separated,allowlist>
--exclude-tools <comma,separated,denylist>
--no-xcode-mcp
--xcode-mcp-tools <comma,separated,allowlist>
--exclude-xcode-mcp-tools <comma,separated,denylist>--flag=value is supported for value flags, but separate Xcode rows are easier to inspect and less error-prone.
Debug logs
When --debug is passed, pi-xcode writes diagnostics to:
~/.pi/agent/pi-xcode/debug.logOverride the location with:
--debug-log
/tmp/pi-xcode-debug.logpi-xcode never writes debug logs to stdout because stdout is reserved for ACP JSON-RPC messages.
The debug log includes:
- raw argv and parsed options
- Node version, executable path, and process cwd
- Xcode initialize client info/capabilities
session/newcwd and Xcode MCP server metadata- connected MCP servers and discovered Xcode MCP tool schemas
- selected/filtered Xcode MCP tools
- Pi service diagnostics and provider/model availability summaries
- selected provider/model/thinking and active tools
- prompt start/completion and final Pi stop/error details
- summarized ACP updates sent back to Xcode
- MCP tool call duration and error summaries
Troubleshooting
No fresh debug log entries
If ~/.pi/agent/pi-xcode/debug.log has no fresh Starting pi-xcode entry, Xcode probably did not launch the adapter.
Check:
- Executable points to the local
dist/cli.jsor installedpi-xcodepath. - Interpreter is an absolute Node binary path for local
dist/cli.js. npm run buildwas run anddist/cli.jsexists.- Arguments are one token per Xcode row.
initialize appears but no session/new
Xcode launched the process but did not create a session. Re-open the Xcode Intelligence conversation or reselect the Pi agent, then inspect the log again.
session/new appears but no Created Pi session
Pi session creation, extension loading, provider setup, or model selection failed. Inspect nearby Pi service diagnostic, Pi model fallback, or error entries in the debug log.
Model falls back to Cloudflare/default unexpectedly
The requested provider/model settings were not applied or the provider was not registered/available. Confirm:
- argument rows parse as expected in the
parsedOptionslog entry - extension-registered providers appear in the Pi provider summaries
- the
Created Pi sessionentry shows the intended provider/model - auth/config for that provider works in normal Pi
Prompt reaches Pi but no visible Xcode response
If session/prompt appears but Xcode shows no response:
- inspect
session/prompt completedfor Pi stop/error details - inspect
ACP session/updateentries to confirm chunks were sent to Xcode - inspect the logged
sessionFilefor persisted Pi messages - try a simple marker prompt from the manual checklist
Xcode MCP tools are missing
Xcode sends an xcode-tools MCP server and prompt guidance for native tools such as XcodeRead, XcodeWrite, XcodeGrep, and XcodeGlob.
If those tools are missing:
- confirm
--no-xcode-mcpis not set - inspect
Connecting MCP stdio serverandListed MCP toolsdebug entries - check whether
--xcode-mcp-toolsallowlist excludes the desired tool - check whether
--exclude-xcode-mcp-toolsdenies the desired tool - confirm Xcode sent an
xcode-toolsMCP server insession/new
Xcode MCP tools
When Xcode provides the xcode-tools MCP server, pi-xcode connects it and exposes the native Xcode tools to Pi as custom tools. Tool names are preserved exactly.
Validated tools include:
XcodeReadfor reading project filesXcodeWritefor safe file creation/updateXcodeGrepfor project search
Xcode may also expose build, run, test, device/simulator, target setting, entitlement, localization, documentation, and diagnostics tools. These can affect your project or connected devices. Use --xcode-mcp-tools, --exclude-xcode-mcp-tools, or --no-xcode-mcp if you want a narrower tool surface.
Known limitations
- Compatibility is targeted at Xcode first, not every ACP client.
- MCP support currently targets stdio MCP servers, especially Xcode's
xcode-toolsserver. - Session persistence uses normal Pi session storage for the Xcode project
cwd. session/loadandsession/resumeare not advertised yet.- Audio prompt blocks are currently omitted with a text note.
- Tool-call translation is intentionally pragmatic and may be refined after observing Xcode UI behavior.
Development
npm install
npm run check
npm run pack:dry-runThe smoke client verifies ACP handshake and session creation without contacting a model by default. To run a real prompt smoke test, set:
PI_XCODE_SMOKE_PROMPT=1 npm run smokeUpdating
For the recommended global npm install, update with:
npm update -g @ttiimmaahh/pi-xcode
pi-xcode --versionIf npm reports no update but you want to force the newest published version:
npm install -g @ttiimmaahh/pi-xcode@latestXcode stores the executable path you configured in Intelligence settings. If command -v pi-xcode points to the same path after updating, no Xcode setting changes are needed. If your Node/npm manager changes the global bin path, update Xcode's Executable field to the new command -v pi-xcode output.
Update notifications
pi-xcode does not currently auto-check npm for updates at runtime. Check the version manually with:
pi-xcode --version
npm view @ttiimmaahh/pi-xcode versionRelease notes are published in CHANGELOG.md, GitHub Releases, and npm package versions. Because pi-xcode runs as a standalone Xcode ACP agent rather than a Pi-loaded extension, Pi's extension updater is not the primary update channel.
Releasing
This repo follows the same tag-driven release process as the other ttiimmaahh Pi extensions:
- Ensure
npm run checkandnpm run pack:dry-runpass locally. - Update
CHANGELOG.mdfor the release. - Run
npm version patch(orminor/major) to update package metadata, create a commit, and tagvX.Y.Z. - Push with
git push --follow-tags. - The tag-triggered GitHub Actions workflow verifies the tag, runs checks, publishes to npm using Trusted Publishing/OIDC, and creates a GitHub Release.
One-time npm setup: configure ttiimmaahh/pi-xcode and .github/workflows/publish.yml as a Trusted Publisher for the @ttiimmaahh/pi-xcode package on npmjs.com.
License
MIT
