What this artifact is for
The quick orientation layer before you go deeper upstream.
Summary
Unified extensions API (hooks, tools, events, UI)
Seed description: Unified extensions API (hooks, tools, events, UI)
Category: Official Documentation
Best for: Not yet synthesized.
How to read this page
Workflow tags: none captured
Integrations: none captured
Caveats: No caveats captured yet
Maturity: No maturity signals captured
Source excerpt
More of the actual upstream surface so you can skim here before deciding to open the repo.
pi can create extensions. Ask it to build one for your use case.
Extensions are TypeScript modules that extend pi's behavior. They can subscribe to lifecycle events, register custom tools callable by the LLM, add commands, and more.
Placement for /reload: Put extensions in ~/.pi/agent/extensions/ (global) or .pi/extensions/ (project-local) for auto-discovery. Use pi -e ./path.ts only for quick tests. Extensions in auto-discovered locatio…
Preview source: captured upstream text ↗
Quick topics
Skim bullets
- Custom tools - Register tools the LLM can call via pi.registerTool()
- Event interception - Block or modify tool calls, inject context, customize compaction
- User interaction - Prompt users via ctx.ui (select, confirm, input, notify)
- Custom UI components - Full TUI components with keyboard input via ctx.ui.custom() for complex interactions
- Custom commands - Register commands like /mycommand via pi.registerCommand()
- Session persistence - Store state that survives restarts via pi.appendEntry()
- Custom rendering - Control how tool calls/results and messages appear in TUI
- Permission gates (confirm before rm -rf, sudo, etc.)
Sources and provenance
Everything on this page should be traceable back to the list seed or an upstream surface.
Discovery reason: Listed in the awesome-pi-agent README
Discovered from: seed artifact
Claim confidence: medium
Surface capture kind: blob-markdown