- before_agent_start handlers can return systemPromptAppend to dynamically append text to the system prompt for that turn - Multiple hooks' systemPromptAppend strings are concatenated - Multiple hooks' messages are now all injected (not just first) - Tool registry now contains ALL built-in tools (read, bash, edit, write, grep, find, ls) regardless of --tools flag - --tools only sets initially active tools, hooks can enable any via setActiveTools() - System prompt automatically rebuilds when tools change, updating tool descriptions and guidelines - Add pirate.ts example hook demonstrating systemPromptAppend - Update hooks.md with systemPromptAppend documentation |
||
|---|---|---|
| .github/workflows | ||
| .husky | ||
| packages | ||
| scripts | ||
| .gitignore | ||
| AGENTS.md | ||
| biome.json | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| pi-mono.code-workspace | ||
| README.md | ||
| todo.md | ||
| tsconfig.base.json | ||
| tsconfig.json | ||
Pi Monorepo
Looking for the pi coding agent? See packages/coding-agent for installation and usage.
Tools for building AI agents and managing LLM deployments.
Packages
| Package | Description |
|---|---|
| @mariozechner/pi-ai | Unified multi-provider LLM API (OpenAI, Anthropic, Google, etc.) |
| @mariozechner/pi-agent-core | Agent runtime with tool calling and state management |
| @mariozechner/pi-coding-agent | Interactive coding agent CLI |
| @mariozechner/pi-mom | Slack bot that delegates messages to the pi coding agent |
| @mariozechner/pi-tui | Terminal UI library with differential rendering |
| @mariozechner/pi-web-ui | Web components for AI chat interfaces |
| @mariozechner/pi-pods | CLI for managing vLLM deployments on GPU pods |
Development
Setup
npm install # Install all dependencies
npm run build # Build all packages
npm run check # Lint, format, and type check
Note:
npm run checkrequiresnpm run buildto be run first. The web-ui package usestscwhich needs compiled.d.tsfiles from dependencies.
CI
GitHub Actions runs on push to main and on pull requests. The workflow runs npm run check and npm run test for each package in parallel.
Do not add LLM API keys as secrets to this repository. Tests that require LLM access use describe.skipIf() to skip when API keys are missing. This is intentional:
- PRs from external contributors would have access to secrets in the CI environment
- Malicious PR code could exfiltrate API keys
- Tests that need LLM calls are skipped on CI and run locally by developers who have keys configured
If you need to run LLM-dependent tests, run them locally with your own API keys.
Development
Start watch builds for all packages:
npm run dev
Then run with tsx:
cd packages/coding-agent && npx tsx src/cli.ts
cd packages/pods && npx tsx src/cli.ts
Versioning (Lockstep)
All packages MUST always have the same version number. Use these commands to bump versions:
npm run version:patch # 0.7.5 -> 0.7.6
npm run version:minor # 0.7.5 -> 0.8.0
npm run version:major # 0.7.5 -> 1.0.0
These commands:
- Update all package versions to the same number
- Update inter-package dependency versions (e.g.,
pi-agentdepends onpi-ai@^0.7.7) - Update
package-lock.json
Never manually edit version numbers. The lockstep system ensures consistency across the monorepo.
Publishing
npm run release:patch # Bug fixes
npm run release:minor # New features
npm run release:major # Breaking changes
This handles version bump, CHANGELOG updates, commit, tag, publish, and push.
NPM Token Setup: Requires a granular access token with "Bypass 2FA on publish" enabled.
- Go to https://www.npmjs.com/settings/badlogic/tokens/
- Create a new "Granular Access Token" with "Bypass 2FA on publish"
- Set the token:
npm config set //registry.npmjs.org/:_authToken=YOUR_TOKEN
License
MIT