- Added `pi update` command for checking and installing CLI updates from GitHub releases or bun. - Added cross-platform installer scripts (shell and PowerShell) with automatic PATH configuration. - Changed HTML export to use compile-time bundled templates via Bun macros. - Changed `exportToHtml` and `exportFromFile` functions to async operations.
AI coding agent for the terminal
Fork of badlogic/pi-mono by @mariozechner
Installation
Via Bun (recommended)
Requires Bun runtime:
bun install -g @oh-my-pi/pi-coding-agent
Via installer script
Linux / macOS:
curl -fsSL https://raw.githubusercontent.com/can1357/oh-my-pi/main/scripts/install.sh | sh
Windows (PowerShell):
irm https://raw.githubusercontent.com/can1357/oh-my-pi/main/scripts/install.ps1 | iex
Manual download
Download binaries directly from GitHub Releases.
+ LSP Integration (Language Server Protocol)
Full IDE-like code intelligence with automatic formatting and diagnostics:
- Format-on-write: Auto-format code using the language server's formatter (rustfmt, gofmt, prettier, etc.)
- Diagnostics on write/edit: Immediate feedback on syntax errors and type issues after every file change
- Workspace diagnostics: Check entire project for errors (
lsp action=workspace_diagnostics) - 40+ language configs: Out-of-the-box support for Rust, Go, Python, TypeScript, Java, Kotlin, Scala, Haskell, OCaml, Elixir, Ruby, PHP, C#, Lua, Nix, and many more
- Local binary resolution: Auto-discovers project-local LSP servers in
node_modules/.bin/,.venv/bin/, etc. - Hover docs, symbol references, code actions, workspace-wide symbol search
+ Task Tool (Subagent System)
Parallel execution framework with specialized agents and real-time streaming:
- 5 bundled agents: explore, plan, browser, task, reviewer
- Parallel exploration: Reviewer agent can spawn explore agents for large codebase analysis
- Real-time artifact streaming: Task outputs stream as they're created, not just at completion
- Output tool: Read full agent outputs by ID when truncated previews aren't sufficient
- User-level (
~/.pi/agent/agents/) and project-level (.pi/agents/) custom agents - Concurrency-limited batch execution with progress tracking
+ Model Roles
Configure different models for different purposes with automatic discovery:
- Three roles:
default(main model),smol(fast/cheap),slow(comprehensive reasoning) - Auto-discovery: Smol finds haiku → flash → mini; Slow finds codex → gpt → opus → pro
- Role-based selection: Task tool agents can use
model: pi/smolfor cost-effective exploration - CLI args (
--smol,--slow) and env vars (PI_SMOL_MODEL,PI_SLOW_MODEL) - Configure via
/modelselector with keybindings (Enter=default, S=smol, L=slow)
+ Ask Tool (Interactive Questioning)
Structured user interaction with typed options:
- Multiple choice questions: Present options with descriptions for user selection
- Multi-select support: Allow multiple answers when choices aren't mutually exclusive
+ Interactive Code Review
Structured code review with priority-based findings:
/reviewcommand: Interactive mode selection (branch comparison, uncommitted changes, commit review)- Structured findings:
report_findingtool with priority levels (P0-P3: critical → nit) - Verdict rendering:
submit_reviewaggregates findings into approve/request-changes/comment - Combined result tree showing verdict and all findings
+ Custom TypeScript Slash Commands
Programmable commands with full API access:
- Create at
~/.pi/agent/commands/[name]/index.tsor.pi/commands/[name]/index.ts - Export factory returning
{ name, description, execute(args, ctx) } - Full access to
HookCommandContextfor UI dialogs, session control, shell execution - Return string to send as LLM prompt, or void for fire-and-forget actions
- Also loads from Claude Code directories (
~/.claude/commands/,.claude/commands/)
+ MCP & Plugin System
Full Model Context Protocol support with external tool integration:
- Stdio and HTTP transports for connecting to MCP servers
- Plugin CLI (
pi plugin install/enable/configure/doctor) - Hot-loadable plugins from
~/.pi/plugins/with npm/bun integration - Automatic Exa MCP server filtering with API key extraction
+ Web Search & Fetch
Multi-provider search and full-page scraping:
- Anthropic, Perplexity, and Exa search integration with caching
- HTML-to-markdown conversion with link preservation
- JavaScript rendering support, image handling
+ TUI Overhaul
Modern terminal interface with smart session management:
- Auto session titles: Sessions automatically titled based on first message using smol model
- Welcome screen: Logo, tips, recent sessions with selection
- Powerline footer: Model, cwd, git branch/status, token usage, context %
- LSP status: Shows which language servers are active and ready
- Hotkeys:
?displays shortcuts when editor empty - Emergency terminal restore: Crash handlers prevent terminal corruption
+ Edit Fuzzy Matching
Handles whitespace and indentation variance automatically:
- High-confidence fuzzy matching for
oldTextin edit operations - Fixes the #1 pain point: edits failing due to invisible whitespace differences
- Configurable via
edit.fuzzyMatchsetting (enabled by default)
... and many more
- Git context: System prompt includes branch, status, recent commits
- Bun runtime: Native TypeScript execution, faster startup, all packages migrated
- Centralized file logging: Debug logs with daily rotation to
~/.pi/logs/ - Clipboard export:
/export --copycopies session as formatted text - Bash interceptor: Optionally block shell commands that have dedicated tools
- Hidden tools: Custom tools can be excluded from default list unless explicitly requested
- @file auto-read: Type
@path/to/filein prompts to inject file contents inline - Additional tools: AST (structural code analysis), Replace (find & replace across files)
Packages
| Package | Description |
|---|---|
| @oh-my-pi/pi-ai | Unified multi-provider LLM API (OpenAI, Anthropic, Google, etc.) |
| @oh-my-pi/pi-agent-core | Agent runtime with tool calling and state management |
| @oh-my-pi/pi-coding-agent | Interactive coding agent CLI |
| @oh-my-pi/pi-mom | Slack bot that delegates messages to the pi coding agent |
| @oh-my-pi/pi-tui | Terminal UI library with differential rendering |
| @oh-my-pi/pi-web-ui | Web components for AI chat interfaces |
Development
Setup
bun run dev:install # Install deps and link all packages
bun run build # Build all packages
bun run check # Lint, format, and type check
Note:
bun run checkrequiresbun run buildfirst. The web-ui package usestscwhich needs compiled.d.tsfiles from dependencies.
Watch Mode
bun run dev
Then run directly:
cd packages/coding-agent && bunx tsx src/cli.ts
CI
GitHub Actions runs on push to main and on pull requests. The workflow runs bun run check and bun test for each package in parallel.
Do not add LLM API keys as secrets. Tests requiring LLM access use describe.skipIf() and run locally.
Versioning
All packages use lockstep versioning:
bun run version:patch # 0.7.5 -> 0.7.6
bun run version:minor # 0.7.5 -> 0.8.0
bun run version:major # 0.7.5 -> 1.0.0
Never manually edit version numbers.
Publishing
bun run release:patch # Bug fixes
bun run release:minor # New features
bun run release:major # Breaking changes
Requires an npm token with "Bypass 2FA on publish" enabled.
License
MIT - Original work copyright Mario Zechner








