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-cpa-quota

v0.1.2

Published

Pi extension: Codex and Claude subscription quota from cpa-quota-api (CLIProxyAPI) in the status bar and a /quota overlay.

Readme

pi-cpa-quota

Pi extension that shows Codex and Claude subscription quota from a cpa-quota-api server, the read-only quota companion for CLIProxyAPI.

Codex: 97% │ Claude: 67%

/quota opens an overlay with every account, quota window, reset time, observation age, routing availability and refresh state (j/k, PgUp/PgDn to scroll, r to refresh, q/Esc to close).

Install

pi install npm:pi-cpa-quota

Create ~/.pi/agent/cpa-quota.json:

{
  "url": "https://your-gateway.example.com/v1/quota",
  "apiKey": "$CPA_API_KEY"
}
  • url must be HTTPS (plain HTTP is allowed only for localhost/127.0.0.1), end in /v1/quota, and contain no credentials, query string or fragment.
  • apiKey is your normal CLIProxyAPI client key. A $NAME reference is resolved from the Pi process environment first, then from .env next to the config file (normally ~/.pi/agent/.env). The .env file is parsed as data; nothing is executed and the process environment is not modified. Missing, empty or unresolved keys fail closed.
  • With PI_CODING_AGENT_DIR set, both files live in that directory instead. A legacy quota-api.json is read when cpa-quota.json does not exist.

Keep both files readable only by you (chmod 600). The key is sent only to the configured URL, redirects are refused, and server error bodies are never shown.

Display

For each provider the value is the arithmetic mean of account-level minima: each account contributes its lowest known active window, so a constrained window is not hidden by a healthier one on the same account. Percentages are never summed across accounts.

A trailing ~ means stale, partial or error-affected data. Unknown data is shown as —, never as 0%.

The quota is refreshed every 5 minutes and on r in the overlay.

Status bar placement

The extension publishes the status key quota. Pi's default footer shows it automatically. With pi-powerline-footer you can pin it as a custom item in ~/.pi/agent/settings.json:

{
  "powerline": {
    "layout": { "right": ["cost", "context_pct", "custom:quota"] },
    "customItems": [
      { "id": "quota", "statusKey": "quota", "position": "right", "selfColorize": true, "excludeFromExtensionStatuses": true }
    ]
  }
}

Development

npm ci
npm test

Releases are published to npm by CI on v* tags (npm version patch && git push --follow-tags).