omp packages

pi-status-footer1.4.1

Compact status footer for pi: model, thinking level, tokens, cost, TPS, cache hit rate, context usage, live git diff, working/turn timers, run completion time, plus a conditional third line for other extensions' status segments.

GitHub Actions Published 21 hours ago MIT ~494 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

pi-status-footer

Compact status footer for the pi TUI: context usage, tokens, cost, live TPS, git diff, and run timers, plus an optional third line for other extensions' status segments.

See pi.dev docs for how extensions work.

What's included

Extension Command / shortcut What it does
stats-footer.ts (no command; TUI footer widget) Renders a footer: line 1 usage/spend/timers, line 2 folder/git/model, and a conditional line 3 carrying statuses other extensions set via ctx.ui.setStatus()

It registers no slash commands, shortcuts, flags, tools, or providers. It hooks session/agent/turn/message events (session_start, agent_start, agent_settled, turn_start/end, message_start/update/end, model_select, thinking_level_select, session_info_changed, session_shutdown) to update the footer.

Both data lines spread their groups across the terminal width — left, middle, right — instead of hugging the left edge, so a wide terminal uses its space. Narrow terminals fall back to a compact left-aligned line.

Install

pi install npm:pi-status-footer
pi install git:github.com/kslamph/pi-status-footer
pi install ./pi-status-footer

Try without installing (one run only, nothing saved):

pi -e npm:pi-status-footer
pi -e ./stats-footer.ts

The footer appears automatically in the next TUI session.

Usage

Just run pi in the TUI. Example footer:

 38%/128k   63%  ↑5.2k ↓8.1k   42 t/s   08:23:30   $0.420 +$0.020000                        4:32   1:18
 my-project                                       ▸  main  +3 -1                          openai/gpt-4o 󰧑 medium
 bg 1 running · Shift↓

Icons are Nerd Font glyphs (Font Awesome / Material Design ranges), not emoji. Emoji are colour bitmaps whose rendering the terminal decides: some hosts (xterm.js/Chromium, iTerm2) paint them in full colour while others (Alacritty, kitty) draw flat monochrome silhouettes, so the same footer looked different per terminal. Nerd Font glyphs are single-cell line art everywhere. Requires a patched Nerd Font as the terminal font (for example JetBrainsMono Nerd Font); without one the icons show as boxes.

Line 1 is three groups: usage on the left (context used/limit, cache hit rate, input/output tokens, tokens/sec, and the completion clock), spend in the middle (session cost + current-run delta), and the timers on the right (agent-run timer, current-turn timer). Tokens/sec sits with the output tokens it is derived from and is always rendered, so it shows from a session's first frame rather than appearing only once a rate exists. Line 2 is three groups too: folder (repo root, or cwd outside a repo) on the left, git branch + working-tree diff vs HEAD in the middle, provider/model + thinking level on the right.

The groups spread across the full width when the terminal is wide enough — the common case, and what stops the footer from piling everything against the left edge. When the line cannot hold the spread, the footer falls back to the compact left-aligned flow; on line 2 it then shortens the model id from the left and finally drops the git group.

The completion clock appears when a run settles, keeps the local wall-clock time frozen until the next run starts, and is never shown for an aborted run. It is the same fact pi-done-at notifies with, but persistent instead of a transient notification — so both can be installed, or pi-done-at can be dropped for a quieter TUI.

Line 3 is conditional: it appears only while an extension has status text registered through ctx.ui.setStatus() (for example pi-background-tasks's bg 1 running · Shift↓, or pi-subagents progress), and it disappears as soon as the last status clears, so the footer returns to its two-line height. Segments keep their own styling and are truncated to the terminal width like the other lines. This matters because a custom footer replaces pi's built-in footer: a footer that never reads those statuses hides other extensions' progress entirely.

Configuration

Zero config. No env vars, no settings keys.

Security note

Runs in-process with your OS permissions. It reads session entries (token usage, cost, model, context) and runs one shell command, debounced to 1s during agent runs: git diff --shortstat HEAD (with --no-optional-locks, 3s timeout) plus a walk-up check for .git to find the repo root. No network access, no file writes.

Update / remove / enable-disable

pi update --extensions        # update all packages
pi update npm:pi-status-footer
pi remove pi-status-footer
pi list
pi config                     # enable/disable resources

Compatibility

  • Peer deps: @earendil-works/pi-ai, @earendil-works/pi-coding-agent, @earendil-works/pi-tui (any version with ctx.ui.setFooter)
  • TODO: confirm exact tested Pi version and OS coverage (developed on Linux)

Development

git clone https://github.com/kslamph/pi-status-footer.git
cd pi-status-footer
pi install ./                          # local copy loads in place
pi -e ./stats-footer.ts                # single run from inside the repo
npm test                               # runs test-live-tps, test-layout, test-cost, test-done-at

No build step; pi loads the TypeScript file directly. Optional typecheck: install the peer deps as devDependencies, then npx tsc --noEmit stats-footer.ts.

License + credits

MIT — see LICENSE. Footer demo image: docs/footer-demo.png.