Summary
Add pi as a native target in CodeGraph's install command so users can run codegraph install --target pi to automatically configure CodeGraph's MCP server for Pi (Android/Termux).
Changes Made
-
New file: src/installer/targets/pi.ts
- Implements the
AgentTarget interface for Pi
- Configures MCP server entry to
~/.pi/agent/mcp.json (global) or .pi/mcp.json (local project)
- Installs CodeGraph instructions to
~/.pi/agent/AGENTS.md (global) or .pi/AGENTS.md (local)
- Uses standard
mcpServers format (same as Claude/Cursor/opencode)
- No permissions concept (Pi handles tool approval via its own UI)
-
Modified: src/installer/targets/types.ts
- Added
'pi' to the TargetId union type
-
Modified: src/installer/targets/registry.ts
- Imported
piTarget from ./pi
- Added
piTarget to the ALL_TARGETS array
Testing Evidence (logs generated in IA-Generativa project)
All tests passed successfully:
- Pi Global Install ✓ - Creates
~/.pi/agent/mcp.json and ~/.pi/agent/AGENTS.md
- Pi Local Install ✓ - Creates
.pi/mcp.json and .pi/AGENTS.md in project directory without affecting global config
- Pi Auto-Detection ✓ -
codegraph install --target auto correctly detects Pi as installed
- Pi Uninstall ✓ - Correctly removes the configuration
- Idempotency ✓ - Re-runs correctly report "Unchanged"
Verification Commands
# Install Pi target globally
codegraph install --target pi --location global --yes
# Install Pi target locally (project-scoped)
codegraph install --target pi --location local --yes
# Auto-detect installed targets (Pi will be detected)
codegraph install --target auto --location global --yes
# Uninstall Pi from local project
codegraph uninstall --target pi --location local
Note
This PR follows the exact pattern of existing targets like opencode.ts, with Pi-specific config paths (~/.pi/agent/). The pi-mcp-adapter package (v2.27.0 with @ff-labs/fff-node@0.10.5 override for Android compatibility) is used for MCP server configuration.
Generated and tested on Android/Termux architecture aarch64/arm64.
Summary
Add
pias a native target in CodeGraph'sinstallcommand so users can runcodegraph install --target pito automatically configure CodeGraph's MCP server for Pi (Android/Termux).Changes Made
New file:
src/installer/targets/pi.tsAgentTargetinterface for Pi~/.pi/agent/mcp.json(global) or.pi/mcp.json(local project)~/.pi/agent/AGENTS.md(global) or.pi/AGENTS.md(local)mcpServersformat (same as Claude/Cursor/opencode)Modified:
src/installer/targets/types.ts'pi'to theTargetIdunion typeModified:
src/installer/targets/registry.tspiTargetfrom./pipiTargetto theALL_TARGETSarrayTesting Evidence (logs generated in IA-Generativa project)
All tests passed successfully:
~/.pi/agent/mcp.jsonand~/.pi/agent/AGENTS.md.pi/mcp.jsonand.pi/AGENTS.mdin project directory without affecting global configcodegraph install --target autocorrectly detects Pi as installedVerification Commands
Note
This PR follows the exact pattern of existing targets like
opencode.ts, with Pi-specific config paths (~/.pi/agent/). The pi-mcp-adapter package (v2.27.0 with @ff-labs/fff-node@0.10.5 override for Android compatibility) is used for MCP server configuration.Generated and tested on Android/Termux architecture aarch64/arm64.