UsageButtons

module
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2026 License: MIT

README

UsageButtons

Stream Deck plugin that turns every AI-coding-assistant usage stat into a live button — session % remaining, weekly %, credits, reset countdowns, per-model quotas, and more. Each button renders a dynamic icon whose background fills (or de-fills) in proportion to the current value, so you can tell at a glance how much runway you have left.

Usage Buttons in Stream Deck

Inspired by CodexBar for macOS. Runs on Windows and macOS.

Settings

Each provider is its own action — drag Claude, Codex, Gemini, Vertex AI, etc. onto a key and configure the metric, colors, and thresholds from the Property Inspector.

Provider auth methods and selectable metrics are listed in docs/PROVIDERS.md.

Per-button settings Plugin-wide defaults
Button settings Plugin settings

Runtime

Written in Go. Compiles to a single static binary per platform — no runtime dependencies. End users just install the plugin; the Stream Deck software launches the binary directly.

  • Single binary, no runtime dependencies
  • Low memory footprint
  • Only external dep: coder/websocket

Repo layout

UsageButtons/
├── io.github.anthonybaldwin.UsageButtons.sdPlugin/  # Stream Deck plugin bundle
│   ├── manifest.json
│   ├── ui/                               # Property Inspector HTML
│   ├── assets/                           # icons shipped with the plugin
│   └── bin/                              # compiled binaries (gitignored)
├── cmd/
│   ├── plugin/                           # Go entry point
│   └── native-host/                      # Chrome native-messaging bridge
├── chrome-extension/                     # MV3 companion extension (fetch-proxy)
├── docs/                                 # landing page, screenshots, provider reference
├── internal/
│   ├── streamdeck/                       # SD WebSocket protocol
│   ├── render/                           # SVG button renderer + bbox
│   ├── cookies/                          # browser fetch-proxy client + bridge
│   ├── providers/                        # provider interface, cache, mock
│   │   ├── abacus/                       # Abacus AI (browser)
│   │   ├── alibaba/                      # Alibaba Coding Plan (browser/API key)
│   │   ├── amp/                          # Amp (browser)
│   │   ├── antigravity/                  # Antigravity (local language server)
│   │   ├── augment/                      # Augment (CLI/browser)
│   │   ├── claude/                       # Claude (OAuth + browser web API)
│   │   ├── codex/                        # Codex (OAuth)
│   │   ├── cookieaux/                    # cookie-gated provider messaging helpers
│   │   ├── copilot/                      # GitHub Copilot
│   │   ├── cursor/                       # Cursor (browser)
│   │   ├── factory/                      # Droid / Factory (browser/token)
│   │   ├── gemini/                       # Gemini CLI OAuth
│   │   ├── jetbrains/                    # JetBrains AI
│   │   ├── kilo/                         # Kilo
│   │   ├── kimi/                         # Kimi (browser/token)
│   │   ├── kimik2/                       # Kimi K2 (API key)
│   │   ├── kiro/                         # Kiro
│   │   ├── minimax/                      # MiniMax (browser/API key)
│   │   ├── mistral/                      # Mistral (browser)
│   │   ├── ollama/                       # Ollama (browser)
│   │   ├── opencode/                     # OpenCode (browser)
│   │   ├── opencodego/                   # OpenCode Go (browser)
│   │   ├── openrouter/                   # OpenRouter (API key)
│   │   ├── perplexity/                   # Perplexity (browser)
│   │   ├── synthetic/                    # Synthetic (API key)
│   │   ├── vertexai/                     # Vertex AI (gcloud ADC)
│   │   ├── warp/                         # Warp (GraphQL)
│   │   └── zai/                          # z.ai (API token)
│   ├── settings/                         # global + per-key settings
│   ├── icons/                            # provider SVG glyph paths
│   ├── update/                           # GitHub Releases update checker
│   └── httputil/                         # shared HTTP+JSON helpers
├── scripts/                              # build, release, icon generation
├── tmp/CodexBar/                         # upstream reference (gitignored)
├── CLAUDE.md                             # Claude-specific agent notes
├── AGENTS.md                             # shared agent instructions
└── README.md

Install

