pi-asterisk-tui

Polished Pi coding agent TUI: transcript collapse modes (native / per-tool / grouped / run lines), claude-hud style dashboard, telemetry, and bilingual settings.

Packages

Package details

extension

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

$ pi install npm:pi-asterisk-tui
Package
pi-asterisk-tui
Version
0.6.1
Published
Sep 22, 2026
Downloads
190/mo · 163/wk
Author
no_world
License
MIT
Types
extension
Size
400.7 KB
Dependencies
0 dependencies · 3 peers
Pi manifest JSON
{
  "image": "https://raw.githubusercontent.com/No-World/pi-asterisk-tui/main/assets/preview_dashboard_1.png",
  "extensions": [
    "./extensions/open-tui/index.ts"
  ]
}

Security note

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

README

pi-asterisk-tui

English | 简体中文

A Pi terminal experience where everything the model does folds into tidy lines — Claude Code style — plus a claude-hud style status dashboard.

preview

pi install npm:pi-asterisk-tui

Or from git (tracks main):

pi install git:github.com/No-World/pi-asterisk-tui

✻ Transcript

The transcript renders as answer text plus compressed activity lines. How much compresses is the compression mode (/*tui → Collapse):

Mode Rendering
native untouched pi rendering — no compression
single one line per tool (▸ bash · $ npm test), nothing merged
group-same consecutive same-type tools merge (✻ read 3 files); thinking merges its own ✻ Thought for 11s line — kinds never mix
group-all Claude-Code style: consecutive thinking + tools merge into one line (default)
✻ Thought for 19s, searched for 9 patterns, listed 1 directory, ran 1 shell command
  • Run lines (group-all): verbs read like a sentence — ran 3 shell commands, edited 2 files, read 5 files, listed 2 directories, searched for 9 patterns, called playwright ×2 (leading verb capitalized when no thinking precedes). Thinking durations come from live telemetry; history turns read ✻ Thought, ran 1 shell command.
  • Per-tool overrides: every tool can be set to default (follow the mode), single (one line), group-same (same-type group line, never absorbed into run lines) or expand (native box); * matches unnamed tools. Per-item states are absolute — group-same groups even in native mode.
  • Thinking blocks share the same lattice (turnCollapse.thought): default (follow the mode) / single (one ✻ label per message) / group-same (grouped Thought line, never merged with tools) / expand (inline, pi native). Whole-run absorption exists only via group-all mode + default. pi's native hideThinkingBlock is kept as a mirror (ctrl+t flips are adopted as explicit states).
  • Line spacing: compact (flush) or classic (blank line around compressed lines, adjacent compressed lines separated by a single blank; ✻ label lines count as compressed lines, keeping them apart from their text tails).
  • One-click expand/collapse: click a compressed line to open the full reasoning and every tool's bordered output at once — including the thinking of text-bearing messages, no second tap on labels. Click any member line to fold it all back. A click is an unmodified press that releases on the same cell — drag-selecting text never toggles a run (pi's fullscreen selection keeps working untouched).
  • Per-message thinking labels: ✻ Thought… (history) / ✻ Thinking… (streaming), individually clickable to expand just that message's reasoning, styled identically to run lines (same accent ✻, same muted upright text).
  • Running tools render as an animated one-liner (⠋ bash · $ npm test) with live output streaming beneath — and never drag completed neighbors out of their folded lines (turnCollapse.liveTools: false drops the streaming box, spinner line only; native- override tools always keep their box)
  • Live thinking (turnCollapse.liveThinking, default on): while a message streams thinking-only content it renders inline in real time; once text starts (or the message stops streaming) it folds back to the ✻ label / run line immediately — no need to wait for the run to settle (native mode keeps pure pi boxes).
  • Retry UX: the countdown carries the failure reason (Retrying (2/10) in 5s… · 429 rate_limit_error); intermediate errors are held back, a successful retry prints nothing, and only the last error shows if the run fails (togglable independently of the mode).
  • Regular-mode support: compressed lines work in the regular (non-fullscreen) TUI too — every line ends with the effective expand-all shortcut hint (e.g. (ctrl+\ to expand)); pressing it expands every run (reasoning + all tool output), pressing again collapses all. Fullscreen keeps per-run click-to-expand.
  • Compact spacing: pi's internal spacer padding and OSC shell-integration markers around ✻ lines are folded away.

Telemetry

  • Working indicator: Working… (34s · ↓ 1.2k tokens · 3 tools) — elapsed, run-cumulative output tokens (stream-estimated while streaming, exact on message completion, kept across tool calls), tool count as they start.
  • Turn telemetry after each run: TPS, TTFT, duration, stall count/time, input/output token breakdown with cache-read and cache-write, cache hit rate, and list-price $/M rate.
  • Classic footer summary: ✓ done 12s · ✻ 8s · 2 shell commands after each run.

HUD footer

A claude-hud style four-line dashboard (a starship-style classic preset is also built in):

  1. Status line — model with context window, thinking level (moon-phase icons), git branch with dirty marker, ahead/behind, per-file diff totals [+71 -5], session name, cumulative working time, cost, today's cost, live output speed (tok/s; only updated when the message streamed for at least 1s — burst-flushed responses are not measurable and keep the last credible speed).
  2. Context line — usage bar with percent and token counts, cache hit rate. Token stats have three presentations (hud.tokens): localized verbose labels (↑in 77M ·cache 77M), language-independent compact shorthand (↑ 77M (U 855k + R 77M) │ ↓ 266k │ C 98.9%), or off.
  3. Tools line — per-tool usage counts with ✓, running tool labels.
  4. Environment line — MCP server count (only when pi-mcp-adapter is actually installed), memory usage, compaction count, pi version.

Plus: OSC 8 hyperlinks on the working directory and changed files (click to open), powerline-styled git segment, ahead/behind indicators, and full subdirectory git detection (pi normally fails to show branch state when started inside a repository subdirectory).

Editor & settings

  • Framed editor with block / bar / underline cursor styles.
  • Bilingual /*tui settings panel (English / 简体中文) — the language choice also localizes HUD labels — covering footer segments, HUD toggles, telemetry fields, icon mode (nerd / ascii / auto), cursor style, fullscreen wheel-scroll speed, and a Collapse tab (compression mode, line spacing, retry-error folding, thinking visibility, per-tool overrides — extension/MCP tools appear there once seen) — with named style presets (hud / classic / custom).
  • Version-guarded compatibility shims: fullscreen wheel speed falls back to pi defaults if the runtime shape changes.

Fresh installs default pi's hideThinkingBlock to true (existing choices are never overridden) so the ✻ experience works out of the box.

Requirements

  • Pi 0.80+
  • UTF-8 terminal; a Nerd Font for the full icon set (ASCII icons are built in)
  • Both TUI modes work: in regular mode compressed lines expand/collapse via the expand-all shortcut (default ctrl+\, annotated at the end of each compressed line); **per-run click-to-expand** needs pi's fullscreen mouse capture (/settings → TUI mode, or "tuiMode": "fullscreen" in ~/.pi/agent/settings.json).

Configuration

Run /*tui, or edit ~/.pi/agent/asterisk-tui.json. Settings from a legacy open-tui.json are adopted automatically on first run; the old file is kept. Notable keys:

Key Default Effect
footerStyle "hud" hud / classic footer presets
turnCollapse.mode "group-all" native / single / group-same / group-all compression
turnCollapse.style "compact" compact / classic spacing around compressed lines
turnCollapse.retryErrors true hold retry errors during a run; collapse repeated request errors into one ⚠ … ×N line (click to expand)
turnCollapse.thought "default" thinking: default / single / group-same / expand
turnCollapse.liveThinking true stream thinking inline while it arrives; fold back after
turnCollapse.liveTools true render running tool output boxes below the spinner line
turnCollapse.expandAllKey "ctrl+\\" expand-all shortcut in regular mode (pi KeyId; empty disables; applies after restart/reload)
turnCollapse.tools {} per-tool default / single / group-same / expand; * wildcard
icons.mode "auto" nerd / ascii / auto icon set
cursorStyle "block" editor cursor style
telemetry.* on working-indicator and post-turn telemetry fields
footerSegments.* mixed classic footer segment toggles
hud.* on every HUD segment individually toggleable (hud.tokens: verbose / compact / off)
fullscreen.wheelScrollLines 4 mouse wheel lines per tick

How it works

Everything is a runtime patch over pi's extension surface, version-guarded and inert on mismatch: the chat container's render is wrapped to re-chunk the transcript (containers, messages, and tools are classified by content, not appearance), the fullscreen viewport's mouse input is observed (never consumed) to route same-cell press→release clicks through per-render line segments, and pi-tui's loader messages carry retry reasons. No pi files are modified on disk.

Local development

npm install
npm test && npm run typecheck
pi -e .

Acknowledgements

  • OldSuns/pi-open-tui — this project began as a fork of it; the original integration work and its credits carry over.
  • claude-hud — the HUD footer layout.
  • pi-haiku — footer structure and working timer.

License

MIT