What this integration does
The Pi integration is an extension package, not an MCP setup. It loads
inside Pi, listens to Pi session and tool events directly, and forwards a
small set of safe reactions to your running OpenPets desktop app through
@open-pets/client.
| Part | What it does | Why it matters |
|---|---|---|
| Pi extension | Subscribes to Pi session, agent, and tool events. | The pet can react automatically while Pi thinks, edits, runs commands, succeeds, or errors. |
| OpenPets IPC client | Sends reactions and short status messages over local IPC. | Runtime is local. Pi never depends on a remote service to control the pet. |
| /openpets commands | Adds status, test, react, and say subcommands. |
Users can verify the connection and trigger manual reactions from inside Pi. |
Runtime control is best-effort. Pi keeps working if the OpenPets desktop app is closed; the extension quietly skips pet updates until the desktop app is reachable again.
Install
Keep the OpenPets desktop app running, then install the Pi extension package with Pi. Use global setup for your machine, or project-local setup for a single repository.
pi install npm:@open-pets/pi
pi install -l npm:@open-pets/pi
Global setup writes to Pi's global package settings. Project-local setup
writes to .pi/settings.json, which is better when a repository
should explicitly carry its OpenPets behavior. Reload or restart Pi after
changing package settings so the new extension is loaded.
Slash commands
The extension registers one user-facing command namespace so you can test and steer the integration without adding extra Pi tools. None of these commands forward prompts or tool output.
| Command | Purpose |
|---|---|
/openpets status | Check whether the OpenPets desktop app is reachable and which pet is targeted. |
/openpets test | Send a short test reaction and waving message. |
/openpets react <reaction> | Manually set a safe reaction such as thinking, testing, success, or error. |
/openpets say <message> | Show one short validated speech bubble. |
/openpets help | Print the available subcommands inside Pi. |
Manual say input goes through the same OpenPets validator the
desktop app uses: brief, single-line, user-facing, and never code, logs,
paths, URLs, prompts, or secrets.
Automatic event reactions
The extension maps Pi lifecycle events to pet reactions without asking the model to call a tool. Most events are silent reaction-only updates; only errors may speak, and only with a fixed safe message.
| Pi event | Condition | Reaction | Speech |
|---|---|---|---|
session_start | Pi starts, resumes, or reloads. | waving | None by default. |
agent_start | Agent loop begins. | thinking | None. |
turn_start | New turn begins. | working | None. |
tool_execution_start | Tool looks like edit/write/patch/apply. | editing | None. |
tool_execution_start | Tool or shell command looks test-like. | testing | None. |
tool_execution_start | Shell/bash command, non-test. | running | None. |
tool_execution_start | Other tool. | working | None. |
tool_execution_end | isError is true. | error | Short fixed error-pool message, throttled. |
agent_end | Agent loop finishes without a recent tool error. | success | None. |
session_shutdown | Pi quits, reloads, switches, or forks. | idle | None. |
The extension may inspect bounded tool-name and command slices only to
classify reactions. It does not speak raw commands, output, prompts, or file
paths. OpenPets-related commands are filtered out so the pet
cannot self-trigger.
Safety and behavior
The Pi extension follows the same safety model as Claude Code, OpenCode, and the MCP server. It is designed for ambient visible status only.
| Protection | Behavior |
|---|---|
| No transcript forwarding | Automatic events never send prompts, assistant text, tool input, tool output, file contents, URLs, paths, or secrets. |
| Validated manual speech | /openpets say rejects multi-line, long, code-like, URL/path-like, or secret-looking text. |
| Best-effort runtime | OpenPets failures never block Pi model calls or tool execution. |
| No Pi tools in MVP | The extension registers a user slash command only. It does not expose model-callable Pi tools. |
| Trusted package boundary | Pi extensions run with local system permissions, so install only packages you trust. |
| Self-trigger guard | Tool calls related to OpenPets are ignored by the event mapper. |
Pet routing
By default, automatic reactions and manual commands target the desktop default pet. Explicit per-extension pet routing is deferred until a later Pi subphase so the runtime contract stays simple.
Pi
-> @open-pets/pi extension
-> @open-pets/client
-> OpenPets desktop local IPC
-> default pet
Troubleshooting
The pet does not react
- Confirm the OpenPets desktop app is running.
- Run
/openpets statusinside Pi. - Reload or restart Pi after installing or removing the package.
- Remember that most automatic events are reaction-only and intentionally silent.
Remove the package
pi remove npm:@open-pets/pi
For project-local installs, run the remove command from the project where you installed the package and follow Pi's project settings behavior.
Status
The @open-pets/pi package is published on npm and follows the
same safety model as the other OpenPets integrations. The Pi package API
surface this version is built against is
@earendil-works/pi-coding-agent; pin or upgrade Pi as part of
your normal Pi update flow.

