No description
  • QML 70%
  • Python 30%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Yarrith Devos 51dac92165 Add percentages on usage bars and OpenCode Zen balance
- Panel: overlay percentage on each limit bar (replace the separate
  right-aligned text); fix fill radius reference to the parent Item
- Add OpenCode Zen balance (from the workspace page, /workspace/<id>)
  shown at the bottom of the panel
- Move the fetcher out of inline QML Python (which had escaping/syntax
  issues and was silently failing) into opencode-go/fetch_usage.py;
  the widget now calls python3 fetch_usage.py which writes both Go
  usage and Zen balance to usage.json
- README: document new features and file layout
2026-09-02 20:33:15 +02:00
opencode-go Add percentages on usage bars and OpenCode Zen balance 2026-09-02 20:33:15 +02:00
.gitignore Initial commit: OpenCode Omarchy Plugin 2026-09-02 11:17:35 +00:00
config-template.json Refactor: desktop plugin (Omarchy) replacing TUI widget 2026-09-02 11:25:50 +00:00
fetch_usage.py Refactor: proper Omarchy QML plugin (not Hermes desktop plugin) 2026-09-02 12:40:56 +00:00
LICENSE Initial commit: OpenCode Omarchy Plugin 2026-09-02 11:17:35 +00:00
README.md Add percentages on usage bars and OpenCode Zen balance 2026-09-02 20:33:15 +02:00
SKILL.md Refactor: desktop plugin (Omarchy) replacing TUI widget 2026-09-02 11:25:50 +00:00

OpenCode Omarchy Plugin

Omarchy bar widget showing OpenCode Go subscription usage (5-hour rolling, Weekly, Monthly) in the status bar — click for a panel with percentage bars, reset timers, and your remaining OpenCode Zen balance.

Install

# On your desktop machine (where Omarchy runs)
git clone ssh://git@forgejo.vosjes.cloud/yarrith/Opencode-Omarchy-Plugin.git
cd Opencode-Omarchy-Plugin

# Install the plugin (one of these)
omarchy plugin add . --enable
# or manually:
mkdir -p ~/.config/omarchy/plugins/yarrith.opencode-usage
cp -r opencode-go/* ~/.config/omarchy/plugins/yarrith.opencode-usage/
omarchy-shell shell rescanPlugins
omarchy plugin enable yarrith.opencode-usage

Restart Omarchy or run omarchy-shell shell rescanPlugins.

Credentials

The widget reads from (in priority order):

  1. ~/.config/opencode-omarchy/opencode-usage.json
    { "workspace_id": "YOUR_ID", "auth_token": "YOUR_TOKEN" }
    
  2. ~/.config/opencode-usage-gui/session.db (credentials from the GUI app)

How to Get Credentials

  1. Open https://opencode.ai → sign in
  2. Navigate to https://opencode.ai/workspace/<your-id>/go
  3. DevTools (F12) → Application → Cookies → opencode.ai → copy auth cookie value

What it Shows

Period Bar chip Colors
5-hour 5h 67% Green < 60%, orange 60–90%, red ≥ 90%
Weekly Wee 45% (same thresholds)
Monthly Mon 12% (same thresholds)

Click the chip → panel with per-limit percentage bars, reset timers, and your OpenCode Zen balance at the bottom. Press R to refresh.

Settings

After install, configure in Omarchy → Setup → Plugins → OpenCode Go Usage:

  • Refresh interval — how often to re-fetch (default 5 min)
  • Workspace ID / Auth token — override the config file

Dependencies

  • requests Python library (for fetching):
    pip install requests
    # or
    uv pip install requests
    

Files

opencode-go/
├── manifest.json       # Omarchy plugin manifest
├── BarWidget.qml      # Bar widget (bar button + panel loader)
├── Panel.qml          # Popup panel (percentage bars, reset timers, Zen balance)
├── OpenCodeIcon.qml   # Monochrome bar icon
└── fetch_usage.py     # Fetcher: Go usage + Zen balance → ~/.local/state/omarchy/opencode-go/usage.json
fetch_usage.py          # Standalone CLI fetcher (optional)