Pi extensions repo. Do not commit changes to git automatically.
- Run
pnpm installbefore development - Extensions live in
extensions/<name>/index.ts - To develop an extension locally, run
pi -e ./extensions/<name>/
- All tests must be written in an integration style: mock the pi API and simulate how the pi object interacts with the extension handler. Fire pi lifecycle events from the pi object and fire user key presses from the ctx.ui object. Only import extension components and test them directly as a last resort.
- All tests must pass: run
pnpm testafter changes and fix errors - All code must compile: run
pnpm run typecheckand fix any errors - All code must pass linting: run
pnpm run lintand fix any errors - After every change, run
pnpm run formatto reformat all files with Prettier - Use conventional commits:
feat(git): ...,fix(git): ...,docs: ...,chore: ... - Update the README table when adding extensions
- Peer deps (
@mariozechner/pi-coding-agent,@mariozechner/pi-tui,@sinclair/typebox): useimport type, never bundle - Never catch and ignore errors unless they are expected; report all caught errors in a log or in the UI.
- Never put unimportant implementation details or narration in README files
- always write a failing test before fixing a bug or implementing a new feature
- do not add tests for static configuration such as UI layout that is not dynamic
- only add regression tests for bug fixes
- if you're making an intentional behavioral change, you don't need to assert that the old behavior no longer exists