pi-tui-pro
v1.0.2
Published
pi 界面优化扩展:用户消息背景色、右下角状态栏(思考挡位/时间/token缓存命中)、鼠标点击折叠单个思考块和工具输出
Readme
pi-tui-pro
UI enhancements for the Pi coding agent TUI.
Install
pi install npm:pi-tui-proFeatures
- User message background — user messages get a slightly brighter, easy-on-the-eyes background so they stand out from the transcript.
- Thinking level pinned to the footer — the current thinking level (
off/low/medium/high/xhigh/max) is always shown next to the model name at the bottom-right, color-coded by level. - Clock never truncated — the current time is pinned to the very end of the status line and is never ellipsized, no matter how much token/context stats pile up.
- Cache hit stats — the footer shows cache reads (
R), cache writes (W) and the cache hit rate (CH%) alongside input/output tokens. - Click to fold/unfold individual blocks — click a collapsed thinking block (
💭 Thinking... · 点击展开) to expand just that block, click inside an expanded thinking block to collapse it, and click anywhere on a tool output to toggle it — independent of the global expand/collapse toggle.
Usage
- Restart
piafter installing. The new footer appears immediately; fold markers appear on new and existing thinking blocks after the session loads. - The global "expand/collapse all" shortcut still works and resets per-block overrides.
- Clicking is disabled while a message is streaming (to avoid racing with live updates).
Notes
- Deep links into pi's internal components are runtime-patched from the live component tree, so the extension adapts to the actual runtime classes instead of relying on
instanceof. - If a future pi update breaks click-to-fold, open an issue with your pi version.
Development
# run smoke tests (requires the extension to be loadable via jiti)
node test.mjs
# debug logging (writes to ~/.pi/agent/pi-tui-pro-debug.log)
PI_TUI_PRO_DEBUG=1 piLicense
MIT
