Releases: neoscaler/opencode-ai-usagebar
Release list
v2.0.3
Fix
opencode plugin add github:neoscaler/opencode-ai-usagebar#v2.0.2 (and the matching cli.json entry) failed with NpmInstallFailedError: OpenCode runs a build/prepare step for a git package that declares a scripts field.
Removed the scripts field. The build is still bun run scripts/build.ts. dist/tui.js and install.sh are unchanged from v2.0.2.
v2.0.2
Fix
The sidebar stayed on reading ai-usagebar... forever even though the fetch succeeded.
OpenCode compiles plugin source with an eager JSX runtime: <Show>, <For> and dynamic props were evaluated once at mount and never re-ran, so the UI ignored later setState calls (only explicit effects reacted).
This release builds the plugin ahead of time with the Solid transform (@opentui/solid/bun-plugin) and exports ./dist/tui.js, restoring fine-grained reactivity. install.sh now installs the compiled build.
Also includes the v2.0.1 truncate crash fix.
v2.0.1
Fix
Fixes a crash in the sidebar.content slot:
opencode-ai-usagebar.sidebar crashed in slot sidebar.content:
undefined is not an object (evaluating 'value.replace')
OpenCode V2 evaluates the children of <Show> eagerly. The error-state branch therefore ran truncate(state().message) while the plugin was still loading and message was undefined. truncate now returns an empty string for any non-string input, which also covers plan, metric and balance values.
v2.0.0
OpenCode V2 support
OpenCode V2 does not run V1 plugin implementations, so this is a full port to the V2 plugin API: Plugin.define with setup, and the sidebar.content slot via context.ui.slot.
Breaking changes
- Requires OpenCode V2. The last V1 release is v1.0.1.
- Install layout moved from
~/.config/opencode/plugin/ai-usagebar-sidebar.tsx+tui.jsonto the discovered~/.config/opencode/plugins/ai-usagebar/directory.
Changed
- Colours now come from the resolved V2 theme tokens (
text.base,text.muted,text.feedback.*), so the sidebar follows the active theme. - The plugin ships a
package.jsonwith an./tuiexport, enabling installs viaopencode plugin add github:neoscaler/opencode-ai-usagebar. - The sidebar stays hidden when the
ai-usagebarcommand is not onPATH.
Install
./install.shor
opencode plugin add github:neoscaler/opencode-ai-usagebarv1.0.1
v1.0.0
First release.
Generic ai-usagebar provider sidebar for the OpenCode TUI. Runs ai-usagebar usage --json and renders every enabled provider.
- Quota windows as severity-coloured bars with reset countdown
- Balances as text rows
- Tariff/plan name when the provider reports one
- Per-provider glyph and accent colour
- Credential-shaped CLI text is redacted before rendering
Install with ./install.sh (requires the ai-usagebar CLI on PATH).