omnigauge 1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,36 @@
1
+ __pycache__/
2
+ *.pyc
3
+ *.db
4
+ last-scrape-*.txt
5
+ .venv/
6
+
7
+ # Design exploration — concept sheets, generator output, rejected marks, size
8
+ # tests. These are the trail, not the deliverable. The shipped art is the small
9
+ # set of logo-*.png / logo.svg / x-header-*.png files that are tracked.
10
+ assets/concept-*.png
11
+ assets/gen-*.png
12
+ assets/gk*.png
13
+ assets/mark-*.png
14
+ assets/mk-*.png
15
+ assets/refine-*.png
16
+ assets/finalists.png
17
+ assets/banner-*.png
18
+ assets/x-header-preview.png
19
+ assets/grok/
20
+ assets/grok-contact*.png
21
+ ops/__pycache__/
22
+ assets/concepts*.png
23
+ assets/*-sizetest.png
24
+ assets/master-C-*.png
25
+ assets/master-D-*.png
26
+ assets/logo-arcs.svg
27
+ assets/logo-bars.svg
28
+ assets/logo-level-ring.svg
29
+
30
+ # lane notes live outside the public repo
31
+ ops/HANDOFF.md
32
+
33
+ # packaging output
34
+ dist/
35
+ build/
36
+ *.egg-info/
omnigauge-1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 John E.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
omnigauge-1.0/PKG-INFO ADDED
@@ -0,0 +1,412 @@
1
+ Metadata-Version: 2.5
2
+ Name: omnigauge
3
+ Version: 1.0
4
+ Summary: Every AI plan and API account you pay for, on one screen - in your terminal. Plan quota, token volume, burn rate, time-to-reset, spend. Stdlib only.
5
+ Project-URL: Homepage, https://omnigauge.dev
6
+ Project-URL: Repository, https://github.com/omnigauge/omnigauge
7
+ Author: omnigauge
8
+ License: MIT
9
+ License-File: LICENSE
10
+ Keywords: ai,aider,claude,codex,goose,grok,openai,openrouter,quota,terminal,usage
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: POSIX
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Topic :: Utilities
17
+ Requires-Python: >=3.8
18
+ Description-Content-Type: text/markdown
19
+
20
+ <p align="center">
21
+ <img src="assets/x-header-1500x500.png" width="100%" alt="OmniGauge — every AI plan and API account you pay for, on one screen">
22
+ </p>
23
+
24
+ <p align="center">
25
+ <em>One gauge for every AI agent and API account you run.</em><br>
26
+ <sub>Plan quota · token volume · burn rate · exhaustion forecast · spend — in your terminal</sub>
27
+ </p>
28
+
29
+ <p align="center">
30
+ <a href="LICENSE"><img alt="MIT" src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
31
+ <img alt="python" src="https://img.shields.io/badge/python-3.8%2B-blue.svg">
32
+ <img alt="dependencies" src="https://img.shields.io/badge/dependencies-none-brightgreen.svg">
33
+ </p>
34
+
35
+
36
+ One dashboard for every AI plan and API account you pay for — **Claude Code**, **Codex**,
37
+ **Grok**, **Aider**, **Goose**, OpenAI, X, OpenRouter, Moonshot, DeepSeek — plan quota and token volume, side by side, in your terminal.
38
+
39
+ No keys for the part that matters — plan quota and token volume come from files
40
+ those tools already write to your disk, and from each CLI's own quota panel.
41
+ API dollar spend is optional and does need a key for whichever vendor you want
42
+ it from: stored 0600, never passed as an argument, refused outright if the file
43
+ is group- or world-readable. Leave spend off and no credential — and no network
44
+ call — is involved at all. No telemetry either way.
45
+
46
+ ```
47
+ ▐▌ OMNIGAUGE one gauge, every provider my-box · 20:31 UTC
48
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
49
+ ▲ codex is at 97% — 5d 15h to reset · tightest window
50
+
51
+ ╭─ PLAN QUOTA ────────────────────────────────────────── normalized to % consumed ╮
52
+ │ │
53
+ │ AGENT WINDOW USED RESETS IN READ │
54
+ │ ● claude week █████················· 24% 4d 13h now │
55
+ │ ○ claude/fable week ······················ 0% 4d 13h now │
56
+ │ ● claude session █····················· 5% 12:19am now │
57
+ │ ● codex week █████████████████████· 97% 5d 15h 7m │
58
+ │ vendor said "3% left" - inverted │
59
+ │ ○ codex/spark week ······················ 0% 7d 1h 7m │
60
+ │ vendor said "100% left" - inverted │
61
+ │ ● grok/x premium+ week ██████················ 26% 2d 8h 7m │
62
+ │ │
63
+ ╰── subscription windows · no dollar balance exists for these plans ──────────────╯
64
+
65
+ ╭─ TOKEN VOLUME ───────────────────────────────────────── local transcripts · 24h ╮
66
+ │ │
67
+ │ AGENT FILES MSGS OUTPUT THINK CACHE-RD INPUT TOTAL│
68
+ │ claude 5 3,806 4.66M 1.32M 2.02B 7.16K 2.03B│
69
+ │ codex 211 211 502.77M 229.01M 185.24B 193.51B 194.01B│
70
+ │ grok 3 3 0 0 0 0 4.26M│
71
+ │ │
72
+ ╰── not comparable to vendor counters · different denominators ───────────────────╯
73
+
74
+ ╭─ WHAT IS DRIVING USAGE ───────────────────────────────── reported by the vendor ╮
75
+ │ │
76
+ │ ▸ 100% of your usage came from sessions active for 8+ hours │
77
+ │ ▸ 99% of your usage was at >150k context │
78
+ │ ▸ 19% of your usage was while 4+ sessions ran in parallel │
79
+ │ │
80
+ ╰─────────────────────────────────────────────────────────────────────────────────╯
81
+ ```
82
+
83
+ ## What this does that the others don't
84
+
85
+ The local-tracker space is well served — [tokscale](https://github.com/junhoyeo/tokscale)
86
+ covers 50+ agents. Its own docs list what it does not do, and that list is this
87
+ project's reason to exist:
88
+
89
+ | | tokscale | enterprise SaaS | OmniGauge |
90
+ |---|---|---|---|
91
+ | token + quota tracking | ✅ | ✅ | ✅ |
92
+ | **burn rate & exhaustion forecast** | ❌ *"cannot predict"* | ✅ | ✅ |
93
+ | **budgets / alerts** | ❌ | ✅ | ✅ `--check`, exit-coded for cron |
94
+ | **non-agent APIs** (org billing, X) | ❌ | partial | ✅ |
95
+ | **multi-account per provider** | ❌ *"picks the active account"* | ✅ | ✅ |
96
+ | runs with no runtime installed | ❌ Node/Bun | ❌ cloud | ✅ stdlib Python |
97
+ | local-only, nothing transmitted | ✅ | ❌ | ✅ |
98
+
99
+ The question every tracker answers is *"how much have I used"*. The one that
100
+ matters is **"will I run out before it resets"** — and answering it needs the
101
+ quota series and the vendor's reset time together:
102
+
103
+ ```
104
+ codex week ████████████████████▌ 98% 1.4%/h 1h 26m 5d 1h
105
+ ▲ runs dry 4d 21h BEFORE the window resets
106
+ ```
107
+
108
+ Forecasting is deliberately conservative: two readings at least ten minutes
109
+ apart or it says nothing, a detected reset truncates the series, and a flat or
110
+ falling rate produces no estimate rather than a fabricated one.
111
+
112
+ ## Alerts
113
+
114
+ The part the incumbents disclaim. `omnigauge --check` evaluates every window,
115
+ notifies, and **exits with a code** so cron and CI can act on it:
116
+
117
+ ```bash
118
+ omnigauge --check # 0 = fine · 1 = warning · 2 = will run dry early
119
+ omnigauge --check --quiet # silent unless something fires
120
+ ```
121
+
122
+ ```
123
+ WARNING: codex at 98% of its week window, resets in 5d 0h
124
+ CRITICAL: codex runs dry in 1h 26m - 4d 21h BEFORE its window resets
125
+ ```
126
+
127
+ Every fifteen minutes, from cron:
128
+
129
+ ```cron
130
+ */15 * * * * $HOME/.local/bin/omnigauge --check --quiet >/dev/null 2>&1
131
+ ```
132
+
133
+ Configure in `~/.local/share/omnigauge/alerts.json`:
134
+
135
+ ```json
136
+ {
137
+ "pct_used": 85,
138
+ "dry_before_reset": true,
139
+ "notify": true,
140
+ "webhook": "https://hooks.example.com/…",
141
+ "quiet_hours": [23, 7]
142
+ }
143
+ ```
144
+
145
+ Desktop notifications use whatever exists — `notify-send`, `osascript`,
146
+ `wsl-notify-send.exe` — and failure is never fatal. A monitor that crashes the
147
+ cron job it runs inside is worse than no monitor.
148
+
149
+ ## Why the numbers are kept apart
150
+
151
+ This is the whole design, and it is deliberate.
152
+
153
+ **Codex reports percent *remaining*. Claude and Grok report percent *used*.** Shown raw side
154
+ by side, a Codex at "6%" looks healthier than a Claude at "23%" — when in fact Codex is
155
+ nearly exhausted and Claude has three quarters left. OmniGauge normalizes everything to
156
+ **percent consumed** and prints what the vendor actually said underneath, so you can check it.
157
+
158
+ **Token volume is not the vendors' token count.** Local transcripts record cache reads and
159
+ per-turn context re-sends; vendors count something narrower. The figures differ by orders of
160
+ magnitude and neither is wrong — they have different denominators. OmniGauge shows both
161
+ kinds of number and never adds them together or reconciles them into one total.
162
+
163
+ **Subscriptions have no dollar balance**, so none is shown. Plan usage and API spend are
164
+ different products; blending them into one "remaining" figure would be fiction.
165
+
166
+ ## Quickstart
167
+
168
+ ```bash
169
+ git clone https://github.com/omnigauge/omnigauge.git && cd omnigauge
170
+ ./install.sh
171
+ omnigauge --doctor # what is connected, what is missing, how to fix it
172
+ omnigauge --refresh # pull your plan quota (~30s per agent)
173
+ omnigauge # the board — press ? for keys
174
+ ```
175
+
176
+ `--doctor` is the one to run first. It checks each agent CLI, tells you whether
177
+ quota has ever been collected, shows which optional API credentials are set, and
178
+ prints the exact next command for every gap. Nothing else needs to be memorised.
179
+
180
+ ## Stores on another drive
181
+
182
+ Transcripts do not have to live in `~`. If yours sit on a dev SSD, a second
183
+ profile, or anywhere else, point at the HOME-like directory that *contains* the
184
+ stores (`.claude`, `.codex`, …): one path per line in
185
+ `~/.local/share/omnigauge/roots`, or `OMNIGAUGE_ROOTS` (path-separated).
186
+ `omnigauge --scan-roots` hunts mounted drives for stores discovery is not
187
+ already reading and prints the exact line to add.
188
+
189
+ Roots are scanned like a second home. When the drive is unplugged, the board
190
+ and `--check` say its history is excluded this run — the numbers never just
191
+ quietly shrink — and `--doctor` shows every root as mounted or missing.
192
+
193
+ ## Install
194
+
195
+ Requires Python 3.8+ and `tmux` (only for quota scraping).
196
+
197
+ ```bash
198
+ git clone https://github.com/omnigauge/omnigauge.git
199
+ install -m755 omnigauge/omnigauge ~/.local/bin/omnigauge
200
+ omnigauge --refresh
201
+ ```
202
+
203
+ You stay logged in through your own CLIs — OmniGauge never sees or stores a credential.
204
+ It only works for accounts *you* are already signed into on that machine.
205
+
206
+ ## Usage
207
+
208
+ Run it bare in a terminal and it is **interactive** — no flags to remember:
209
+
210
+ ```
211
+ r refresh · w watch · t ink · s 24h · b full · ? help · q quit
212
+ ```
213
+
214
+ | Key | Does |
215
+ |---|---|
216
+ | `r` | refresh quota, all agents |
217
+ | `1` `2` `3` | refresh claude / codex / grok only |
218
+ | `w` | watch mode — auto redraw |
219
+ | `t` | cycle theme |
220
+ | `s` | cycle window (24h · 7d · 30d · today · all) |
221
+ | `b` | brief — hide lifetime and by-model |
222
+ | `l` | providers legend — what each source gets, and cannot |
223
+ | `d` | doctor |
224
+ | `y` | why this exists |
225
+ | `p` | privacy — what it refuses to do |
226
+ | `a` | about |
227
+ | `g` | donate |
228
+ | `?` | key help |
229
+ | `q` | quit |
230
+
231
+ Piped, redirected or given any flag, it prints once and exits, so scripts are
232
+ unaffected. `--once` forces that explicitly.
233
+
234
+ ```bash
235
+ omnigauge # interactive board
236
+ omnigauge --once # print and exit
237
+ omnigauge --refresh # re-scrape quota from every installed CLI (~30s each)
238
+ omnigauge --refresh claude # just one
239
+ omnigauge --lifetime # all-time totals (incremental cache)
240
+ omnigauge --since 7d # 24h | 7d | 30d | today | all
241
+ omnigauge --watch # live redraw, 10s
242
+ omnigauge --watch 5 --quota-every 10m
243
+ omnigauge --json # machine-readable
244
+ omnigauge --providers # the legend: what each source gets, could get,
245
+ # and cannot get - with the reasons
246
+ omnigauge --no-color
247
+ ```
248
+
249
+ ### Two clocks
250
+
251
+ Token volume is read from local files (~2s) and can update every few seconds. Plan quota
252
+ requires launching the vendor's TUI and reading its panel — ~30s per agent, and it spawns a
253
+ real session — so it is cached and refreshed on a slow clock. Every quota row shows its own
254
+ age, so a stale number looks stale.
255
+
256
+ ## How it gets the numbers
257
+
258
+ | Agent | Quota | Tokens |
259
+ |---|---|---|
260
+ | Claude Code | `/usage` panel | `~/.claude/projects/*/*.jsonl` → per-message `usage` |
261
+ | OpenAI Codex | `/status` panel | rollout `info.total_token_usage` |
262
+ | Grok CLI | `/usage` panel | session `updates.jsonl` → `totalTokens` |
263
+ | Goose | — (key-based) | `sessions.db` → `usage_ledger`, the vendor's own accounting |
264
+ | Aider | — (key-based) | `.aider.chat.history.md` token lines, in the project roots you name via `OMNIGAUGE_AIDER_DIRS` |
265
+
266
+ Quota panels are rendered under `tmux` and read back with `capture-pane`. These CLIs draw
267
+ character-by-character with cursor moves; stripping ANSI from a raw pty gives you garbage.
268
+ tmux is a real terminal emulator, so it does the rendering and OmniGauge reads the finished
269
+ screen.
270
+
271
+ On WSL, Codex keeps **two separate stores** — `~/.codex` and `/mnt/c/Users/<you>/.codex`.
272
+ Both are discovered. Searching only one and concluding "nothing here" is a real trap.
273
+
274
+ ## Workspace trust
275
+
276
+ Launching Claude in a directory it has not seen raises a blocking trust prompt, which
277
+ swallows the keystrokes. OmniGauge **will not auto-accept it** — trusting a folder is a
278
+ real security decision and it persists. It instead reuses a directory the CLI has
279
+ demonstrably run in before, read from Claude's own session registry, and detects the dialog
280
+ explicitly if one still appears. Override with `--cwd DIR`.
281
+
282
+ ## When a parse fails
283
+
284
+ Vendor TUIs change. OmniGauge treats a partial parse as a failure, because a plausible
285
+ number with the headline missing is worse than no number:
286
+
287
+ ```
288
+ claude scraping… PARTIAL — 2 row(s), missing [('week', 'all')]
289
+ raw screen → ~/.local/share/omnigauge/last-scrape-claude.txt
290
+ ```
291
+
292
+ Each agent declares the windows it must produce. Miss one and you get a loud warning plus the
293
+ raw screen dumped for inspection. Stale rows are never silently reused as fresh.
294
+
295
+ ## Storage
296
+
297
+ Everything lives in `${XDG_DATA_HOME:-~/.local/share}/omnigauge/` (override with
298
+ `OMNIGAUGE_HOME`):
299
+
300
+ - `usage.db` — SQLite. `snapshots` keeps normalized quota with the vendor's raw string and a
301
+ `collected_at`; `filecache` makes lifetime totals incremental so a 140 GB rollout corpus is
302
+ never rescanned; `insights` keeps the vendor's own "what is driving usage" notes.
303
+
304
+ Nothing leaves the machine.
305
+
306
+ ## API spend and credits (optional)
307
+
308
+ Separate panel, separate product — never merged into plan quota. A subscription
309
+ window is a time-based percentage; these are real money.
310
+
311
+ | Source | What you get | Credential |
312
+ |---|---|---|
313
+ | OpenAI | 30-day spend, requests, tokens | **Admin** key, Restricted, `Usage API Scope = Read` |
314
+ | X / Twitter | post consumption against your project cap | app Bearer Token, one per account |
315
+ | OpenRouter | credit dollars used, and % of the key's limit when one is set | API key |
316
+ | Moonshot / Kimi | available balance (blocks inference at zero) | API key |
317
+ | DeepSeek | total balance, per currency | API key |
318
+
319
+ ```bash
320
+ omnigauge --setup # hidden input, written 0600, refuses to read looser modes
321
+ ```
322
+
323
+ Two things worth knowing:
324
+
325
+ **Checking X usage does not consume your post cap.** Verified empirically rather
326
+ than from documentation — two consecutive calls to `/2/usage/tweets` left
327
+ `project_usage` unchanged. It has its own limit of 50 per window, so it is polled
328
+ on the slow clock, never per redraw.
329
+
330
+ **X dollar balances are console-only.** The developer console shows a balance;
331
+ no public endpoint for it has been found, so OmniGauge reports post consumption
332
+ and leaves the money figure to the console rather than inventing one.
333
+
334
+ ## Not implemented, on purpose
335
+
336
+ **API dollar spend.** OpenAI (`/v1/organization/costs`) and Anthropic (`/v1/organization/cost_report`)
337
+ both expose real spend, but they need an org **admin** key — a credential worth more than this
338
+ tool. The schema already carries `cost_usd` and a `source` column, so it is a clean addition if
339
+ you want it. It would be a separate panel, never merged into plan quota.
340
+
341
+
342
+ ## Donations
343
+
344
+ Optional, and it changes nothing about the tool — OmniGauge is MIT and always
345
+ will be, with no paid tier and no telemetry.
346
+
347
+ **Solana:** `HDDEfcYnLh4w8yG5Rn8chcm15xo1LavkvtRGeTRGAUGE`
348
+
349
+ If you get more use out of this than it cost you to read the source, that is
350
+ already the trade working.
351
+
352
+ **There will be no OmniGauge token from the developer of OmniGauge.** No presale, no airdrop, no community
353
+ round, no Phase 3. You can launch one — someone always does. The ask is
354
+ **creator fees plus 3% of supply** to the address above, and the token socials
355
+ pointed at [@OmniGauge](https://x.com/OmniGauge) and omnigauge.dev — the only two
356
+ places this project exists. What you may not do is LARP as this project
357
+ while you do it: no "official", no borrowed name, no invented team. Launch your
358
+ own thing and be honest that it is yours.
359
+
360
+ **X is the only place OmniGauge exists.** No Discord, no Telegram, no Reddit, no
361
+ group chat, no "community". If something calls itself OmniGauge anywhere other
362
+ than [@OmniGauge](https://x.com/OmniGauge) or omnigauge.dev, it is not us.
363
+
364
+ **If you do launch one, come and say so.** The email on the GitHub profile is the
365
+ channel that counts. If it checks out — you are not a known scammer, and you met
366
+ the terms above instead of pretending to be us — there is a good chance the
367
+ contract address ends up on this page. A listing is not an endorsement. DYOR.
368
+
369
+
370
+ ## Contributing
371
+
372
+ Pull requests are open to anyone — you do not need permission, an invite, or to
373
+ ask first. Fork it, change it, open a PR.
374
+
375
+ The shape of this project is that **adding a source is one file**. If you use a
376
+ tool this does not read yet, the whole job is a single file in `providers/` that
377
+ answers four questions: are you installed, where are your files, how many tokens,
378
+ and what does your quota panel say. Eight providers ship as worked examples in
379
+ `providers/` — five agents (`claude.py`, `codex.py`, `grok.py`, `aider.py`, `goose.py`)
380
+ and three spend sources — each a different parsing shape; copy the closest one.
381
+
382
+ [CONTRIBUTING.md](CONTRIBUTING.md) has the contract, the three rules that are not
383
+ style preferences, and what gets rejected. Read the last one before you start —
384
+ it will save you the work.
385
+
386
+ Everything here is MIT. Your contribution comes in under the same licence, and
387
+ you keep the copyright to what you wrote.
388
+
389
+ **Not a Python person?** Chip in a Sol or two instead. It buys you nothing — no
390
+ tier, no badge, no priority support, no role in a Discord that does not exist —
391
+ which is precisely what makes it a donation and not a purchase. Details under
392
+ [Donations](#donations), and the address is right there in the terminal too:
393
+ `omnigauge` → press `F7`.
394
+
395
+ ## Contact
396
+
397
+ - Bugs and provider requests → [issues](../../issues)
398
+ - Security → **security@omnigauge.dev** (see [SECURITY.md](SECURITY.md))
399
+ - Anything else → **dev@omnigauge.dev**
400
+
401
+ ## Authorship
402
+
403
+ Written end to end by **Claude Opus 5.0** — every line of the CLI, the provider
404
+ contract, the site, and this document. Maintained since by **Claude Fable 5**.
405
+
406
+ A usage meter for AI tools, written by one. The source is right there either way.
407
+
408
+ ## Licence
409
+
410
+ MIT. Use it, fork it, ship it. The code is yours under that licence — and with it
411
+ the look, which anyone may imitate. The name, the mark and the files under `assets/`
412
+ are not part of the grant — see [TRADEMARK.md](TRADEMARK.md) and `assets/LICENSE`.