Stage 2

TUI Polish & Theming

2025-11-12 — 2025-11-27 v0.6.0 → v0.10.0 197 commits 6 contributors
cli agent-runtime devex ecosystem tui

Zeitgeist

Between v0.6.0 and v0.10.0 (November 18-27, 2025), pi crossed a threshold from prototype to product. The 197 commits in this stage share a unifying concern: making pi feel like a real application rather than a clever hack. A theming system meant users could live in pi all day without eye strain. Fuzzy file search meant they could navigate projects without leaving the editor. Model cycling with thinking level controls meant they could adapt the agent's behavior on the fly. And the arrival of Mom as a fully operational Slack bot proved that the agent runtime was genuinely portable -- the same core could power both a terminal and a chat platform.

This was also the stage where pi began attracting external contributions and the project's development conventions crystallized. AGENTS.md appeared at v0.10.0 for the first time, codifying rules that had previously been implicit: no any types, no inline imports, never run npm run dev, always run npm run check. The document also instructed the agent to read the root README first, then ask which module to work on -- a pattern that treated the coding agent as the project's primary developer interface. Pi was not just being built with AI; it was being built for AI to build it.

Key Developments

The Theming System

Commit cc880951 ("WIP: Add theming system with /theme command") introduced a JSON-based theming architecture with 39 distinct color tokens organized into semantic groups: core UI (10 colors), backgrounds and content (7), markdown rendering (10), tool diffs (3), syntax highlighting (9), and thinking level borders (5). The ThemeJsonSchema in packages/coding-agent/src/theme/theme.ts used TypeBox for runtime validation, and themes supported variable references -- a color could reference another via name. Built-in dark.json and light.json shipped immediately. The theme system also supported hot-reloading: change the JSON file and the TUI updates live. This infrastructure later had to be disabled in print mode (7323af1f) because the file watcher blocked process exit.

Fuzzy File Search with @ Prefix

PR #60 (384e4a3a) added fuzzy file search triggered by typing @ in the editor. The implementation used fd under the hood for performance (a61eca5d), and a later fix (4de46fba) suppressed stderr from execSync calls to prevent the search subprocess from corrupting the TUI's rendering state. This was a small feature with outsized impact -- it turned pi's editor from a text box into a context-aware prompt builder where files could be referenced inline.

Model Cycling and Thinking Levels

What began as a simple --models parameter for cycling with Ctrl+P (fecf9734) evolved into a full thinking-level control system. Commit ea4e234f added thinking level support to model cycling, and ba8c073e extended this with a --thinking CLI flag. The design let users hold Shift+Tab to cycle through thinking levels (off, minimal, low, medium, high) without interrupting their workflow. This reflected a key insight: the right model configuration changes throughout a conversation -- initial exploration might use a fast model with no thinking, while a complex refactor demands a reasoning-heavy model.

Mom Slack Bot Maturation

Mom went from initial prototype to production-ready in this stage. The trajectory tells the story: basic Slack bot with abort support (aa9e0582), Docker sandbox isolation (f140f2e4), single accumulated messages per run (6117127b), thread-based tool details (30964e0c), working memory across sessions (4e01eca4), centralized logging with usage tracking (213bc4df), and a working indicator with stop command (0c6c0f34). Mom was explicitly told what environment she was in -- Docker vs host -- so she could adapt her behavior (9e0255b1). The scratchpad directory (f53e4fba) gave her persistent workspace for notes and intermediate files, treating the bot like a developer who needs a desk.

The /export Command and HTML Export

The /export command (e467a80b) generated self-contained HTML files from sessions, initially as a simple dump but quickly evolving through four refinements: matching the TUI's visual style exactly (6b496e00), adding click-to-expand and system prompt display (1b81d803), matching thinking level display (bb0b77af), and rendering edit tool diffs (cc6e4c7f). This was pi's first attempt at making conversations shareable outside the terminal.

Read-Only Exploration Tools

Commit 186169a8 added grep, find, and ls as first-class agent tools alongside the original four (read, write, edit, bash). The --tools flag let users restrict which tools were active, enabling read-only exploration modes. This was a philosophical shift: not every conversation needs write access, and constraining the agent's capabilities could make it more trustworthy for code review or investigation tasks.

Philosophy Shifts

The appearance of AGENTS.md at v0.10.0 marked pi's transition from a solo project to one with codified conventions. The document was addressed directly to the AI agent, not to human contributors -- instructions like "read README.md in full" and "ask the user which module(s) they want to work on" assumed the reader was an LLM. It also established a strict no-fluff style: "Keep your answers short and concise and to the point." A later commit (b348c254) added "no emojis, no fluff" to the style guide. The rename from pi-agent to pi-agent-core (e1856daf) to avoid npm naming conflicts hinted at growing awareness that this was public infrastructure, not just a personal tool.

The project also started loading context files hierarchically (812f2f43), walking up from the working directory to find AGENTS.md or CLAUDE.md files at each level. This monorepo-aware context loading meant pi could understand that packages/ai/ had different conventions from packages/tui/ -- a pattern that proved essential as the codebase grew.

Looking Forward

The theming system's color token architecture foreshadowed the settings consolidation in later stages -- by v0.29.0, individual commands like /theme and /thinking would merge into a unified /settings menu. Mom's self-managing nature (installing her own tools, writing her own scripts) planted the seed for the skills and extensions systems. And the --tools flag for restricting agent capabilities became the foundation for the plan-mode hook that would arrive in Stage 6, where read-only exploration became a first-class workflow with todo tracking and interactive execution.

