One command to supercharge pi-coding-agent.
Like oh-my-zsh for pi β but with an autonomous ant colony.
npx oh-pinpx oh-pi # configure everything
pi # start codingoh-pi auto-detects your environment, guides setup in a modern TUI, and writes ~/.pi/agent/ for you.
Already configured? It detects existing files and offers backup before overwriting.
pi-coding-agent is powerful by default, but manual setup across providers, themes, extensions, skills, and prompts is slow. oh-pi compresses that setup into under a minute β then adds an ant colony swarm for multi-agent execution.
Want the fast walkthrough? See docs/DEMO-SCRIPT.md.
Use plain pi workflows (without colony) when your task is tiny, highly exploratory, or needs constant human steering.
For positioning, scope, and milestones, see ROADMAP.md. For rationale behind key trade-offs, see DECISIONS.md.
~/.pi/agent/
βββ auth.json API keys (0600 permissions)
βββ settings.json Model, theme, thinking level
βββ keybindings.json Vim/Emacs shortcuts (optional)
βββ AGENTS.md Role-specific AI guidelines
βββ extensions/ 8 extensions (7 default + ant-colony)
β βββ safe-guard Dangerous command confirmation + path protection
β βββ git-guard Auto stash checkpoints + dirty repo warning
β βββ auto-session Session naming from first message
β βββ custom-footer Enhanced status bar (token/cost/time/git/cwd)
β βββ compact-header Streamlined startup info
β βββ auto-update Check for updates on launch
β βββ bg-process β³ **Bg Process** β Auto-background long-running commands (dev servers, etc.)
β βββ ant-colony/ π Autonomous multi-agent swarm (optional)
βββ prompts/ 10 templates (/review /fix /commit /test ...)
βββ skills/ 11 skills (tools + UI design + workflows)
βββ themes/ 6 custom themes
| Mode | Steps | For |
|---|---|---|
| π Quick | 3 | Pick provider β enter key β done |
| π¦ Preset | 2 | Choose a role profile β enter key |
| ποΈ Custom | 6 | Pick everything yourself |
| Theme | Thinking | Includes | |
|---|---|---|---|
| β« Full Power | oh-pi Dark | high | All extensions + bg-process + ant-colony |
| π΄ Clean | Default | off | No extensions, just core |
| π Colony Only | oh-pi Dark | medium | Ant-colony with minimal setup |
Anthropic Β· OpenAI Β· Google Gemini Β· Groq Β· OpenRouter Β· xAI Β· Mistral Β· FOXNIO (recommended public-benefit Claude provider)
Auto-detects API keys from environment variables.
The headline feature. A multi-agent swarm modeled after real ant ecology β deeply integrated into pi's SDK.
You: "Refactor auth from sessions to JWT"
oh-pi:
π Scout ants explore codebase (haiku β fast, cheap)
π Task pool generated from discoveries
βοΈ Worker ants execute in parallel (sonnet β capable)
π‘οΈ Soldier ants review all changes (sonnet β thorough)
β
Done β report auto-injected into conversation
- Planning Recovery Loop: if scouts return unstructured intel, colony enters
planning_recoveryinstead of failing immediately. - Plan Validation Gate: before workers start, tasks are validated (title/description/caste/priority).
- Scout Quorum for complex goals: multi-step goals default to at least 2 scouts for better planning reliability.
SCOUTING β (if needed) PLANNING_RECOVERY β WORKING β REVIEWING β DONE
Each ant is an in-process AgentSession (pi SDK), not a child process:
pi (main process)
ββ ant_colony tool
ββ queen.ts β runColony()
ββ spawnAnt() β createAgentSession()
ββ session.subscribe() β real-time token stream
ββ Zero startup overhead (shared process)
ββ Shared auth & model registry
Interactive mode: Colony runs in the background β you keep chatting. A live widget shows ant progress, and results are auto-injected when done.
Print mode (pi -p): Colony runs synchronously, blocks until complete.
Real ant colonies solve complex problems without central control. Each ant follows simple rules, communicates through pheromone trails, and the colony self-organizes. oh-pi maps this directly:
| Real Ants | oh-pi |
|---|---|
| Scout finds food | Scout scans codebase, identifies targets |
| Pheromone trail | .ant-colony/pheromone.jsonl β shared discoveries |
| Worker carries food | Worker executes task on assigned files |
| Soldier guards nest | Soldier reviews changes, requests fixes |
| More food β more ants | More tasks β higher concurrency (auto-adapted) |
| Pheromone evaporates | 10-minute half-life β stale info fades |
In interactive mode, the colony shows live progress:
- Status bar β compact footer with real metrics: tasks done, active ants, tool calls, output tokens, cost, elapsed time
- Ctrl+Shift+A β overlay detail panel with task list, active ant streams, and colony log
- Notification β completion summary when done
Use /colony-stop to abort a running colony.
The colony communicates with the main conversation via structured signals, so the model never has to guess background state. Updates are passively pushed (non-blocking), so polling is optional:
| Signal | Meaning |
|---|---|
COLONY_SIGNAL:LAUNCHED |
Colony started in background |
COLONY_SIGNAL:SCOUTING |
Scout wave is exploring / planning |
COLONY_SIGNAL:PLANNING_RECOVERY |
Plan recovery loop is restructuring tasks |
COLONY_SIGNAL:WORKING |
Worker phase is executing tasks |
COLONY_SIGNAL:REVIEWING |
Soldier review phase is active |
COLONY_SIGNAL:TASK_DONE |
A task finished (progress checkpoint) |
COLONY_SIGNAL:COMPLETE |
Colony finished and report injected |
COLONY_SIGNAL:FAILED |
Colony failed with diagnostics |
COLONY_SIGNAL:BUDGET_EXCEEDED |
Budget limit reached |
Each ant has a strict turn budget to prevent runaway execution:
Scout: 8 turns Β· Worker: 15 turns Β· Soldier: 8 turns
The colony auto-detects available models and lets the LLM pick the best fit per role:
| Role | Strategy | Example |
|---|---|---|
| Scout | Fast & cheap β only reads, no edits | claude-haiku-4-5, gpt-4o-mini |
| Worker | Capable β makes code changes | claude-sonnet-4-0, gpt-4o |
| Soldier | Same as worker or slightly cheaper | claude-sonnet-4-0 |
Omit model overrides to use the current session model for every ant.
The colony tracks cost per ant and total spend, reported in the final summary. Cost never interrupts execution β turn limits and concurrency control handle resource management.
The LLM decides when to deploy the colony. You don't have to think about it:
- β₯3 files need changes β colony
- Parallel workstreams possible β colony
- Single file change β direct execution (no colony overhead)
The colony automatically finds the optimal parallelism for your machine:
Cold start β ceil(max/2) ants (fast ramp-up)
Exploration β +1 each wave, monitoring throughput
Throughput β β lock optimal, stabilize
CPU > 85% β reduce immediately
429 rate limit β -1 concurrency + backoff (2sβ5sβ10s cap)
Tasks done β scale down to minimum
One ant per file. Always. Conflicting tasks are automatically blocked and resume when locks release.
oh-pi ships 11 skills in three categories.
Zero-dependency Node.js scripts β no API keys needed.
| Skill | What it does |
|---|---|
context7 |
Query latest library docs via Context7 API |
web-search |
DuckDuckGo search (free, no key) |
web-fetch |
Extract webpage content as plain text |
# Examples
./skills/context7/search.js "react"
./skills/web-search/search.js "typescript generics" -n 5
./skills/web-fetch/fetch.js https://example.comComplete design specs with CSS tokens, component examples, and design principles. The agent loads these when you ask for a specific visual style.
| Skill | Style | CSS Prefix |
|---|---|---|
liquid-glass |
Apple WWDC 2025 translucent glass | --lg- |
glassmorphism |
Frosted glass blur + transparency | --glass- |
claymorphism |
Soft 3D clay-like surfaces | --clay- |
neubrutalism |
Bold borders, offset shadows, high contrast | --nb- |
Each includes references/tokens.css with ready-to-use CSS custom properties.
You: "Build a dashboard with liquid glass style"
pi loads liquid-glass skill β applies --lg- tokens, glass effects, specular highlights
| Skill | What it does |
|---|---|
quick-setup |
Detect project type, generate .pi/ config |
debug-helper |
Error analysis, log interpretation, profiling |
git-workflow |
Branching, commits, PRs, conflict resolution |
ant-colony |
Colony management commands and strategies |
| π oh-pi Dark | Cyan + purple, high contrast |
| π Cyberpunk | Neon magenta + electric cyan |
| π Nord | Arctic blue palette |
| π Catppuccin Mocha | Pastel on dark |
| π Tokyo Night | Blue + purple twilight |
| π Gruvbox Dark | Warm retro tones |
/review Code review: bugs, security, performance
/fix Fix errors with minimal changes
/explain Explain code, simple to detailed
/refactor Refactor preserving behavior
/test Generate tests
/commit Conventional Commit message
/pr Pull request description
/security OWASP security audit
/optimize Performance optimization
/document Generate documentation
| Template | Focus |
|---|---|
| General Developer | Universal coding guidelines |
| Full-Stack Developer | Frontend + backend + DB |
| Security Researcher | Pentesting & audit |
| Data & AI Engineer | MLOps & pipelines |
| π Colony Operator | Multi-agent orchestration |
Skip the configurator, just install the resources:
pi install npm:oh-piAdds all themes, prompts, skills, and extensions to your existing pi setup.
- Node.js β₯ 20
- At least one LLM API key
- pi-coding-agent (installed automatically if missing)
MIT