singularity-forge/docs/extending-pi/03-getting-started.md
Lex Christopherson 9f4bf8c452 fix: restore PR files lost during merge conflict resolution
Files added by PR #2008 that were not in main were dropped during
the merge. Restore all src/, docs/, and scripts/ files from the
pre-merge PR head.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 22:39:33 -06:00

36 lines
642 B
Markdown

# Getting Started
### Minimal Extension
Create `~/.gsd/agent/extensions/my-extension.ts`:
```typescript
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
export default function (pi: ExtensionAPI) {
pi.on("session_start", async (_event, ctx) => {
ctx.ui.notify("Extension loaded!", "info");
});
}
```
### Testing
```bash
# Quick test (doesn't need to be in extensions dir)
pi -e ./my-extension.ts
# Or just place it in the extensions dir and start pi
pi
```
### Hot Reload
Extensions in auto-discovered locations (`~/.gsd/agent/extensions/` or `.gsd/extensions/`) can be hot-reloaded:
```
/reload
```
---