pi-watch
Pi extension that watches for AI comments in your code and sends them to the agent
Package details
Install pi-watch from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-watch- Package
pi-watch- Version
0.1.0- Published
- Jan 29, 2026
- Downloads
- 20/mo · 7/wk
- Author
- kaofelix
- License
- MIT
- Types
- extension
- Size
- 46.3 KB
- Dependencies
- 1 dependency · 1 peer
Pi manifest JSON
{
"extensions": [
"./index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-watch
A pi extension that watches for AI comments in your code and sends them to the agent.
Inspired by aider's watch mode.
Installation
pi install npm:pi-watch
Or try it without installing:
pi -e npm:pi-watch --watch
Usage
Run pi with the --watch flag:
pi --watch
How It Works
Add comments to your files using supported comment styles (#, //, --):
AI- Collects the comment, waits for a triggerAI!- Triggers sending all collected comments to the AI agent
The AI marker can be at the start or end of a comment line, and is case-insensitive.
Examples
// AI! Add error handling to this function
function process(data) {
return data.map(d => d.value);
}
# Extract this logic into a helper function AI
def calculate_total(items):
total = 0
for item in items:
total += item.price
return total
Multi-file Comments
AI comments can span multiple files. All comments are collected until an AI! trigger is found, then all are sent together.
Multi-line Comments
Multi-line comments work too! Add the AI marker to each line you want included:
// This function needs work AI
// fix the race condition AI!
function process(data) {
return data.map(d => d.value);
}
Consecutive lines with AI markers are collected together and sent as one message.
Development
# Run tests
npm test
# Check code with Biome (lint + format)
npm run check
# Auto-fix Biome issues
npm run check:fix
# Format code with Biome
npm run format
License
MIT