omp-usage-bar0.2.0
oh-my-pi extension: subscription quota bars (5h / 7d, risk colored) below the editor for the account each session uses
Built for omp
The author tagged this package omp-package.
Reports 0
No reports yet.
Readme
omp-usage-bar
An oh-my-pi extension that shows the subscription quota bar of the account in use below the editor, styled like pi-usage-limit-tracker:
Claude 5h █│█░░░░░░░ 32% ▲ 4h00m 7d │░░░░░░░░░ 11% ● 6d16h
- Only the active account is shown: the provider of the current model, and within it the account this session uses. Switching models (
/model, role cycling, fallback) swaps the bar on the next repaint; a model whose provider has no usage report shows no bar. With several accounts of one provider, omp's OAuth identity for the session picks the report, as the status-lineusagesegment does. A provider with several accounts and no session identity is hidden instead of guessed. │marks how much of the window has elapsed. Color is the risk of hitting the limit before reset (pace-aware, muted green → amber → red);●on track,▲warning.- Data comes from omp's own usage cache (
authStorage.usage.reports(), the source of/usage), so the extension makes no extra provider requests. It refreshes at session start, after every agent run, and every minute. - Only in the interactive TUI main session; print/RPC modes and subagents are untouched. Lines wider than the terminal are truncated.
Install
omp plugin link /absolute/path/to/omp-usage-bar
Restart omp. Remove with omp plugin uninstall omp-usage-bar.
Tested with omp 18.12.6. It relies on ctx.modelRegistry.authStorage.usage.reports() and authStorage.oauth.identity(), which are omp internals and may change.
Development
npm install
npm run check # typecheck + tests
omp -e ./ # try it without installing
src/index.ts host wiring: polling, widget
src/reports.ts active-account selection and report → bar windows
src/render.ts bar rendering (ported from pi-usage-limit-tracker, MIT)
src/smart-color.ts risk color model (ported from pi-usage-limit-tracker, MIT)
License
MIT. src/render.ts, src/smart-color.ts, and the window labeling in src/reports.ts come from pi-usage-limit-tracker 0.1.1 — see LICENSE.pi-usage-limit-tracker.