Grok Usage
Headless collector that writes a Grok tab for the stock Omarchy Agents widget.
ID: vt.grok-usage
Author: Vitally Tezhe
License: MIT
Stock Omarchy already shows Claude, Codex, and Fireworks. This plugin does not
replace that widget. It runs in the background, writes
~/.local/state/omarchy/agents/usage/grok.json, and the first-party panel
picks the file up the same way it picks up any other agent record.
The collector is a JavaScript port of calmasacow/omarchy-grok-usage. Unofficial. Not affiliated with xAI or Omarchy.
Install
Grok Build must already be signed in (grok login), and a JavaScript runtime
(node or bun) must be available to omarchy-shell — on PATH, or as a
mise/user shim under ~/.local. Leave omarchy.agents in the bar.
omarchy plugin add https://github.com/vitally/omarchy-grok-usage.git --enable
Left-click the robot head. A Grok chip appears once the first write lands. The mark is the stock robot glyph: this plugin does not ship panel chrome.
Usage
The stock Agents panel is unchanged: left-click opens it, r refreshes
Claude/Codex/Fireworks. Grok refreshes on this service's timer (15 minutes,
matching the stock collectors) and once at shell start. A billing outage
retries after 30 seconds.
Force a Grok rewrite:
omarchy-shell vt.grok-usage refresh
Or run the collector yourself:
node scripts/omarchy-agent-usage-grok.js --write
Remove
omarchy plugin remove vt.grok-usage
rm -f "${XDG_STATE_HOME:-$HOME/.local/state}/omarchy/agents/usage/grok.json"
Removing the plugin stops writes; delete grok.json if you also want the
tab gone.
How it works
omarchy-agent-usage-update only scans $OMARCHY_PATH/bin, so a Grok
collector cannot live there. This service runs
scripts/omarchy-agent-usage-grok.js --write and drops grok.json in the
directory the stock panel already watches.
The collector reads ~/.grok/auth.json and asks the same CLI-proxy billing
endpoints Grok Build uses for /usage. That is the SuperGrok weekly pool,
plan name, and prepaid balance — the same meters /usage shows. Session
transcripts are not scanned, so the stock panel will not show tokens-by-day
or tokens-by-model for Grok.
Authenticated requests stay on cli-chat-proxy.grok.com and refuse
cross-origin redirects. Auth and cache files are opened as regular files
with a size cap (O_NOFOLLOW, O_NONBLOCK). No tokens are stored in this
repository.
| File | Role |
|---|---|
Service.qml |
Timer + runtime probe + collector process |
scripts/omarchy-agent-usage-grok.js |
SuperGrok billing probe |
Requirements
- Omarchy with the stock Agents widget
- Grok Build signed in (
grok login) nodeorbun(dependency-free script; no npm packages)
Tests
node test/collector.test.js
License
MIT. The collector is a JavaScript port of calmasacow/omarchy-grok-usage.