An openbee engine plugin that runs tasks with the pi coding agent. It is built on @theopenbee/engine-sdk.
You install and configure pi yourself. The plugin only starts it.
npm i -g @earendil-works/pi-coding-agentGive pi access to a model provider in one of two ways:
- Log in or configure providers with pi's own tools (
pi, then/login), or - Set the provider key as an environment variable in openbee's Env settings (for example
DEEPSEEK_API_KEY). openbee passes its environment, including these settings, to pi.
The plugin itself needs Node.js 20 or newer (or Bun).
openbee plugin install piOr from npm by package name:
openbee plugin install @theopenbee/engine-piOr from a local checkout:
git clone https://github.com/theopenbee/engine-pi.git
cd engine-pi
npm install
openbee plugin install "$(pwd)"Then enable the plugin, and pick pi as the default engine or per worker.
| Setting | Description |
|---|---|
path |
Path to the pi executable. Leave empty to use pi from PATH. |
The plugin checks the setting when it is enabled: it runs pi --version and shows the version, or the reason it failed (for example pi not found on PATH).
Every conversation maps to one pi session file:
~/.openbee/.pi/sessions/<session_id>.jsonl
This is the plugin's state_dir/sessions. openbee never deletes it, so sessions survive uninstalling the plugin and continue when you install it again. pi resumes a session when its file already exists. Token usage is read from the same files and summed per model.
pi --mode json --session <state_dir>/sessions/<session_id>.jsonl -p <prompt> [-e <package>/assets/openbee-mcp.js] [extra args]
- When openbee provides its MCP server, the plugin loads the bundled
assets/openbee-mcp.jsextension and setsOPENBEE_MCP_URL. The API key reaches pi through theOPENBEE_API_KEYenvironment variable, never through the command line. - The log written for each run drops streaming deltas (
message_update,tool_execution_update) andthinkingSignaturefields. - The result is the first text item of the last assistant message in the last
agent_endevent. A non-zero exit code or an assistant message withstopReason: "error"is reported as a failed run.
npm install
npm testnpm install also builds dist/; run npm run build after changing src/. The end-to-end tests run the plugin against a fake pi script, under Node and under Bun when it is installed (bun on PATH or ~/.openbee/runtime/bun-*/bun).
MIT