npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@juanbenjumea/pi-dynamic-footer

v0.1.7

Published

Dynamic configurable footer for pi with live observability: context gauge, TPS, token/cost tracking, subscription usage bars, git status, and a full settings UI.

Downloads

822

Readme

pi-dynamic-footer

Dynamic, configurable footer for pi with live observability. Replaces the default footer with a multi-line display showing context usage, TPS, token/cost tracking, subscription quota bars, git status, and more.

Features

  • Context gauge — current / max tokens with color-coded usage bar (green → yellow → red)
  • Live TPS — tokens-per-second during streaming, plus last-turn average
  • Token tracking — per-turn ↑input / ↓output counts, total session cost
  • Cache ratio — cache hit percentage
  • Git status — branch name, dirty state, added/removed lines
  • Subscription usage bars — rolling window quotas with reset timers for 8 provider types
  • Fast mode indicator — shows when priority/fast service tier is active
  • Thinking level — displays current thinking mode (off/minimal/medium/high/xhigh)
  • Labeled segments — each data point has a compact label
  • Settings UI/obs-settings command to toggle segments, configure zones, load presets
  • Dashboard/obs command for full observability dashboard + last 10 sessions
  • Toggle/obs-toggle to show/hide the footer

Install

pi install npm:@juanbenjumea/pi-dynamic-footer

Commands

| Command | Description | |---|---| | /obs | Full observability dashboard + last 10 session summaries | | /obs-toggle | Show/hide the dynamic footer | | /obs-settings | Open footer settings UI (segment toggles, zones, presets) |

Supported Providers (quota bars)

| Provider | Auth source | Windows | |---|---|---| | Claude / Claude Max | auth.json (anthropic) or macOS keychain | 5h, Week, Month | | OpenAI Codex | auth.json (openai-codex) or ~/.codex/auth.json | 5h, Week, Month | | OpenCode Go | auth.json (quota-status.opencode-go or opencode-go-failover) | 5h, Week, Month | | ClinePass | auth.json (cline-pass) or CLINE_API_KEY env | 5h, Week, Month | | Umans | auth.json (umans) or UMANS_API_KEY env | Requests, Concurrency | | GitHub Copilot | auth.json (github-copilot) | Premium, Chat | | Google Gemini | auth.json (google-gemini-cli) or ~/.gemini/oauth_creds.json | Pro, Flash | | Kimi Coding | auth.json (kimi-coding) or KIMI_API_KEY env | Windows, Week |

For multi-account OpenCode Go rotation, install @juanbenjumea/pi-multi-opencode-go alongside this footer. Usage parsing uses @juanbenjumea/opencode-go-usage (v0.1.4+).

Configuration

Footer segments

Use /obs-settings to toggle individual segments:

| Segment | Shows | |---|---| | modelThink | Model ID + thinking level | | runtime | Session duration | | pwd | Current working directory | | git | Branch, dirty state, ± lines | | contextUsage | Color-coded context usage bar | | contextProgress | Context progress bar | | contextPercentage | Context percentage | | contextNumbers | Verbatim token counts | | tokens | Total ↑input / ↓output tokens | | tps | Live or last-turn tokens/sec | | cost | Total session cost | | cache | Cache hit ratio | | turnCount | Current turn number | | usageBars | Subscription quota usage bars |

Context zones

Set the warning (yellow) and expert (red) thresholds in /obs-settings:

Warning zone:  70% (default)
Expert zone:   90% (default)

Presets

| Preset | Description | |---|---| | all | Every segment enabled | | minimal | Model + context percentage only | | developer | Full stack: model, TPS, context, tokens, cost, cache, git, quota | | ops | Runtime, git, cost, quota bars |

Environment variables

| Variable | Description | Default | |---|---|---| | PI_OBS_SHOW_FULL_PATH | Show full cwd path instead of basename | off |

How it works

The extension hooks into pi's event system:

  • session_start — initializes state, fetches quota, sets footer
  • turn_start / message_update / turn_end — tracks TPS, token counts, cost
  • model_select — refreshes quota display on model switch
  • session_shutdown — persists last 10 session summaries

Token counts come from the assistant message's usage object (free with every LLM response). Quota data is fetched from each provider's dedicated API using credentials from ~/.pi/agent/auth.json or environment variables.

Security and privacy

  • Tokens are read only to request usage data and remain in memory; they are never written to the footer's settings or history files, displayed, or logged.
  • Authenticated requests use the provider's fixed HTTPS API endpoint. Redirects are rejected and responses are size-limited.
  • The footer stores only the last ten local session summaries (cwd, branch, model, token totals, cost, and runtime) under ~/.pi/agent/observability/. On POSIX systems, the directory is mode 0700 and its data files are mode 0600.
  • Auth values beginning with ! are intentionally ignored: this package never executes shell commands from auth.json. Supply a resolved credential through the provider's environment variable instead.

Notes

  • Auth tokens are read from ~/.pi/agent/auth.json (populated by pi's /login command)
  • Providers without configured auth simply don't show usage bars — no errors
  • The footer is set via ctx.ui.setFooter() and replaces pi's default footer entirely

License

MIT