UsageButtons

module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 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, Copilot, etc. onto a key and configure the metric, colors, and thresholds from the Property Inspector.

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: gorilla/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
├── internal/
│   ├── streamdeck/                       # SD WebSocket protocol
│   ├── render/                           # SVG button renderer + bbox
│   ├── providers/                        # provider interface, cache, mock
│   │   ├── claude/                       # Claude (OAuth + cookie web API)
│   │   ├── codex/                        # Codex (OAuth)
│   │   ├── copilot/                      # GitHub Copilot
│   │   ├── cursor/                       # Cursor (cookie)
│   │   ├── openrouter/                   # OpenRouter (API key)
│   │   ├── warp/                         # Warp (GraphQL)
│   │   ├── zai/                          # z.ai (API token)
│   │   └── kimik2/                       # Kimi K2 (API key)
│   ├── 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

Build from source

Windows
  1. Install Go
  2. go build -o io.github.anthonybaldwin.UsageButtons.sdPlugin/bin/plugin-win.exe ./cmd/plugin/
  3. ./scripts/install-dev.sh --restart — junctions the .sdPlugin folder into %APPDATA%\Elgato\StreamDeck\Plugins\ and relaunches Stream Deck
  4. Drag a provider (e.g. Claude, Codex, Copilot) onto a key and pick a metric from the Property Inspector
macOS
  1. Install Go
  2. GOOS=darwin GOARCH=arm64 go build -o io.github.anthonybaldwin.UsageButtons.sdPlugin/bin/plugin-mac ./cmd/plugin/
  3. ./scripts/install-dev.sh --restart
  4. Same Property Inspector flow as Windows

Cross-compilation from Windows: GOOS=darwin GOARCH=arm64 go build ...

Full dev workflow lives in AGENTS.md.

License

MIT · Third-party licenses

Directories

Path Synopsis
cmd
plugin command
Usage Buttons — Stream Deck plugin entry point (Go).
Usage Buttons — Stream Deck plugin entry point (Go).
internal
httputil
Package httputil provides a thin HTTP+JSON helper for providers.
Package httputil provides a thin HTTP+JSON helper for providers.
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/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/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/kimik2
Package kimik2 implements the Kimi K2 credits provider.
Package kimik2 implements the Kimi K2 credits provider.
providers/openrouter
Package openrouter implements the OpenRouter API usage provider.
Package openrouter implements the OpenRouter API usage 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