A pi extension that watches for AI comments in your code and sends them to the agent.
Inspired by aider's watch mode.
pi install npm:pi-watchOr try it without installing:
pi -e npm:pi-watch --watchRun pi with the --watch flag:
pi --watchAdd 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.
// 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 totalAI comments can span multiple files. All comments are collected until an AI! trigger is found, then all are sent together.
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.
# 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 formatMIT