A multi-tab, terminal-native AI coding agent fully compatible with the Pi extension ecosystem. Pi is an open, extensible terminal AI coding agent; MixCode runs its entire package ecosystem natively.
Why MixCode Pi? Standard AI coding agents lock your terminal to a single session; you cannot explore, review, or run parallel tasks while the model is thinking. MixCode adds native multi-tab concurrency, Agent Tab collaboration, and full Pi extension compatibility: run multiple agents side by side, send work between tabs, organize workspaces across restarts, and use the full Pi package catalog (
npm:…, tools, widgets, and commands).
- Native multi-tab concurrency. Run multiple agent sessions side by side with live status indicators.
- Agent Tab collaboration. Tabs send each other prompts, wait, and collect replies (
mpi ctl). - Pi extension compatibility. Runs the full Pi package catalog plus first-party
mpi-*extensions. - Zen & inline modes. Hide chrome for a distraction-free view, or move widgets into the chat stream.
- Mobile & touch optimized. Narrow terminals, split panes, and touch-friendly SSH clients (Termux, iOS Blink).
- Terminal-first workflow. Vim-style transcript navigation, command palette,
$skill/@file/@tabautocomplete. - Declarative batch automation. Script multi-agent workflows in Lua or TypeScript, with dry-run validation.
Requires Bun. Install via clone and build script:
git clone https://github.com/cyril0124/mixcode-pi.git
cd mixcode-pi
./install.sh
mpiOr run bun run install:global inside the cloned directory if you prefer linking the development source. Ensure ~/.local/bin (or ~/.bun/bin for linked source) is on your PATH. Upgrade via git pull && ./install.sh.
Models and credentials use Pi's standard config: ~/.pi/agent/models.json (models & custom endpoints) and auth.json (API keys). For built-in providers just run /login inside mpi (or pi) and authenticate via subscription OAuth or an API key; no manual config needed. Credentials are shared with Pi, so an existing Pi setup is picked up as-is; see Model Management.
Run isolated agent sessions side by side. Switch with Tab / Shift+Tab or fuzzy jump via Ctrl+T; background tabs show live status indicators (● running, ✓ unread, x error). Each tab maintains an independent conversation tree, tool runtime, and working directory. Workspaces persist tab layouts across restarts, while atomic file locks (open_tabs.json.lock) coordinate tabs across multiple terminal windows or tmux panes.
Tabs talk to each other, in the same TUI or another mpi, without stealing the keyboard. One tab delegates a review or verification to a peer, waits, and reads the reply. The built-in mpi-ctl skill exposes mpi status / mpi ctl to the agent's bash tool. CLI loop: Agent Tab Collaboration.
Install community extensions directly through Pi package declarations (settings.json packages, e.g. npm:pi-web-access), including custom tools, widgets, and themes, or use MixCode's first-party mpi-* tools:
mpi-goal: Long-running goal tracking with dynamic progressive tool loading.mpi-diff-viewer: In-terminal visual diffs with line-level review comments (/diff).mpi-loop: Recurring prompt scheduling with conflict handling (/loop 5m /review).mpi-optimize-prompt: Metaprompt-based prompt expansion.mpi-auto-rename: Context-derived session titles (/auto-rename).mpi-ctl: Multi-agent / cross-tab collaboration (mpi status,mpi ctl).mpi-permission: Fine-grained tool execution permission rules (/permission).mpi-transcript: View effective LLM context, chatlog, thinking, and latest replies in nvim, vim, or the in-app viewer; configure with/transcript config.mpi-prompt-history: Prompt recall log and interactive browser (/prompt-history).mpi-tool-block: Selectively hide tools from model context (/tool-block).mpi-tool-display: Compact terminal transcript presentation for tools and thinking.mpi-model-attach: Add or remove skills and load extra extensions for the current model (/model-attach).mpi-skill-refs:$skillautocomplete and prompt expansion.mpi-stuck-guard: Guards oversized recursive searches, repeated identical tool calls, stalled provider streams, and repeated parameter-validation failures. Configuration and statistics:/stuck-guard config,/stuck-guard stats.mpi-herdr-report: Real-time status reporting to Herdr agent panes (HERDR_ENV=1).mpi-bash: Default bash timeout plus a foreground window that detaches long commands to the background and reports their exit code when they finish;/bash-logsopens any background command's full log.
Switch dynamically between docked editor widgets and inline chat-stream widgets using /toggle-inline-widgets. In inline mode, widgets follow transcript scrolling rather than taking up fixed vertical editor space.
Treat the conversation transcript as a Vim buffer: scroll line-by-line (j/k), page with Ctrl+U / Ctrl+D, and jump between milestone user turns (Right / Shift+Right). Enter via /vim or empty-queue Ctrl+U then u. Leave with q.
Hide the top tab bar for a distraction-free view (/toggle-zen-mode). Background agents with notable state changes (running, waiting for input, error, done) render as compact status dots (●) on the top border.
Type $ in the prompt editor to trigger fuzzy autocomplete for project, global, and installed package skills, automatically embedding skill instructions into the prompt payload.
Press Ctrl+P to fuzzy search and execute slash commands, model switches, and extension actions for the current tab context.
Core keys only. Open Help or the Command Palette in-app for the full map:
| Key | Scope | Action | Description |
|---|---|---|---|
Tab / Shift+Tab |
Global | Next / Previous Tab | Cycle tabs. No-op when autocomplete is open or Zen mode is on (use Ctrl+T). |
Ctrl+P |
Global | Command Palette | Fuzzy search and run slash commands. |
Ctrl+T |
Global | Tab Jump | Interactive modal to jump to any open tab. |
Ctrl+G |
Global | External Editor | Edit current draft in $VISUAL / $EDITOR. |
Ctrl+Q |
Global | Quit | Safely persists workspace state and exits. |
Ctrl+U |
Input / Queue | Dequeue / Choose / Vim | Pops the sole non-empty queue; when both contain messages, use Ctrl+U,S/F; when empty, arms Vim entry. See queue management. |
Right |
Empty Input | Side Panel | Toggle right-hand extension widget panel. |
Escape |
Global | Smart Escape | Close overlay → abort/retract prompt. |
! |
Editor | Bash Command | Single-line shell execution mode. |
$ |
Editor | Skill Autocomplete | Trigger project, global, and installed package skill completion. |
@ |
Editor | File / Tab Autocomplete | Complete workspace file paths and peer tab titles. |
git clone https://github.com/cyril0124/mixcode-pi.git
cd mixcode-pi
./install.sh # standalone binary → ~/.local/bin/mpi
./install.sh --prefix /opt/mixcodeUpgrade by running git pull && ./install.sh in the repository directory.
bun run install:global # global `mpi` linked from this repo./install.shcompiles a single standalone binary (bun build --compile); nonode_modulesneeded at runtime.bun run install:globalruns from this repository via the linked Bun runtime.
For release builds, use the Bun version pinned in the release workflow. ./release.sh installs from the frozen lockfile, prefers cached packages, and downloads missing packages. Run ./release.sh --help for target and output options.
mpi # Start in current directory
mpi --workdir ~/project # Start in specific directory
mpi --builtin-extensions-only # Disable 3rd-party packages; load only mpi-*
mpi --batch script.ts # Run batch automation script (.lua or .ts)
mpi status # Inspect running instances and tab statesAn agent tab drives its own TUI, or any other mpi, with mpi status / mpi ctl. Send a prompt or slash command to a peer tab, wait for completion, read the result. Target another directory with --pid / --workdir.
Typical uses:
- Hand a review, a question, or a long job to another tab and read the reply.
- Split independent work across tabs and collect the results.
- Talk to a tab in another
mpiinstance (--pid/--workdir).
mpi status --json # List live instances, tabs, states
mpi ctl --tab Agent-01 send-prompt '/compact'
mpi ctl --workdir ~/other-proj --tab Reviewer send-prompt 'review the diff'
mpi ctl --tab Agent-01 wait && mpi ctl --tab Agent-01 last-messageThis is how mpi develops mpi: one tab delegates review or verification tasks to tabs of other instances and collects their replies. Full command reference: pi-packages/mpi-ctl-skill/skills/mpi-ctl/SKILL.md. At runtime the skill is installed at <agentDir>/extensions/mpi-ctl-skill/skills/mpi-ctl/SKILL.md, ~/.pi/agent/… by default.
Inspired by Herdr, a terminal multiplexer for coding agents that exposes session control to the agents running inside it.
Full architectural specifications, guides, and manuals are available in the docs/ directory:
- System Architecture
- TUI Components & Layout
- Multi-Tab Workspaces
- Model Management
- Steering & Follow-up Queues
- Zen Mode
- Inline Widgets Mode
- Vim Mode & Navigation
- Batch Script Automation
- Pi Extension Compatibility
- Slash Commands Reference
- MixCode Settings
- Environment Variables
- Instance Registry & Monitoring
This is an AI-developed project. My daily development now happens entirely in mpi, including developing mpi itself. The code quality may be poor, but please experience mpi for yourself.
Not interested in this project? Take a look at pi-packages/ instead, a set of high-quality Pi extensions that also work on plain Pi.
Licensed under the MIT License.
- Pi by Mario Zechner (earendil-works/pi). MixCode is built on Pi's agent core, extension system, and TUI toolkit (
pi-coding-agent,pi-tui,pi-ai,pi-agent-core). Its clean SDK and open extension ecosystem are what make a project like this possible.






