@shvax/pi-statusline
v0.5.1
Published
Configurable single-line status footer for pi
Readme
@shvax/pi-statusline
A configurable, single-line footer for pi. It uses the active pi theme for semantic colors, shows only the data available for the active model and provider, and drops lower-priority segments before truncating at narrow widths.
📁 pi-statusline main ✓ > 🤖 qwen36-coder > 🧠 medium > 🪟 55.0%/1.0M > ⚡ ↑ 0 t/s ↓ 0 t/s > ⏳ 12m34s
📁 pi-statusline main ↑2 > 🤖 claude-sonnet-5 > 🧠 high > 🪟 30.2%/200K > 5h ╺━━────────╴ 23% ↻2h14m wk ╺━━━━──────╴ 41% ↻4d6h > ⚡ ↑ 1.2k t/s ↓ 74 t/s > ⏳ 8m02sUsage is a thin continuous line with rounded half-line ends and a dark-gray track. Its bright truecolor fill gives a restrained glow, moving smoothly from neon green through vivid orange to blood red as usage rises. Each provider-reported window includes a compact live reset countdown.
Install
pi install npm:@shvax/pi-statuslineTry a local checkout without installing it:
pi -e .Segments
At full width, segments render in the order below. When that line no longer fits, segments switch to compact priority order—context, session, model, effort, project, throughput, then time—and the lowest-priority available segment disappears first.
| Segment | Default | Contents |
|---|---:|---|
| project | on | Current directory name and compact Git HUD |
| model | on | Active model id |
| effort | on | Thinking level; hidden for non-reasoning models |
| context | on | Context percent and window; green below 120K tokens, orange from 120K, red from 170K (75%/90% also warn for smaller windows) |
| session | on | Available subscription usage windows and reset countdowns; Codex labels come from the account's current limits |
| throughput | on | Latest prompt and generation token rates, independently speed-colored; starts at 0 t/s |
| time | on | Live-ticking cumulative active turn time |
The Git HUD defaults on inside repositories: main ✓. It shows ↓ incoming/behind and ↑ outgoing/ahead counts; ✓ means neither is pending. Local working-tree changes are intentionally ignored. Colors use the active theme's accent, success, warning, and error roles.
nerdFont defaults off, so the branch name has no leading icon; toggle it on for the Nerd Font icon. Other optional extras default off: cost, sessionElapsed, lastTurn, and pending.
Configure
/statusline list settings
/statusline on enable the custom footer
/statusline off restore pi's built-in footer
/statusline toggle throughput toggle a segment
/statusline toggle branch toggle the Git HUD
/statusline toggle nerdFont toggle the Nerd Font branch icon
/statusline toggle sessionElapsed show wall time in the time segment
/statusline toggle lastTurn show the latest turn durationSettings persist in ~/.pi/agent/statusline.json.
Provider applicability
| Data | Local models | Anthropic subscription | OpenAI Codex subscription | Other cloud/API key | |---|:---:|:---:|:---:|:---:| | Project, model, effort, context | ✓ | ✓ | ✓ | ✓ | | Available usage bars | — | ✓ | ✓ | — | | Throughput and time | ✓ | ✓ | ✓ | ✓ |
Anthropic OAuth fetches its current 5h and wk limits when the session starts, then updates them from response headers. Codex fetches its current account limits and shows only the windows returned by the account, labeled by duration. Reset countdowns appear for every Claude or Codex window that reports a reset time; absent data is omitted rather than rendered as —.
Throughput and time
↑ is input tokens divided by the prompt-processing window from turn start to first streamed update. ↓ is output tokens divided by the generation window from first update to message end, so tool execution time is excluded. Both rates start at 0 t/s and remain visible while idle. If either streaming window is unavailable, that direction falls back to its token count over the whole turn.
Each direction compares to its own recent same-model baseline: green at or above 90%, orange from 60–89%, and red below 60%. Until three samples are available it stays neutral; output at or below 15 t/s is always red. Changing models resets both rates and baselines.
Active time is the sum of turn durations and ticks live while a turn is running. The timer stops when pi settles, including interrupted or failed turns. Optional elapsed time is wall-clock time since the session loaded; optional last-turn time is the most recently completed turn duration.
License
MIT
