Pi Extensions Workspace
New extension
extensions/{name}/package.json— template belowextensions/{name}/index.tsbun install
package.json
{
"name": "@bugabinga/pi-ext-{name}",
"version": "0.0.0",
"private": true,
"type": "module",
"main": "index.ts",
"peerDependencies": {
"@earendil-works/pi-coding-agent": "*"
}
}
Add only deps actually imported by the extension.
Prefer peerDependencies for Pi packages (@earendil-works/*).
Run bun install after any structural change.
Independence
- Extensions must be standalone packages.
- Never import from another
@bugabinga/pi-ext-*package. - Optional integration must be capability/event based and degrade cleanly.
- If behavior is important, provide a native fallback; decorative integration may no-op.
Publishing
- Source of truth for release gates:
justfile→scripts/extensions.py. - Run
just check [{name}]beforenpm publish. - License is MIT.
Documentation
- READMEs must be terse.
- Do not duplicate source-of-truth docs/config/API details.
- Link to canonical source files, commands, settings, or upstream docs instead.
- Package README should answer: what, install/load, commands/tools, settings link, optional integrations.
Imports
| Package | Provides | Use |
|---|---|---|
@earendil-works/pi-coding-agent |
SDK — ExtensionAPI, types, ctx | Always (peer dep) |
@earendil-works/pi-tui |
TUI components, truncateToWidth, Key | Rendering |
@bugabinga/pi-ext-* |
— | **Never |
import
from
other
extensions** |