Key changes

Fuzzy File Search (`@`)

Type `@` followed by a search term to fuzzy-search files and folders across your project. Respects `.gitignore` and skips hidden files. Directories are prioritized in results. Based on [PR #60](https://github.com/badlogic/pi-mono/pull/60) by [@fightbulc](https://github.com/fightbulc), reimplemented with pure Node.js for fast, dependency-free searching.

From the changelog

**Fuzzy File Search (`@`)**: Type `@` followed by a search term to fuzzy-search files and folders across your project. Respects `.gitignore` and skips hidden files. Directories are prioritized in results. Based on [PR #60](https://github.com/badlogic/pi-mono/pull/60) by [@fightbulc](https://github.com/fightbulc), reimplemented with pure Node.js for fast, dependency-free searching.

Added Anthropic Claude Opus 4.5 support

Added Anthropic Claude Opus 4.5 support

`/clear` Command

New slash command to reset the conversation context and start a fresh session. Aborts any in-flight agent work, clears all messages, and creates a new session file. ([#48](https://github.com/badlogic/pi-mono/pull/48))

From the changelog

**`/clear` Command**: New slash command to reset the conversation context and start a fresh session. Aborts any in-flight agent work, clears all messages, and creates a new session file. ([#48](https://github.com/badlogic/pi-mono/pull/48))

Model Cycling with Thinking Levels

The `--models` flag now supports thinking level syntax (e.g., `--models sonnet:high,haiku:low`). When cycling models with `Ctrl+P`, the associated thinking level is automatically applied. The first model in the scope is used as the initial model when starting a new session. Both model and thinking level changes are now saved to session and settings for persistence. ([#47](https://github.com/badlogic/pi-mono/pull/47))

From the changelog

**Model Cycling with Thinking Levels**: The `--models` flag now supports thinking level syntax (e.g., `--models sonnet:high,haiku:low`). When cycling models with `Ctrl+P`, the associated thinking level is automatically applied. The first model in the scope is used as the initial model when starting a new session. Both model and thinking level changes are now saved to session and settings for persistence. ([#47](https://github.com/badlogic/pi-mono/pull/47))

`--thinking` Flag

New CLI flag to set thinking level directly (e.g., `--thinking high`). Valid values: `off`, `minimal`, `low`, `medium`, `high`. Takes highest priority over all other thinking level sources. ([#45](https://github.com/badlogic/pi-mono/issues/45))

From the changelog

**`--thinking` Flag**: New CLI flag to set thinking level directly (e.g., `--thinking high`). Valid values: `off`, `minimal`, `low`, `medium`, `high`. Takes highest priority over all other thinking level sources. ([#45](https://github.com/badlogic/pi-mono/issues/45))

Theme System

Full theming support with 44 customizable color tokens. Two built-in themes (`dark`, `light`) with auto-detection based on terminal background. Use `/theme` command to select themes interactively. Custom themes in `~/.pi/agent/themes/*.json` support live editing - changes apply immediately when the file is saved. Themes use RGB hex values for consistent rendering across terminals. VS Code users: set `terminal.integrated.minimumContrastRatio` to `1` for proper color rendering. See [Theme Documentation](docs/theme.md) for details.

From the changelog

**Theme System**: Full theming support with 44 customizable color tokens. Two built-in themes (`dark`, `light`) with auto-detection based on terminal background. Use `/theme` command to select themes interactively. Custom themes in `~/.pi/agent/themes/*.json` support live editing - changes apply immediately when the file is saved. Themes use RGB hex values for consistent rendering across terminals. VS Code users: set `terminal.integrated.minimumContrastRatio` to `1` for proper color rendering. See [Theme Documentation](docs/theme.md) for details.

Message Queuing

You can now send multiple messages while the agent is processing without waiting for the previous response to complete. Messages submitted during streaming are queued and processed based on your queue mode setting. Queued messages are shown in a pending area below the chat. Press Escape to abort and restore all queued messages to the editor. Use `/queue` to select between "one-at-a-time" (process queued messages sequentially, recommended) or "all" (process all queued messages at once). The queue mode setting is saved and persists across sessions. ([#15](https://github.com/badlogic/pi-mono/issues/15))

From the changelog

**Message Queuing**: You can now send multiple messages while the agent is processing without waiting for the previous response to complete. Messages submitted during streaming are queued and processed based on your queue mode setting. Queued messages are shown in a pending area below the chat. Press Escape to abort and restore all queued messages to the editor. Use `/queue` to select between "one-at-a-time" (process queued messages sequentially, recommended) or "all" (process all queued messages at once). The queue mode setting is saved and persists across sessions. ([#15](https://github.com/badlogic/pi-mono/issues/15))

Tool Output Expansion

Press `Ctrl+O` to toggle between collapsed and expanded tool output display. Expands all tool call outputs (bash, read, write, etc.) to show full content instead of truncated previews. ([#31](https://github.com/badlogic/pi-mono/issues/31))

From the changelog

**Tool Output Expansion**: Press `Ctrl+O` to toggle between collapsed and expanded tool output display. Expands all tool call outputs (bash, read, write, etc.) to show full content instead of truncated previews. ([#31](https://github.com/badlogic/pi-mono/issues/31))

Issues closed (10)