Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenCode Usage Meter

A Hermes Agent Desktop status-bar plugin that shows your live OpenCode usage windows (rolling, weekly, monthly) with reset times.

Inspired by codex-usage-meter — the Codex counterpart for the same status bar.

Screenshot

OpenCode Usage Meter

Status-bar chip and the limits popover. Enjoy your DeepSeek ✨

Features

  • Status-bar chip with the OpenCode brand mark and the current remaining percentage
  • Popover with Rolling / Weekly / Monthly usage windows, each showing used %, remaining % and the reset time
  • 45s in-memory cache, 20s request timeout — no background polling loops
  • Lightweight i18n: UI follows the Desktop language (zh-CN auto-detected, English default)
  • Reads the key from your local ~/.hermes/.env; never stores or logs it

Requirements

  • Hermes Agent Desktop (the status bar is part of the Desktop app)
  • An OpenCode API key in ~/.hermes/.env (Go or Zen — the endpoint is account-wide, either works):
OPENCODE_GO_API_KEY=sk-...
# or
OPENCODE_ZEN_API_KEY=sk-...

Install

The backend follows the standard Hermes plugin layout (plugin.yaml + dashboard/), so install it from a local checkout:

hermes plugins install file:///path/to/opencode-usage-meter --enable

Then place the status-bar frontend:

mkdir -p ~/.hermes/desktop-plugins/opencode-usage-meter
cp desktop/plugin.js ~/.hermes/desktop-plugins/opencode-usage-meter/plugin.js

Finally restart Hermes Desktop. The frontend hot-reloads on file change; the backend route mounts at backend startup, so a restart is required once after installing.

How it works

  • The backend calls https://opencode.ai/zen/go/v1/usage with your key (a browser User-Agent is required — the endpoint is behind Cloudflare and blocks non-browser UAs with HTTP 403 / error 1010).
  • Usage is account-wide: the endpoint returns identical numbers for Zen and Go keys, so Zen/Go usage can't be queried separately — the popover shows one set of windows labeled GO.
  • Both parts fail closed: on any error the chip shows and the popover reports Data unavailable; no fake numbers are ever rendered.

Privacy

  • Direct HTTPS call to opencode.ai only — no third-party analytics, no telemetry
  • The API key is read from ~/.hermes/.env at request time and is never written to logs
  • No local attribution/session scanning (unlike the Codex meter)

License

MIT

About

OpenCode Zen/Go usage windows for the Hermes Desktop status bar

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages