Custom extensions for the pi coding agent.
| Extension | Description |
|---|---|
| auto-rename | Automatically generate session names based on first user query |
| crosstalk | Inter-session control socket and messaging (adapted from Armin Ronacher) |
| octo-todos | Todo management tools for Octo frontend integration (drop-in replacement for OpenCode todowrite/todoread) |
| delegate | Delegate tasks to Pi subagents (parallel + async), with Octo child-session integration |
- Node.js 18+
- npm
npm install| Command | Description |
|---|---|
npm run check |
Run lint + typecheck |
npm run lint |
Biome linting only |
npm run lint:fix |
Auto-fix lint issues |
npm run typecheck |
tsgo type checking |
This repo uses Biome with strict rules:
Correctness:
noUnusedVariables: error - Catch dead codenoUnusedImports: error - Keep imports clean
Complexity:
noExcessiveCognitiveComplexity: warn (max 25) - Flag overly complex functions
Style:
noNonNullAssertion: warn - Discourage!assertionsuseConst: error - PreferconstoverletuseTemplate: error - Prefer template literals over concatenationnoUnusedTemplateLiteral: error - Don't use backticks for plain stringsnoParameterAssign: error - Don't reassign parametersuseDefaultParameterLast: error - Default params at enduseShorthandArrayType: error - UseT[]notArray<T>useSingleVarDeclarator: error - One variable per declaration
Suspicious:
noExplicitAny: warn - DiscourageanytypenoConfusingVoidType: error - Avoid confusing void usagenoDoubleEquals: error - Use===not==noEmptyBlockStatements: warn - Flag empty blocksnoImplicitAnyLet: error - Require types forletnoShadowRestrictedNames: error - Don't shadow globals
Performance:
noAccumulatingSpread: warn - Avoid spread in loopsnoDelete: warn - Preferundefinedoverdelete
Security:
noDangerouslySetInnerHtml: error - Prevent XSS vectors
Uses tsgo for fast TypeScript checking with strict settings.
- Create a new directory:
mkdir my-extension - Add
index.tswith the extension code - Optionally add:
README.md- Documentation*.schema.json- JSON Schema for config validation*.example.json- Example configuration
See the pi extension documentation for the full API.
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
export default function (pi: ExtensionAPI) {
// Subscribe to events
pi.on("session_start", async (_event, ctx) => {
if (ctx.hasUI) {
ctx.ui.notify("Extension loaded!", "info");
}
});
// Register commands
pi.registerCommand("my-command", {
description: "Do something",
handler: async (args, ctx) => {
ctx.ui.notify(`Args: ${args}`, "info");
},
});
}To use these extensions with pi:
# Global installation (all projects)
cp -r <extension-name> ~/.pi/agent/extensions/
# Or project-local
cp -r <extension-name> .pi/extensions/
# Or symlink for development
ln -s $(pwd)/<extension-name> ~/.pi/agent/extensions/<extension-name>MIT