Evan Reichard 461773c677 fix(usage): resolve Z.ai window assignment using limit IDs
Z.ai assigns both token and request limits the same generic "quota"
window ID, so findWindowLimits fell through to array-order fallback.
This caused the two bars to swap depending on API response order.

Add limit-ID-based matching (zai:tokens → current, zai:requests → week)
as a secondary tier after window-ID matching.
2026-05-04 06:24:28 -04:00

pi-statusbar

A pi extension that replaces the built-in footer with a configurable two-row statusbar.

Features

  • Directory, git branch, session, context, model, thinking, and cost modules
  • Account usage modules for Claude/Anthropic, Codex/ChatGPT, and Z.ai
  • Configurable rows and module placement in config.ts
  • ANSI-aware rendering and truncation for narrow terminals
  • Continuous green → yellow → red usage bar gradient

Usage

Add this extension to pi via package.json:

{
  "pi": {
    "extensions": ["./index.ts"]
  }
}

Reload pi after changes with /reload.

Refresh account usage manually with:

/refresh-usage

Configuration

Edit config.ts to change the statusbar layout. Usage modules can be composed with options such as:

{ type: "usage", window: "current", style: "line", grow: 1 }
{ type: "usage", window: "week", style: "text", parts: ["percent", "time"] }

Development

npm install
npm run lint
npm run typecheck

Attribution

Provider usage fetchers in usage/ are adapted from oh-my-pi.

Description
No description provided
Readme 142 KiB
Languages
TypeScript 99.1%
Nix 0.9%