Pi Provider
The Pi provider runs Pi in-process through its TypeScript SDK. Unlike Codex and Copilot, which shell out to external CLIs, the Pi adapter calls the SDK directly.
Prerequisites
Section titled “Prerequisites”- Install Pi independently:
npm install -g @mariozechner/pi-coding-agentpi /login # authenticate with your providerpi /model # pick a default model- Node.js 22.5+ (same as the Sidemesh daemon).
Guided setup
Section titled “Guided setup”npm install -g sidemesh @mariozechner/pi-coding-agentsidemesh setup # select Pi from the provider listsidemesh upManual config
Section titled “Manual config”Add to ~/.sidemesh/config.json:
{ "providers": [ { "kind": "pi", "agentDir": "~/.pi/agent", "stateDir": null } ], "defaultProviderKind": "pi"}| Field | Description |
|---|---|
agentDir | Pi config directory. Default: ~/.pi/agent |
stateDir | Sidemesh Pi sidecar state. Default: ~/.sidemesh/pi-provider |
Capabilities
Section titled “Capabilities”| Feature | Status | Notes |
|---|---|---|
| Text input | ✅ | Full support |
| Local images | ✅ | Base64-encoded |
| Image URLs | ❌ | Ignored with warning |
| Skills | ✅ | Inlined from Pi skill dirs |
| Model switching | ✅ | Auth-filtered model list |
| Thinking level | ✅ | Override when supported |
| Compaction | ✅ | Native Pi compaction |
| Session archive | ✅ | Sidecar tracked |
| Interrupt | ✅ | Calls Pi abort() |
| Filesystem | Host | Daemon-owned |
| Approvals | ❌ | Pi does not expose gating |
| Terminal | Host | Daemon-owned |
Environment variables
Section titled “Environment variables”| Variable | Purpose |
|---|---|
SIDEMESH_PI_AGENT_DIR | Override Pi agent directory |
SIDEMESH_PI_STATE_DIR | Override Sidemesh sidecar directory |
Troubleshooting
Section titled “Troubleshooting”Unknown Pi session after restart
The sidecar index is stale. Restarting triggers a fresh scan of ~/.pi/agent/sessions/.
No API key for anthropic/claude-
The model is visible but unauthenticated. Run pi /login for that provider.
Image URLs silently ignored Pi only accepts local files. Sidemesh emits a stderr warning and substitutes an explanatory prompt.
Slow session list
First scan walks all .jsonl files. Subsequent calls use a stat-based fingerprint cache.