pi-compact-ui

Compact tree-shaped reasoning and tool-call UI for the Pi Coding Agent

Packages

Package details

extension

Install pi-compact-ui from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-compact-ui
Package
pi-compact-ui
Version
0.1.3
Published
Sep 4, 2026
Downloads
193/mo · 193/wk
Author
geoffreychen777
License
unknown
Types
extension
Size
68.9 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

compact-ui

A quiet, structured home for Pi's reasoning and tool calls

Pi Extension TypeScript TUI

Preview

The collapsed view shows at most three lines by default:

⠋ tool calling...
│  ✓ bash: npm test (3.2s)
└  · thinking: Checking the failing assertion… · ≈1.2K tok

Expand the group to inspect tool arguments, result previews, and more of the reasoning content:

✓ tool calling
│
├─ ✓ read: src/auth.ts (0.1s)
│  └─ export async function authenticate() { … }
│
├─ ✓ edit: src/auth.ts (0.2s)
│  └─ Updated src/auth.ts
│
└─ · thinking · 1.2K tok
   └─ The validation path now handles expired sessions…

Features

  • Combines consecutive reasoning and tool calls into a single visual group.
  • Removes Pi's native hidden-thinking placeholder components so an empty thinking label cannot leave phantom blank rows in the transcript.
  • Supports streaming reasoning, streaming tool output, and parallel tool calls.
  • Displays tool state, argument summaries, elapsed time, and result previews.
  • Shows reasoning-token usage. During streaming it uses an estimate, then prefers provider-reported usage when available.
  • Follows Pi's standard Ctrl+O expand and collapse behavior.
  • Renders fenced code blocks as subtle theme-aware background panels with syntax highlighting and one character of horizontal padding instead of decorative top and bottom border rows.
  • Preserves Pi's native execution semantics for read, bash, edit, write, find, grep, and ls.
  • Gives compaction summaries a distinct, compact presentation.

Installation

pi install npm:pi-compact-ui

Reload Pi:

/reload

You can also load a local checkout temporarily:

pi -e ./compact-ui/index.ts

Configuration

Open the interactive settings menu:

/compact-ui-config

Available settings:

Setting Default Purpose
collapsedMaxLines 3 Maximum lines shown while a group is collapsed
expandedToolLines 5 Result-preview lines shown for each expanded tool
expandedThinkingLines 10 Reasoning-preview lines shown while expanded

The configuration is stored at:

~/.pi/agent/compact-ui.json

Example:

{
  "collapsedMaxLines": 3,
  "expandedToolLines": 5,
  "expandedThinkingLines": 10
}

Controls

Action Key
Expand or collapse reasoning and tool groups Ctrl+O
Move through the settings menu Up / Down
Adjust a numeric value Left / Right, - / +
Save a setting Enter
Close the settings menu Esc

How It Works

compact-ui combines Pi's Assistant Message, Thinking, and Tool Execution components at the presentation layer. It does not change the original messages sent to the model or alter tool results.

Its main responsibilities are:

  1. Capture reasoning blocks from the active assistant message.
  2. Track consecutive and parallel tool calls.
  3. Combine them into a tree component with shared state.
  4. Seal the active group when visible assistant text begins, preserving clear message boundaries.

[!NOTE] compact-ui overrides the registration of several built-in tools so it can control their presentation. Actual execution is still delegated to Pi's native tool implementations.