This directory contains a test extension demonstrating pi-mono's extensibility.
The extension is at .pi/extensions/test-extensibility.ts and loads automatically.
cd ~/code/flow
piOnce pi is running, try these:
use the counter tool to increment by 5
increment the counter 3 times, then show me the value
run: echo "hello world"
(Watch the console for [test-ext] Tool called: bash)
run: rm -i test.txt
(Should show a warning notification)
Type directly:
/count
The extension logs to console. Look for [test-ext] prefixed messages.
- Custom Tools -
countertool with multiple actions - Event Hooks -
tool_callandturn_endlisteners - Custom Commands -
/countslash command - Session Events - Reset state on
session_start - UI Interactions -
ctx.ui.notify()for warnings
Edit .pi/extensions/test-extensibility.ts to:
- Add more tools
- Block dangerous operations (return
{ block: true }) - Add keyboard shortcuts with
pi.registerShortcut() - Register custom LLM providers with
pi.registerProvider()