Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 134 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ native-tls = "0.2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
dirs = "6"
regex = "1"
rusqlite = { version = "0.32", features = ["bundled"] }
libsqlite3-sys = { version = "0.30", features = ["bundled"] }

[dependencies.windows]
version = "0.58"
Expand Down
51 changes: 46 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@

![Screenshot](.github/animation.gif)

A lightweight Windows taskbar widget for people already using Claude Code, with optional Codex and Google Antigravity usage display.
A lightweight Windows taskbar widget for people already using Claude Code, with optional Codex, Google Antigravity, and OpenCode Go usage display.

It sits in your taskbar and shows how much of your Claude Code, Codex, and/or Antigravity usage window you have left, without needing to open the terminal or the provider site.
It sits in your taskbar and shows how much of your Claude Code, Codex, Antigravity, and/or OpenCode Go usage window you have left, without needing to open the terminal or the provider site.

## What You Get

- A **5h** bar for your current 5-hour Claude usage window
- A **7d** bar for your current 7-day window
- Optional Codex usage bars alongside Claude Code
- Optional Antigravity model usage bars for Google's 5-hour and weekly Gemini quota windows
- Optional OpenCode Go usage bars for your local 5-hour and weekly dollar limits
- A live countdown until each limit resets
- A small native widget that lives directly in the Windows taskbar
- System tray icon badges showing your enabled model usage percentage
Expand All @@ -30,6 +31,41 @@ Codex support is optional. To show Codex usage, install and sign in to the Codex

Antigravity support is optional too. To show Antigravity usage, install and sign in to Google Antigravity, then enable the **Antigravity** model from the right-click **Models** menu.

