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

@smarzban/pi-statusline

v0.2.0

Published

Custom pi footer: session name, model/effort, context, provider usage, git branch/PR/diff

Readme

@smarzban/pi-statusline

Custom statusline for pi: a footer with model/effort, context, provider remaining, git branch, PR, and diff.

Part of the pi-extensions monorepo.

pi-statusline screenshot

Highlights

  • Session name ⚑ name as the leading footer segment
  • Model · effort from the active model + thinking level
  • Context as ctx N% · used/total: green below 50%, yellow at 50%+, red at 70%+
  • Session cost $x.xxx from assistant usage.cost.total when non-zero
  • Tokens/sec N t/s and time-to-first-token ttft …: speed of the last assistant response, both toggleable (see Speed segments)
  • Provider remaining for openai-codex, opt-in, off by default (see Provider usage)
  • Git ⎇ branch +staged *unstaged ?untracked plus ahead/behind; open PR via gh, clickable in terminals that support links
  • Local by default with no network calls or token reads unless you enable provider usage

The rounded editor box with the session-name label moved to its own package: pi-editor. Install both to get the old look.

Quickstart

pi install npm:@smarzban/pi-statusline
# or local
pi install /absolute/path/to/pi-extensions/packages/pi-statusline

Restart pi. Name the session so it shows:

/name my task

Example (default, no provider-usage segment until you opt in):

[⚑ my task]  [gpt-5-codex · high]  [ctx 12% · 24k/200k]  [$0.042]  [⎇ main +1 *2 ?1]  [#12]

After /statusline usage on, a Codex quota segment appears: [5h 80% rem · 4h].

The current branch's open PR is checked on startup, branch changes, /statusline refresh, and at most once every 30 seconds after an agent run. Its #number opens the PR when clicked in terminals that support OSC 8 hyperlinks. Lookups run in the background and never block the editor. Merged or closed PRs disappear automatically after the next check.

Commands

/statusline               # status + current segments
/statusline on            # enable custom footer (default)
/statusline off           # restore pi’s default footer
/statusline usage on      # opt in to provider quota (reads auth, calls provider)
/statusline usage off     # disable provider quota (default)
/statusline session on    # show the [⚑ name] segment (default)
/statusline session off   # hide the session name segment
/statusline tps on|off    # show/hide the tokens-per-second segment (default on)
/statusline ttft on|off   # show/hide the time-to-first-token segment (default on)
/statusline refresh       # re-fetch git (+ provider usage if enabled) now

All settings persist to ~/.pi/agent/statusline.json (enabled, usageEnabled, sessionName, tps, ttft).

Speed segments

Two numbers describe how fast the last reply was, and they answer different questions:

  • ttft (time to first token) is the wait before the reply started appearing. Think of it as the model "reading your message and thinking" before it begins to type. Long ttft = long silent pause. For local models this grows with how much conversation the model has to re-read; for cloud models it also includes queueing on the provider's side.
  • t/s (tokens per second) is the typing speed once the reply started: how many word-pieces (tokens) arrive each second. Higher = the text streams in faster. Measured from the first token to the last, so the thinking pause above is not mixed into it.

So [42 t/s] [ttft 2.1s] reads as: it thought for about 2 seconds, then typed at 42 tokens a second. Both are measured the way local tools like Ollama and LM Studio report speed (t/s is the decode-only rate, ttft kept separate, never blended), so the numbers are comparable to theirs.

Fine print: ttft always reflects the latest response, while t/s reflects the latest measurable one (responses under half a second or with no counted output keep the previous reading), so after a very short reply the two can describe different responses. And reasoning models count their thinking as output tokens whether or not the thinking is streamed, so providers that hide reasoning can show an inflated t/s: tokens generated during the silent wait are credited to the typing window.

Hide either with /statusline tps off or /statusline ttft off.

Provider usage

Opt-in and off by default. With usage off, the statusline reads no auth files and makes no network calls. Turn it on with /statusline usage on; turn it back off with /statusline usage off.

When on, it reads your provider token and calls that provider's usage API:

| Provider id in pi | Remaining / windows | Reads | Sends token to | |-------------------|---------------------|-------|----------------| | openai-codex | Primary + secondary windows (% rem + reset time) | ~/.pi/agent/auth.jsonopenai-codex, or ~/.codex/auth.json | chatgpt.com/backend-api |

Only your own credentials are used, and the token goes only to that provider. Other providers (xAI, OpenCode Go, …) have no reliable remaining-% API with pi's credentials, so the segment is omitted for them even when usage is on.

Costs

Yes, pi exposes per-assistant-message usage.cost.total (USD estimate from model pricing). The footer sums those across the session and shows $x.xxx when non-zero. Subscription OAuth turns may still report a computed cost even when you are not billed per-token.

Install methods

| Method | Loads | Command | |--------|-------|---------| | npm (recommended) | This package only | pi install npm:@smarzban/pi-statusline | | local | This package only | pi install /absolute/path/to/pi-extensions/packages/pi-statusline | | git (whole monorepo) | All packages in the repo | pi install git:github.com/smarzban/pi-extensions |

See docs/install for one package vs whole monorepo.

License

MIT