Keep an eye on your Command Code subscription without leaving the bar: the 5-hour, weekly and monthly spend windows, the reset countdowns, your plan and your remaining prepaid credits, all as a native tab in the Omarchy agents panel.
No extra tooling, no API key to paste, no background daemon. The plugin reads the credential your Command Code CLI already stored, asks Command Code's own billing API for your usage, and writes one record the panel picks up.
- Session (5h) and Weekly meters — dollars spent against each rolling cap, with live "resets in" countdowns.
- Monthly allowance — the plan's credit pool drawn down for the billing period, resetting at your next renewal.
- Prepaid credits balance — remaining of funded, updated automatically.
- Plan-aware — knows GOAT, Pro, Go, Max, Ultra and Teams tiers, and shows the matching label.
- Omarchy, with the
omarchy.agentsbar widget in your layout. - A signed-in Command Code CLI — the same login the
commandcodeCLI uses. python3(already present on Omarchy).
omarchy plugin add https://github.com/fsavoia/omarchy-commandcode.git --enableThat is the whole setup. Sign in to Command Code once with the official CLI and the tab appears; if you are not signed in, the plugin writes nothing and the panel simply shows no Command Code tab.
Credentials are reused, never issued, and only ever read. The plugin looks, in order, at:
COMMANDCODE_API_KEYin the environment, if set;~/.commandcode/auth.json(the official CLI's own file);~/.pi/agent/auth.jsonunder thecommand-code/commandcodekey.
It never refreshes a token or writes a file back — that belongs to the CLI that owns the credential. An expired token is reported as such instead of being silently overwritten.
bin/commandcode-collectcalls Command Code's billing API over HTTPS with your bearer token:GET /alpha/whoami— account/org scope,GET /alpha/billing/credits— the five-hour and weekly spend windows plus the credit ledger,GET /alpha/billing/subscriptions— the plan and billing period end.
- It maps that into the agents-panel record format (
limits[]from the windows,balancefrom the ledger) and writes~/.local/state/omarchy/agents/usage/commandcode.jsonatomically. ui/main.qmlruns the collector every 5 minutes and at startup.- Nothing outside
~/.local/state/omarchy/agents/usage/is touched.
dell.commandcode-usage writes the same commandcode.json from local session
stats. Run one or the other: this plugin owns the quota and credits, that one
owns the local token charts. Remove it with
omarchy plugin remove dell.commandcode-usage.
~/.config/omarchy/plugins/fsavoia.commandcode-usage/bin/commandcode-collect # print the record
~/.config/omarchy/plugins/fsavoia.commandcode-usage/bin/commandcode-collect --write
jq . ~/.local/state/omarchy/agents/usage/commandcode.json
omarchy plugin validate ~/.config/omarchy/plugins/fsavoia.commandcode-usage
omarchy-shell shell rescanPluginsomarchy plugin remove fsavoia.commandcode-usage
rm ~/.local/state/omarchy/agents/usage/commandcode.jsonRemoving the plugin stops the collector; deleting the record drops the tab.
MIT
