Skip to content

Releases: neoscaler/opencode-ai-usagebar

v2.0.3

Choose a tag to compare

@neoscaler neoscaler released this 26 Sep 17:40
28c9fa3

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

Choose a tag to compare

@neoscaler neoscaler released this 26 Sep 17:32
a1e994c

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

Choose a tag to compare

@neoscaler neoscaler released this 26 Sep 17:18
2d56c10

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

Choose a tag to compare

@neoscaler neoscaler released this 26 Sep 16:58
7bb1d40

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.json to 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.json with an ./tui export, enabling installs via opencode plugin add github:neoscaler/opencode-ai-usagebar.
  • The sidebar stays hidden when the ai-usagebar command is not on PATH.

Install

./install.sh

or

opencode plugin add github:neoscaler/opencode-ai-usagebar

v1.0.1

Choose a tag to compare

@neoscaler neoscaler released this 10 Sep 20:33
a456381

Fixes:

  • Render credit balances (e.g. OpenRouter Credit balance) as a text row instead of a quota bar. A pay-as-you-go credit pool is not a rate-limit quota.

v1.0.0

Choose a tag to compare

@neoscaler neoscaler released this 10 Sep 20:24
ff71743

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).