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

pi-infobar

v0.2.0

Published

High-contrast, readable info bar for the Pi coding agent.

Readme

pi-infobar banner

pi-infobar - Pi extension

High-contrast two-row info bar for the Pi coding agent.

This extension replaces Pi's default footer with a cleaner info bar layout inspired by a Starship-style prompt. It keeps the most important information visually dominant and avoids low-value activity labels like status, idle, or ready.

Install

pi install npm:pi-infobar

Try it without installing permanently:

pi -e npm:pi-infobar

Layout

Line 1 — navigation + model state

Left:

  • current working folder, rendered first and styled as the primary segment;
  • linked worktree name with 󰙅, when the current folder is a Git worktree;
  • git branch, when available, with Starship-style git status inline (~ modified blue, untracked red, + staged green, - deleted red, ⇡/⇣ ahead/behind).

The path segment stays as the normal path. Linked worktrees get a separate green worktree segment using the worktree root folder name.

Right:

  • active model in light blue;
  • thinking level with effort-specific color;
  • context percentage with a stepped color ramp from transparent/green through yellow, orange, and red by 60%.

A subtle separator sits between the two information rows.

Line 2

Left: Codex subscription usage

Right: token usage and cost

  • tokens sent;
  • tokens received;
  • dark-green $ estimated cost.

Commands

/pi-infobar            toggle the info bar
/pi-infobar on         enable
/pi-infobar off        disable
/pi-infobar toggle     toggle
/codex-status          show Codex usage and rate-limit windows
/codex-status --refresh  refresh Codex usage
/codex-status --no-statusline  show report without updating footer
/codex-status --clear-statusline  clear Codex usage from footer

You can start Pi with the info bar disabled:

PI_INFOBAR=0 pi

Implementation Details

Structure

pi-infobar/
├── src/
│   ├── index.ts          ← Entry point: extension lifecycle only (~80 lines)
│   ├── types.ts          ← All shared interfaces & type aliases (~45 lines)
│   ├── theme.ts          ← COLOR palette + contextColor/thinkingColor/codexAccent (~75 lines)
│   ├── ansi.ts           ← Low-level ANSI helpers: ansi(), stripAnsi(), hexToRgb(), readableTextOn() (~55 lines)
│   ├── chips.ts          ← Chip factory + renderChip/renderChips/renderSegmentedChip (~85 lines)
│   ├── format.ts         ← Pure data formatters: formatCount, formatCost, shortenModel, etc. (~80 lines)
│   ├── git.ts            ← Git snapshot, cache, parsing, status formatting (~175 lines)
│   ├── codex-usage/      ← Codex subscription usage queries, reports, cache, and statusline manager
│   └── renderers.ts      ← Footer line renderers: renderPrimaryLine, renderUsageLine, etc. (~140 lines)
├── index.ts              ← Re-export barrel: `export { default } from "./src/index.js"` (~1 line)
├── package.json          ← Updated "files" list & tsconfig include
└── tsconfig.json         ← Updated include glob

Code Overview

  • The COLOR constant object
  • contextColor() — percent → color mapping
  • thinkingColor() — thinking level → color mapping
  • codexAccent() — raw status string → accent color
  • codexPercentColor() — codex percent → color

Low-level terminal rendering primitives:

  • ansi() — apply fg/bg/bold SGR codes
  • stripAnsi() — strip ANSI escape sequences
  • hexToRgb() — hex string → RGB
  • rgbCode() — RGB → SGR color code
  • readableTextOn() — pick readable text color for a background

The chip UI component system:

  • chip() factory
  • renderChip(), renderChips()
  • renderSegmentedChip()

Pure data formatting functions:

  • formatCount(), formatCost()
  • shortenModel(), modelName()
  • formatThinking()
  • formatWorkingPath(), smartPathTruncate()
  • shorten(), simplifyStatusText()
  • formatCodexValue(), codexValueSegments()
  • getTokenTotals()

All git integration, fully self-contained:

  • gitCache, GIT_CACHE_TTL_MS, GIT_COMMAND_TIMEOUT_MS
  • getGitSnapshot(), execGit(), getLinkedWorktreeName()
  • parseGitStatus(), parseStatusBranch()
  • formatGitStatus(), formatGitStatusPart(), isDirty()

Footer line renderers that compose chips, git, and formatting:

  • renderPrimaryLine(), renderUsageLine(), renderSeparatorLine()
  • fitLeftRight()
  • renderPathCluster(), renderPathChip(), renderFittedPathChip()
  • renderBranchChip(), renderWorktreeChip()
  • renderCodexStatus()

The main extension entry point — only lifecycle & event wiring:

  • piInfobar() default export
  • installFooter(), refresh()
  • Event handlers: session_start, session_tree, session_shutdown, model_select, agent_end, turn_end, thinking_level_select
  • Command handlers: pi-infobar, codex-status