Add felipeartur/ai-usagebar - #374
Closed
FelipeArtur wants to merge 2 commits into
Closed
Conversation
A headless poller runs `ai-usagebar usage --json` on an interval and publishes the report to plugin state; the capsules and the panel are pure subscribers, so a second capsule or a second monitor costs no extra process. Severity and absolute reset stamps come from the CLI, so the plugin carries no vendor table and no countdown parsing.
Nest translations/en.json, add the 960x540 thumbnail and rewrite the README on the template, so validate-plugins.py passes. Fix the reset weekday: formatTime passes unknown text through verbatim, so a "ddd" prefix rendered literally. Build it with os.date instead. Shrink the panel to 380px; the footer does not stretch to the bottom, so the taller box only added empty space.
Contributor
|
This pull request was automatically closed because its description no longer contains Missing:
Please add the items listed above back to the description, keeping their exact wording, then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plugin
felipeartur/ai-usagebarplugin.toml)What it does
Puts your AI plan quota in the bar. The capsule shows the headline percentage of
a provider behind that provider's icon, and reads in the bar's own colour until
the CLI calls the window high or critical, at which point it picks up
tertiaryor
error. Four styles: a plain percentage, a gauge, five segments, or the nameand percentage stacked over the bars. Beside that it can carry the time left in
the window and the pace against the clock, and one capsule can carry up to four
providers, busiest first.
Clicking it opens a two pane panel: every provider you have set up on the left,
the selected one in detail on the right, with a card per quota window. Each card
shows the label, the severity the CLI assigned, the percentage, how much of the
window has elapsed as a second thinner bar, the time left with the clock time or
date its reset lands on, and the pace line. Credit blocks and free text rows the
CLI reports are rendered too.
The numbers come from ai-usagebar,
a Rust CLI that reads Claude, Codex, Cursor, Antigravity, Kiro, Z.AI, OpenRouter,
DeepSeek, Kimi and Grok, among others. The plugin never talks to a provider,
holds a token, or reads a credential file.
External dependencies
ai-usagebar, declared independenciesand run by name fromPATH. Oneprocess per read:
ai-usagebar usage --json. The CLI owns credentials, providerendpoints and its own caching; the plugin parses that stdout and draws it.
Testing
Running in my bar against a live Claude Pro plan and a ChatGPT Free plan, with
three more providers configured in the CLI without credentials. Exercised: all
four capsule styles and both extras;
provider_limitfrom 1 to 4; the tooltip;left click opening the panel; right click refreshing; provider selection inside
the panel;
noctalia msg panel-toggleandpanel-open; both IPC events on thepoller; the widget settings dialog and the plugin settings dialog. Providers
with no credential are filtered out of the list, and a reset more than a week
out was checked for its absolute date.
noctalia plugins lintand this repo'svalidate-plugins.pyare both clean.Screenshots / Videos
The capsule and the panel, from a running session:
https://raw.githubusercontent.com/FelipeArtur/community-plugins/ai-usagebar-plugin/ai-usagebar/thumbnail.webp
Checklist
idafter the/inplugin.tomlexactly.plugin.toml,README.md,thumbnail.webp, andtranslations/en.json.README.mdfollows theREADME template, documents
every entry id and dependency, and includes exact panel IPC commands and launcher prefixes where applicable.
thumbnail.webpwith the thumbnail generator.versionfollows semver and is bumped in this PR;plugin_apiis the oldest API level this plugin requires.understand that language well enough to review and maintain it (no unreviewed machine/LLM translations).
catalog.toml; CI generates it.Code review attestation
licensedeclared inplugin.toml.English is the only translation shipped. The plugin makes no network calls and writes no files. The only process it
spawns is
ai-usagebar usage --json, from thepollerservice, and the poller refuses to start one within twoseconds of the last. Text that comes back from the CLI is rendered, so it is first collapsed to one line, capped at
200 characters, and stripped of anything shaped like
key=,token=,secret=orBearer <value>before itreaches a tooltip.
Notes
plugin_apiis 9 because row selection in the panel uses a closure as a clickhandler. Everything else the plugin needs exists at 3.