OpenCode Go support is also optional. To show OpenCode Go usage, install [OpenCode](https://opencode.ai) and sign in to a [Go](https://opencode.ai/go) subscription. Then enable **OpenCode** from the right-click **Models** menu.

**Recommended — dashboard credentials (server-side accuracy):** the monitor reads your real Go usage (5h and weekly windows, with server-side reset times) from the OpenCode dashboard at `https://opencode.ai/workspace/<wrk_id>/go`. To do this it needs the `auth` cookie from an `opencode.ai` browser session and the workspace ID shown in the dashboard URL.

Provide them in one of these ways (highest priority first):

1. Environment variables:

```powershell
setx OPENCODE_GO_WORKSPACE_ID "wrk_01..."
setx OPENCODE_GO_AUTH_COOKIE "eyJhbGciOi..."
```

2. A config file at any of these paths (the first one that exists is used):

- `%APPDATA%\opencode-go\config.json` (Windows-friendly default)
- `%XDG_CONFIG_HOME%\opencode-bar\opencode-go.json`
- `%XDG_CONFIG_HOME%\opencode-quota\opencode-go.json`
- `~\.config\opencode-bar\opencode-go.json`
- `~\.config\opencode-quota\opencode-go.json`
- `%OPENCODE_GO_CONFIG_FILE%` (override)

The file is JSON with these keys (aliases accepted: `workspaceId`/`workspaceID`/`workspace_id` and `authCookie`/`auth_cookie`/`cookie`):

```json
{
"workspaceId": "wrk_01...",
"authCookie": "eyJhbGciOi..."
}
```

To grab the values: sign in to `https://opencode.ai/go` in your browser, copy the `auth` cookie (DevTools → Application → Cookies → `https://opencode.ai`), and copy the workspace ID from the URL (`/workspace/<wrk_id>/go`).

**Fallback — local SQLite (no setup required):** if the dashboard credentials above are not configured, the monitor falls back to reading the local OpenCode SQLite database at `$OPENCODE_DB` (if set), then `%USERPROFILE%\.local\share\opencode\opencode.db`, then `%APPDATA%\opencode\opencode.db`. The database is opened in `SQLITE_OPEN_READ_ONLY` mode and never written to. This reflects only this machine's session costs, not your full Go subscription across devices, and the reset countdowns show 5h and 7d windows from the current poll time (since the local DB has no server-side reset signal).

It works best if you want a simple "how close am I to the limit?" display that is always visible.

## Requirements
Expand All @@ -38,6 +74,7 @@ It works best if you want a simple "how close am I to the limit?" display that i
- Claude Code (CLI or App) installed and authenticated
- Optional: Codex CLI installed and authenticated, if you want Codex usage
- Optional: Google Antigravity installed and authenticated, if you want Antigravity usage
- Optional: OpenCode installed and signed in to a Go subscription, if you want OpenCode Go usage

If you use Claude Code through WSL, that is supported too. The monitor can read your Claude Code credentials from Windows or from your WSL environment.

Expand Down Expand Up @@ -74,6 +111,7 @@ Use the right-click **Models** menu to choose what the widget displays:
- **Claude Code** is enabled by default
- **Codex** can be enabled alongside Claude Code or shown by itself
- **Antigravity** can be enabled alongside the other providers or shown by itself as its own model column
- **OpenCode** can be enabled alongside the other providers. With dashboard credentials configured, the bars reflect your full Go subscription with server-side reset times. Without dashboard credentials, the monitor falls back to this machine's local OpenCode sessions (5h and weekly windows from the current poll time, since the local DB has no server-side reset signal).

When multiple models are shown, each model has its own usage bar and matching usage text color. Antigravity prefers Google's Gemini quota summary when available and falls back to model quota data when needed.

Expand All @@ -83,7 +121,7 @@ The tray icon shows your current 5-hour usage as a percentage badge.

If multiple providers are enabled, the app shows one tray icon per provider. If only one model is enabled, it shows one tray icon.

The Claude Code tray icon uses the same warm usage colors as the Claude bar. The Codex tray icon uses a black and white badge style. The Antigravity tray icon uses a blue badge style.
The Claude Code tray icon uses the same warm usage colors as the Claude bar. The Codex tray icon uses a black and white badge style. The Antigravity tray icon uses a blue badge style. The OpenCode tray icon uses a green badge style.

Hovering over a tray icon shows the usage values for that model.

Expand Down Expand Up @@ -128,6 +166,7 @@ What the app reads:
- If needed, the same credentials file inside an installed WSL distro
- If Codex is enabled, your local Codex credentials from `$CODEX_HOME/auth.json` or `~/.codex/auth.json`
- If Antigravity is enabled, your local Antigravity OAuth token from Windows Credential Manager target `gemini:antigravity`
- If OpenCode Go is enabled, either your OpenCode Go usage from the `https://opencode.ai/workspace/<wrk_id>/go` dashboard (with a session cookie), or, as a fallback, your local OpenCode SQLite session database (read-only) to compute local Go spend. The dashboard path uses server-side reset times; the local path opens the database in `SQLITE_OPEN_READ_ONLY` mode and never writes to it.

What the app sends over the network:

Expand All @@ -154,21 +193,23 @@ What it does **not** do:
- It does not collect analytics or telemetry
- It does not upload your project files
- It does not directly edit your Codex credentials file
- It does not write to your OpenCode account or any local files; OpenCode Go usage is fetched read-only from the public OpenCode dashboard, or read directly from the local OpenCode SQLite database in read-only mode

Notes:

- If your Claude Code token is expired, the app may ask the local Claude CLI to refresh it in the background
- If your Codex token is expired, the app may ask the local Codex CLI to refresh it in the background. The monitor does not write `auth.json` itself; any credential update is handled by the Codex CLI.
- If your Antigravity token is expired, open Antigravity and sign in again. The monitor does not write Windows Credential Manager entries itself.
- OpenCode Go usage is read from the OpenCode dashboard and reflects your full Go subscription, not just this machine's local sessions.
- Portable installs can update themselves by downloading the latest release from this repository
- Proxies should be trusted because proxied usage requests include your OAuth bearer token inside the TLS connection

## How It Works

The monitor:

1. Finds your enabled model login credentials
2. Reads your current usage from Anthropic, ChatGPT, and/or Google's Antigravity endpoints
1. Finds your enabled model login credentials (or, for OpenCode Go, your dashboard session cookie and workspace ID, or the local database)
2. Reads your current usage from Anthropic, ChatGPT, Google's Antigravity endpoints, the OpenCode Go dashboard, and/or the local OpenCode database
3. Shows the result directly in the Windows taskbar
4. Keeps the widget aligned with the selected taskbar and tray area
5. Refreshes periodically in the background
Expand Down
4 changes: 4 additions & 0 deletions src/localization/dutch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub(super) const STRINGS: Strings = Strings {
claude_code_model: "Claude Code",
codex_model: "Codex",
antigravity_model: "Antigravity",
opencode_model: "OpenCode",
settings: "Instellingen",
start_with_windows: "Opstarten met Windows",
reset_position: "Positie herstellen",
Expand Down Expand Up @@ -44,7 +45,10 @@ pub(super) const STRINGS: Strings = Strings {
codex_token_expired_body: "Voer 'codex' uit in een terminal en volg de aanmeldstappen. Ververs of herstart de app daarna.",
antigravity_token_expired_title: "Antigravity-authenticatiefout",
antigravity_token_expired_body: "Open Antigravity en meld je opnieuw aan. Ververs of herstart de app daarna.",
opencode_token_expired_title: "OpenCode niet gevonden",
opencode_token_expired_body: "Voer OpenCode minstens één keer uit zodat de lokale database bestaat, of stel OPENCODE_GO_WORKSPACE_ID en OPENCODE_GO_AUTH_COOKIE in voor volledige abonnementsregistratie. Zie de README. Ververs of herstart de app daarna.",
codex_window_title: "Codex-gebruiksmonitor",
antigravity_window_title: "Antigravity-gebruiksmonitor",
opencode_window_title: "OpenCode-gebruiksmonitor",
second_suffix: "s",
};
4 changes: 4 additions & 0 deletions src/localization/english.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub(super) const STRINGS: Strings = Strings {
claude_code_model: "Claude Code",
codex_model: "Codex",
antigravity_model: "Antigravity",
opencode_model: "OpenCode",
settings: "Settings",
start_with_windows: "Start with Windows",
reset_position: "Reset Position",
Expand Down Expand Up @@ -44,7 +45,10 @@ pub(super) const STRINGS: Strings = Strings {
codex_token_expired_body: "Run 'codex' in a terminal and follow the sign-in prompts. After that, refresh or restart this app.",
antigravity_token_expired_title: "Antigravity Auth Error",
antigravity_token_expired_body: "Open Antigravity and sign in again. After that, refresh or restart this app.",
opencode_token_expired_title: "OpenCode Not Found",
opencode_token_expired_body: "Run OpenCode at least once so the local database exists, or set OPENCODE_GO_WORKSPACE_ID and OPENCODE_GO_AUTH_COOKIE for full subscription tracking. See the README. After that, refresh or restart this app.",
codex_window_title: "Codex Usage Monitor",
antigravity_window_title: "Antigravity Usage Monitor",
opencode_window_title: "OpenCode Usage Monitor",
second_suffix: "s",
};
4 changes: 4 additions & 0 deletions src/localization/french.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub(super) const STRINGS: Strings = Strings {
claude_code_model: "Claude Code",
codex_model: "Codex",
antigravity_model: "Antigravity",
opencode_model: "OpenCode",
settings: "Paramètres",
start_with_windows: "Démarrer avec Windows",
reset_position: "Réinitialiser la position",
Expand Down Expand Up @@ -44,7 +45,10 @@ pub(super) const STRINGS: Strings = Strings {
codex_token_expired_body: "Executez 'codex' dans un terminal et suivez les instructions de connexion. Ensuite, actualisez ou redemarrez cette application.",
antigravity_token_expired_title: "Erreur d'authentification Antigravity",
antigravity_token_expired_body: "Ouvrez Antigravity et reconnectez-vous. Ensuite, actualisez ou redemarrez cette application.",
opencode_token_expired_title: "OpenCode introuvable",
opencode_token_expired_body: "Lancez OpenCode au moins une fois pour que la base locale existe, ou definissez OPENCODE_GO_WORKSPACE_ID et OPENCODE_GO_AUTH_COOKIE pour le suivi complet de l'abonnement. Consultez le README. Ensuite, actualisez ou redemarrez cette application.",
codex_window_title: "Moniteur d'utilisation Codex",
antigravity_window_title: "Moniteur d'utilisation Antigravity",
opencode_window_title: "Moniteur d'utilisation OpenCode",
second_suffix: "s",
};
Loading