← Catalog

pi-compact-ui

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

Extension

Install

Install with PiG

pig install npm:pi-compact-ui

Install with Pi

pi install npm:pi-compact-ui
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.3 (README.md). PiG does not review it.

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:

SettingDefaultPurpose
collapsedMaxLines3Maximum lines shown while a group is collapsed
expandedToolLines5Result-preview lines shown for each expanded tool
expandedThinkingLines10Reasoning-preview lines shown while expanded

The configuration is stored at:

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

Example:

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

Controls

ActionKey
Expand or collapse reasoning and tool groupsCtrl+O
Move through the settings menuUp / Down
Adjust a numeric valueLeft / Right, - / +
Save a settingEnter
Close the settings menuEsc

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.