The full step-by-step lives on the landing page. Short version:

  1. Download the .streamDeckPlugin bundle for your OS from the latest release and double-click to install in Stream Deck.
  2. (Optional, for browser-backed providers) Grab UsageButtons-Helper-unpacked.zip from the same release, unzip it, and Load unpacked in chrome://extensions. The plugin auto-registers — nothing to configure.
  3. Drag a provider (Claude, Codex, Copilot, etc.) onto a Stream Deck key and pick a metric from the Property Inspector.

Build from source

git clone https://github.com/anthonybaldwin/UsageButtons.git
cd UsageButtons
go build -o io.github.anthonybaldwin.UsageButtons.sdPlugin/bin/plugin-win.exe ./cmd/plugin/
go build -o io.github.anthonybaldwin.UsageButtons.sdPlugin/bin/usagebuttons-native-host-win.exe ./cmd/native-host/
./scripts/install-dev.sh --restart

install-dev.sh junctions the .sdPlugin folder into Stream Deck's plugin directory so rebuilds take effect without reinstalling. Cross-compile with GOOS=darwin GOARCH=arm64 go build ... for macOS (and the same for the native host — releases build both arches via the release workflow).

Full dev workflow lives in AGENTS.md.

Releases

Cut via the manual release GitHub Action — no local git work:

gh workflow run release.yml --field bump=patch
gh workflow run release.yml --field bump=minor
gh workflow run release.yml --field bump=custom --field custom_version=0.4.0
gh workflow run release.yml --field bump=patch --field draft=true  # draft release

The workflow bumps both manifests, tags, builds plugin + native host for Windows + macOS (both arches), packages the Helper zip, and publishes the release with all three artifacts attached.

Usage Buttons Helper (required for browser-backed metrics)

Some providers sit behind browser sessions instead of public API keys. Usage Buttons ships a small Chrome extension — Usage Buttons Helper — in chrome-extension/ that proxies fetch() for the narrow allowlist used by those providers. Your usage reads happen through your real browser session; cookies never leave Chrome.

  • No credentials in the plugin. credentials: "include" + Chrome's native cookie jar. The plugin only sees API response bodies.
  • Narrow by design. Hardcoded to fetch only the provider origins in internal/cookies/allowed.go — enforced in the manifest's host_permissions AND again in the service worker at request time. No cookies permission, no broad host scope.
  • One-click install. The extension's ID is pinned by its public key, so the plugin auto-registers the native-messaging bridge on launch — download the release zip, Load Unpacked in chrome://extensions, done.
  • Providers that don't need it keep working unchanged — Gemini, Vertex AI, Copilot, OpenRouter, Warp, z.ai, Kimi K2, Synthetic, Kilo, Kiro, JetBrains AI, and Antigravity never require the extension.
  • Waits patiently on cold start. Cookie-gated buttons stay in a quiet "needs browser extension" state until the extension handshakes — so launching Stream Deck before Chrome doesn't trigger a 403 loop.

Install steps live in the Helper README. Works in any Chromium-based browser (Chrome, Edge, Brave, Chromium); a Firefox port is on the roadmap.

License

MIT · Third-party licenses

Directories

