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

@javargasm/pi-usage-bars

v0.2.1

Published

Usage indicator for pi — footer status bars and /usage command for Codex, Claude, Z.AI, Gemini, Antigravity, OpenCode Go, and Kiro

Readme

pi-usage-bars

Usage indicator for pi.

Codex footer bar

It adds:

  • a footer status bar for the active provider
  • a /usage command with all connected providers

Supported providers:

  • OpenAI Codex (multiple subscriptions)
  • Anthropic Claude
  • Z.AI
  • Google Gemini CLI
  • Google Antigravity
  • OpenCode Go
  • Kiro (AWS Q / Amazon CodeWhisperer)

Credits / Inspiration

This extension is based on and inspired by:

  • https://github.com/steipete/CodexBar
  • https://github.com/mikeyobrien/rho/tree/main/extensions/usage-bars

Install

pi install npm:@javargasm/pi-usage-bars

Use

1) Footer usage bars

When your active model is supported, the footer shows color-coded bars for:

  • Session usage (5-hour rolling window)
  • Weekly usage (7-day rolling window)
  • Monthly usage (when available)
  • Reset countdowns

Bar colors: 🟢 green (<70%) → 🟡 yellow (70-89%) → 🔴 red (≥90%)

Claude footer bar

2) /usage command

Opens an interactive list with all providers that have credentials. Supports search/filter and shows the active provider with a ✓ badge.

/usage command


Provider details

OpenAI Codex

  • Session and weekly usage via the ChatGPT WHAM endpoint
  • Supports multiple subscriptions — each openai-codex-* key in auth.json is displayed as a separate entry in /usage

Anthropic Claude

  • Session (5-hour) and weekly (7-day) usage via the Anthropic OAuth usage API
  • Extra spend tracking ($used / $limit) when overages are enabled
  • 429 resilience: file-based cache with exponential backoff, Retry-After header support, file locking to prevent thundering herd, and stale data fallback when rate-limited

Z.AI

  • Session and weekly usage with reset countdowns
  • Dedicated parser for Z.AI's TOKENS_LIMIT response shape (unit 3 = session, unit 6 = weekly)

Google Gemini CLI / Antigravity

  • Quota bucket parsing with automatic projectId discovery
  • Selects the most relevant model bucket (Claude non-thinking → Gemini Pro → Flash)

OpenCode Go

  • Scrapes the OpenCode Go dashboard for rolling, weekly, and monthly usage windows
  • Credentials via environment variables (OPENCODE_GO_WORKSPACE_ID, OPENCODE_GO_AUTH_COOKIE) or auto-discovered config file

Kiro

  • Credit-based usage from the AWS CodeWhisperer GetUsageLimits endpoint
  • Profile ARN resolution via ListAvailableProfiles
  • Token refresh for both OIDC (IdC / Builder ID) and Desktop auth methods
  • Shows plan title, credit count (used/total), monthly reset countdown, and a high-usage warning at ≥90%
  • Atomic auth.json updates with selective merging to avoid clobbering concurrent writes

Configuration

Environment variables

| Variable | Description | |---|---| | PI_ZAI_USAGE_ENDPOINT | Override the Z.AI usage endpoint | | PI_GEMINI_USAGE_ENDPOINT | Override the Gemini quota endpoint | | PI_ANTIGRAVITY_USAGE_ENDPOINT | Override the Antigravity quota endpoint | | OPENCODE_GO_WORKSPACE_ID | OpenCode Go workspace ID | | OPENCODE_GO_AUTH_COOKIE | OpenCode Go auth cookie | | GOOGLE_CLOUD_PROJECT | Google Cloud project ID (skips auto-discovery) |

Auth

Credentials are read from ~/.pi/agent/auth.json. OAuth tokens are refreshed automatically when they expire.


Development

# Run core tests
bun test tests/usage-bars-core.test.ts

# Run all tests
bun run tests/run-all.ts

License

MIT