@gwengal/pi-limits0.1.1
Provider-agnostic quota and rate-limit bars for the Pi coding agent
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-limits

Provider-agnostic quota and rate-limit bars for the Pi coding agent.
- Shows the limits of the active provider only, colored by how close you are (green, yellow, red).
- Built in: Anthropic unified rate-limit headers, so it works for the
anthropicprovider and for pi-claude-bridge out of the box. - Open: any extension can report its own limits through a small, versioned event (see Event contract). pi-copilot-bridge uses it for GitHub Copilot.
- Uses only data the provider already sends. No extra network calls, no tokens read.
Install
pi install npm:@gwengal/pi-limits
The bars appear in Pi's footer after the first response that carries limit data.
Configuration
| Environment variable | Effect |
|---|---|
PI_LIMITS_ALIGN=left |
Keep the line left-aligned instead of right-aligned (for custom footers). |
Footer extensions such as pi-statusbar show the line by its status key
pi-limits.
Event contract
Emit pi-limits:report:v1 on pi.events whenever your extension learns new limits:
pi.events.emit("pi-limits:report:v1", {
source: "my-provider", // stable id of your source
label: "My Provider", // shown when several sources are visible
providers: ["my-provider"], // Pi provider ids this report belongs to
windows: [
{
id: "monthly",
label: "Month",
usedPercent: 42, // 0..100
used: 420, // optional absolute values
limit: 1000,
unit: "req",
resetsAt: "2026-12-01T00:00:00Z", // optional ISO 8601
status: "ok", // optional: ok | warning | exhausted | overage
},
],
spend: { amount: 0.42, unit: "credits" }, // optional, current session
});
- The newest report per
sourcewins. An emptywindowslist (and nospend) clears the source. - Invalid reports are ignored and Pi shows one warning per distinct problem.
- Types are exported:
import type { LimitsReport } from "@gwengal/pi-limits". - The event name carries the major version. New optional fields may be added; breaking changes get a new name.
Development
See CONTRIBUTING.md. npm run check runs typecheck, lint, format check and tests.
License
MIT