Path Synopsis
cmd
genkeys command
native-host command
Command native-host is the Chrome native-messaging bridge for the Usage Buttons Stream Deck plugin.
Command native-host is the Chrome native-messaging bridge for the Usage Buttons Stream Deck plugin.
plugin command
Usage Buttons — Stream Deck plugin entry point (Go).
Usage Buttons — Stream Deck plugin entry point (Go).
internal
cookies
Package cookies gives cookie-gated providers (Claude web extras, Cursor, Ollama) a way to call their Cloudflare-protected APIs through Chrome's actual network stack — without ever handling the user's cookies in-process.
Package cookies gives cookie-gated providers (Claude web extras, Cursor, Ollama) a way to call their Cloudflare-protected APIs through Chrome's actual network stack — without ever handling the user's cookies in-process.
httputil
Package httputil provides a thin HTTP+JSON helper for providers.
Package httputil provides a thin HTTP+JSON helper for providers.
icons
Package icons holds the SVG glyph data used to render provider logos on button faces.
Package icons holds the SVG glyph data used to render provider logos on button faces.
providers
Package providers defines the provider interface, snapshot types, and the provider registry.
Package providers defines the provider interface, snapshot types, and the provider registry.
providers/abacus
Package abacus implements the Abacus AI usage provider.
Package abacus implements the Abacus AI usage provider.
providers/alibaba
Package alibaba implements the Alibaba Coding Plan usage provider.
Package alibaba implements the Alibaba Coding Plan usage provider.
providers/amp
Package amp implements the Amp usage provider.
Package amp implements the Amp usage provider.
providers/antigravity
Package antigravity implements the Antigravity local language-server quota provider.
Package antigravity implements the Antigravity local language-server quota provider.
providers/augment
Package augment implements the Augment usage provider.
Package augment implements the Augment usage provider.
providers/claude
Package claude implements the Claude OAuth API usage provider.
Package claude implements the Claude OAuth API usage provider.
providers/codex
Package codex implements the Codex OAuth API usage provider.
Package codex implements the Codex OAuth API usage provider.
providers/cookieaux
Package cookieaux holds provider-facing helpers for the browser fetch-proxy path.
Package cookieaux holds provider-facing helpers for the browser fetch-proxy path.
providers/copilot
Package copilot implements the GitHub Copilot usage provider.
Package copilot implements the GitHub Copilot usage provider.
providers/cursor
Package cursor implements the Cursor usage provider.
Package cursor implements the Cursor usage provider.
providers/factory
Package factory implements the Factory Droid usage provider.
Package factory implements the Factory Droid usage provider.
providers/gemini
Package gemini implements the Gemini CLI OAuth usage provider.
Package gemini implements the Gemini CLI OAuth usage provider.
providers/jetbrains
Package jetbrains implements the JetBrains AI local quota provider.
Package jetbrains implements the JetBrains AI local quota provider.
providers/kilo
Package kilo implements the Kilo usage provider.
Package kilo implements the Kilo usage provider.
providers/kimi
Package kimi implements the Kimi usage provider.
Package kimi implements the Kimi usage provider.
providers/kimik2
Package kimik2 implements the Kimi K2 credits provider.
Package kimik2 implements the Kimi K2 credits provider.
providers/kiro
Package kiro implements the Kiro usage provider.
Package kiro implements the Kiro usage provider.
providers/minimax
Package minimax implements the MiniMax coding-plan usage provider.
Package minimax implements the MiniMax coding-plan usage provider.
providers/mistral
Package mistral implements the Mistral billing usage provider.
Package mistral implements the Mistral billing usage provider.
providers/ollama
Package ollama implements the Ollama usage provider.
Package ollama implements the Ollama usage provider.
providers/opencode
Package opencode implements the OpenCode usage provider.
Package opencode implements the OpenCode usage provider.
providers/opencodego
Package opencodego implements the OpenCode Go usage provider.
Package opencodego implements the OpenCode Go usage provider.
providers/openrouter
Package openrouter implements the OpenRouter API usage provider.
Package openrouter implements the OpenRouter API usage provider.
providers/perplexity
Package perplexity implements the Perplexity usage provider.
Package perplexity implements the Perplexity usage provider.
providers/providerutil
Package providerutil contains small helpers shared by quota-style providers.
Package providerutil contains small helpers shared by quota-style providers.
providers/synthetic
Package synthetic implements the Synthetic usage provider.
Package synthetic implements the Synthetic usage provider.
providers/vertexai
Package vertexai implements the Google Vertex AI quota provider.
Package vertexai implements the Google Vertex AI quota provider.
providers/warp
Package warp implements the Warp AI usage provider.
Package warp implements the Warp AI usage provider.
providers/zai
Package zai implements the z.ai usage provider.
Package zai implements the z.ai usage provider.
render
Package render produces SVG button faces for Stream Deck keys.
Package render produces SVG button faces for Stream Deck keys.
settings
Package settings manages global and per-key plugin settings.
Package settings manages global and per-key plugin settings.
streamdeck
Package streamdeck implements the Stream Deck SDK v2 WebSocket protocol.
Package streamdeck implements the Stream Deck SDK v2 WebSocket protocol.
update
Package update checks GitHub Releases for newer plugin versions.
Package update checks GitHub Releases for newer plugin versions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL