Pi extension that registers CodeBuddy as a model provider. You keep using Pi for the TUI, tools, skills, and extensions; CodeBuddy Agent SDK runs inference locally via the codebuddy CLI. No HTTP proxy and no changes to how you work in Pi beyond picking a model.
- Exposes CodeBuddy models in Pi (
codebuddy/...in/model) - Bridges Pi tools to the SDK (Pi still executes tools; CodeBuddy only plans and calls them)
- Forwards Pi's system prompt, skills, and project
AGENTS.mdso the model acts as Pi—not as standalone CodeBuddy Code - Supports session resume, compaction, streaming, thinking levels, and images
- Optional AskCodebuddy tool to delegate a focused sub-task to another CodeBuddy call
pi install npm:pi-codebuddy-sdkRestart pi if it was already running.
codebuddyon yourPATH— the extension spawns the same CLI you use standalone. Ifwhich codebuddyfails, either add it toPATHor setpathToCodebuddyCodeincodebuddy-sdk.json(see Configuration).- CodeBuddy auth already working — if
codebuddyworks in your terminal, you do not need extra setup for this extension.
No codebuddy-sdk.json and no plugin-specific env vars are required.
pi install npm:pi-codebuddy-sdk- Restart
pi /model→ pickcodebuddy/...
Optional: set defaultProvider / defaultModel in ~/.pi/agent/settings.json so you skip /model each time.
The first query after startup may take a few seconds while models are discovered from the SDK.
The extension does not store credentials. The CodeBuddy CLI reads them from your machine. Use one of the following:
codebuddy loginComplete login in the browser. Credentials stay on your machine; Pi reuses them automatically.
export CODEBUDDY_API_KEY="your-api-key"Obtain the key from your CodeBuddy account. Do not commit it or store it in repo files.
export CODEBUDDY_INTERNET_ENVIRONMENT=ioa
codebuddy loginUse this when CodeBuddy must run on the iOA network. Add CODEBUDDY_API_KEY as well if your environment requires it.
pi
/model
Pick any entry prefixed with codebuddy/ (for example codebuddy/hy3-preview-agent-ioa).
Tools, skills, extensions, /compact, and steer behave the same as with other Pi providers.
Optional. Defaults work for most users.
File: ~/.pi/agent/codebuddy-sdk.json or .pi/codebuddy-sdk.json in a project.
{
"askCodebuddy": {
"enabled": true,
"allowFullMode": true
},
"provider": {
"appendSystemPrompt": true,
"strictMcpConfig": true,
"pathToCodebuddyCode": "/path/to/codebuddy"
}
}| Option | Default | Meaning |
|---|---|---|
askCodebuddy.enabled |
true |
Register the AskCodebuddy delegation tool |
askCodebuddy.allowFullMode |
true |
Allow write-capable delegation mode |
provider.appendSystemPrompt |
true |
Use Pi's system prompt instead of CodeBuddy's default identity |
provider.strictMcpConfig |
true |
Use only Pi-bridged MCP tools |
provider.pathToCodebuddyCode |
auto | Path to codebuddy when it is not on PATH |
- The extension does not send conversation data to this repository or any third-party telemetry endpoint.
- Credentials are handled entirely by the CodeBuddy CLI on your machine.
- Optional debug mode (
CODEBUDDY_SDK_DEBUG=1) writes local logs under~/.pi/agent/; paths are redacted, prompts and tool payloads are not logged. Delete logs when finished.
export CODEBUDDY_SDK_DEBUG=1Default log: ~/.pi/agent/codebuddy-sdk.log. See CONTRIBUTING.md for maintainer details.
Maintainers: CONTRIBUTING.md.
MIT
Early MCP bridge patterns were inspired by pi-claude-bridge. This package is a separate codebase on @tencent-ai/agent-sdk.