{"id":48146106,"url":"https://github.com/hitheshkaranth/opentokenmonitor","last_synced_at":"2026-04-28T03:01:11.777Z","repository":{"id":341350203,"uuid":"1169749090","full_name":"Hitheshkaranth/OpenTokenMonitor","owner":"Hitheshkaranth","description":"OpenTokenMonitor is a lightweight, local-first desktop widget for tracking AI CLI usage across Claude, Codex, and Gemini. It helps developers monitor activity, usage trends, and costs in real time through a clean desktop interface, with optional live API data and a privacy-first local setup.","archived":false,"fork":false,"pushed_at":"2026-03-27T17:40:18.000Z","size":14465,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-04T17:55:58.989Z","etag":null,"topics":["ai-tools","desktop-widgets","token-monitor","usage-tracking"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hitheshkaranth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-01T06:28:41.000Z","updated_at":"2026-03-27T17:05:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"da6bb80d-b339-4def-853b-1ec779d8bab7","html_url":"https://github.com/Hitheshkaranth/OpenTokenMonitor","commit_stats":null,"previous_names":["hitheshkaranth/opentokenmonitor"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/Hitheshkaranth/OpenTokenMonitor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hitheshkaranth%2FOpenTokenMonitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hitheshkaranth%2FOpenTokenMonitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hitheshkaranth%2FOpenTokenMonitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hitheshkaranth%2FOpenTokenMonitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hitheshkaranth","download_url":"https://codeload.github.com/Hitheshkaranth/OpenTokenMonitor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hitheshkaranth%2FOpenTokenMonitor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32364093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-tools","desktop-widgets","token-monitor","usage-tracking"],"created_at":"2026-04-04T17:00:04.139Z","updated_at":"2026-04-28T03:01:11.771Z","avatar_url":"https://github.com/Hitheshkaranth.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"./public/open_token_monitor_icon.png\" alt=\"OpenToken Monitor\" width=\"120\" /\u003e\n\n# OpenToken Monitor\n\n**The unified, local-first desktop monitor for Claude, Codex, and Gemini.**\n\nOne window for every usage gauge, cost trend, and recent prompt — without handing your keys to a SaaS dashboard.\n\n[![Tauri](https://img.shields.io/badge/Tauri-2.x-FFC131?style=for-the-badge\u0026logo=tauri\u0026logoColor=white)](https://tauri.app/)\n[![Rust](https://img.shields.io/badge/Rust-2021-CE422B?style=for-the-badge\u0026logo=rust\u0026logoColor=white)](https://www.rust-lang.org/)\n[![React](https://img.shields.io/badge/React-19-20232A?style=for-the-badge\u0026logo=react\u0026logoColor=61DAFB)](https://react.dev/)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.8-3178C6?style=for-the-badge\u0026logo=typescript\u0026logoColor=white)](https://www.typescriptlang.org/)\n[![Vite](https://img.shields.io/badge/Vite-7-646CFF?style=for-the-badge\u0026logo=vite\u0026logoColor=white)](https://vitejs.dev/)\n[![SQLite](https://img.shields.io/badge/SQLite-bundled-003B57?style=for-the-badge\u0026logo=sqlite\u0026logoColor=white)](https://www.sqlite.org/)\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)\n[![Version](https://img.shields.io/badge/version-0.3.3-blue.svg)](https://github.com/Hitheshkaranth/OpenTokenMonitor/releases)\n[![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey.svg)](#-installation)\n[![Local-First](https://img.shields.io/badge/data-local--first-success.svg)](#-data--privacy)\n\n[Download](#-installation) ·\n[Features](#-features) ·\n[Screens](#-screens) ·\n[Architecture](./ARCHITECTURE.md) ·\n[Contributing](#-contributing)\n\n\u003c/div\u003e\n\n---\n\n## ✨ Why OpenToken Monitor?\n\nYou're juggling **three coding agents** at once — Claude, Codex, and Gemini — each with its own dashboard, its own quota window, and its own pricing page. OpenToken Monitor stitches them into a **single tray-resident desktop app** that:\n\n- 📊 reads your **local CLI artifacts first** (`~/.claude`, `~/.codex`, `~/.gemini/tmp`)\n- 🔐 augments them with **live OAuth fetches** when credentials are present — never proxied through a third party\n- 💸 computes **accurate per-model cost** using current Q1 2026 published rates\n- 🛟 keeps providers **visible even when offline**, surfacing health status instead of silently dropping them\n\nEverything stays on your machine. Snapshots persist in a local SQLite store; nothing leaves the device.\n\n---\n\n## 🚀 Features\n\n### 🎯 Core Dashboard\n\n- **Unified overview** — Claude · Codex · Gemini in one glance, with live usage rings, trend sparklines, and provider health badges\n- **Per-provider detail pages** with cost history, model breakdowns, alert thresholds (75 % / 90 % / 95 %), and recent-prompt activity\n- **Projects view** — recent activity rolled up by workspace with cross-model spend attribution and command summaries\n- **Compact widget mode** — fixed-size always-on-top panel for at-a-glance gauges and reset countdowns\n\n### 🔌 Provider Intelligence\n\n| Provider | Sources | Windows tracked |\n|---|---|---|\n| **Claude** | Anthropic OAuth usage API + `~/.claude/projects` local logs | 5-hour rolling, 7-day, Opus weekly, extra-credits |\n| **Codex (OpenAI)** | Bearer / cookie / RPC fetchers + `~/.codex/sessions` | Daily, model breakdown |\n| **Gemini** | Google OAuth quota API + `~/.gemini/tmp` session files + `gemini --stats` CLI | **60 req/min**, **1000 req/day** (free tier, midnight Pacific reset) |\n\n### 🛡️ Resilience Built-In\n\n- **Smart OAuth backoff** — separate cooldowns for success (120 s) and failure (25 s), so one transient 429 doesn't pin Claude to local-mode for two minutes\n- **Stale-cache fallback** — last good snapshot stays on screen marked `stale` if a fetch fails\n- **Reactive file watching** — `notify` watchers refresh the affected provider the moment a CLI session file changes\n- **Single-instance enforcement** — autostart launch + manual click no longer fight over the SQLite store\n- **Bundled WebView2 bootstrapper** — Windows MSI installs cleanly on machines without WebView2 pre-installed\n\n### 💰 Accurate Cost Estimation (Q1 2026 rates)\n\nAll model rates live in a single source-of-truth: [`src-tauri/src/pricing.rs`](./src-tauri/src/pricing.rs).\n\n| Family | Tier | Rate (input / output per 1M tokens) |\n|---|---|---|\n| Claude | Opus 4.x | $15.00 / $75.00 |\n| Claude | Sonnet 4.x | $3.00 / $15.00 |\n| Claude | Haiku 4.5 | $1.00 / $5.00 |\n| OpenAI | GPT-5 | $1.25 / $10.00 |\n| OpenAI | GPT-5 mini / nano | $0.25 / $2.00 · $0.05 / $0.40 |\n| OpenAI | o3 / o4-mini | $2.00 / $8.00 · $1.10 / $4.40 |\n| Gemini | 2.5 Pro / Flash / Flash-Lite | $1.25 / $10.00 · $0.30 / $2.50 · $0.10 / $0.40 |\n\nCaching discounts and cache-write surcharges are applied where each provider exposes them.\n\n### ⌨️ Keyboard Shortcuts\n\n| Shortcut | Action |\n|---|---|\n| \u003ckbd\u003e1\u003c/kbd\u003e / \u003ckbd\u003e2\u003c/kbd\u003e / \u003ckbd\u003e3\u003c/kbd\u003e | Jump to Claude / Codex / Gemini |\n| \u003ckbd\u003e4\u003c/kbd\u003e | Open Projects |\n| \u003ckbd\u003eEsc\u003c/kbd\u003e | Return to overview |\n| \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eR\u003c/kbd\u003e / \u003ckbd\u003e⌘\u003c/kbd\u003e+\u003ckbd\u003eR\u003c/kbd\u003e | Refresh all providers |\n| \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003e,\u003c/kbd\u003e / \u003ckbd\u003e⌘\u003c/kbd\u003e+\u003ckbd\u003e,\u003c/kbd\u003e | Open settings |\n\n---\n\n## 📸 Screens\n\n| Overview | Projects |\n|---|---|\n| ![Overview](./docs/images/overview-0.3.1.png) | ![Projects](./docs/images/projects-0.3.1.png) |\n\n| Provider Detail | Widget Mode |\n|---|---|\n| ![Provider detail](./docs/images/provider-detail-0.3.1.png) | ![Widget](./docs/images/widget-0.3.1.png) |\n\n| Settings |\n|---|\n| ![Settings](./docs/images/settings-0.3.1.png) |\n\n---\n\n## 📦 Installation\n\n### Pre-built binaries\n\nGrab the latest installer for your OS from [GitHub Releases](https://github.com/Hitheshkaranth/OpenTokenMonitor/releases/latest):\n\n[![Windows](https://img.shields.io/badge/Windows-MSI-0078D6?style=for-the-badge\u0026logo=windows\u0026logoColor=white)](https://github.com/Hitheshkaranth/OpenTokenMonitor/releases/latest)\n[![macOS Intel](https://img.shields.io/badge/macOS-Intel%20DMG-000000?style=for-the-badge\u0026logo=apple\u0026logoColor=white)](https://github.com/Hitheshkaranth/OpenTokenMonitor/releases/latest)\n[![macOS Apple Silicon](https://img.shields.io/badge/macOS-Apple%20Silicon%20DMG-000000?style=for-the-badge\u0026logo=apple\u0026logoColor=white)](https://github.com/Hitheshkaranth/OpenTokenMonitor/releases/latest)\n[![Linux](https://img.shields.io/badge/Linux-DEB-FCC624?style=for-the-badge\u0026logo=linux\u0026logoColor=black)](https://github.com/Hitheshkaranth/OpenTokenMonitor/releases/latest)\n\n### Build from source\n\n\u003e **Prerequisites:** Node.js 18+, Rust stable, and your OS-specific [Tauri 2 dependencies](https://tauri.app/start/prerequisites/).\n\n```bash\n# Clone \u0026 install\ngit clone https://github.com/Hitheshkaranth/OpenTokenMonitor.git\ncd OpenTokenMonitor\nnpm install\n\n# Run in dev mode (hot-reload)\nnpm run tauri dev\n\n# Production build\nnpm run tauri build              # all platforms\nnpm run tauri:build:win          # Windows NSIS installer\nnpm run tauri:build:mac          # macOS app bundle + installer\n```\n\n---\n\n## 🧱 Tech Stack\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd valign=\"top\" width=\"50%\"\u003e\n\n### 🦀 Backend (Rust)\n\n- [**Tauri 2**](https://tauri.app/) — desktop shell \u0026 IPC\n- [**Tokio**](https://tokio.rs/) — async runtime\n- [**Reqwest**](https://github.com/seanmonstar/reqwest) — HTTPS with rustls\n- [**Rusqlite**](https://github.com/rusqlite/rusqlite) — bundled SQLite persistence\n- [**Notify**](https://github.com/notify-rs/notify) — filesystem watchers\n- [**Chrono · Serde · Async-trait**](https://crates.io)\n- `tauri-plugin-single-instance`, `tauri-plugin-autostart`\n\n\u003c/td\u003e\n\u003ctd valign=\"top\" width=\"50%\"\u003e\n\n### ⚛️ Frontend (TypeScript)\n\n- [**React 19**](https://react.dev/) — UI runtime\n- [**Zustand**](https://zustand-demo.pmnd.rs/) — store layer\n- [**Recharts**](https://recharts.org/) — usage trend graphs\n- [**Framer Motion**](https://www.framer.com/motion/) — micro-interactions\n- [**Lucide React**](https://lucide.dev/) — icon set\n- [**Vite 7**](https://vitejs.dev/) — bundler\n- [**Tailwind**](https://tailwindcss.com/) — utility styling\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n---\n\n## 🏗️ Architecture\n\n```\n┌──────────────────────────────────────────────────────────┐\n│  React 19  ·  Zustand stores  ·  hooks (resize / kbd)    │\n└──────────────────┬───────────────────────────────────────┘\n                   │  Tauri invoke()  /  usage-updated event\n┌──────────────────┴───────────────────────────────────────┐\n│  commands.rs  →  aggregator  →  provider registry        │\n│         │                          ├─ Claude  (OAuth + logs)\n│         │                          ├─ Codex   (bearer/cookie/RPC + logs)\n│         │                          └─ Gemini  (OAuth + CLI + logs)\n│         ↓                                                │\n│  UsageStore (SQLite)  ·  pricing.rs  ·  alerts.rs        │\n│  tray.rs  ·  watchers (poll + filesystem)                │\n└──────────────────────────────────────────────────────────┘\n```\n\nFull module map and data-flow walkthrough → [**ARCHITECTURE.md**](./ARCHITECTURE.md)\n\nKey entry points:\n\n- 🚪 Frontend root — [`src/App.tsx`](./src/App.tsx)\n- 🔌 Backend entry — [`src-tauri/src/lib.rs`](./src-tauri/src/lib.rs)\n- 📞 Tauri commands — [`src-tauri/src/commands.rs`](./src-tauri/src/commands.rs)\n- 💱 Cost rate tables — [`src-tauri/src/pricing.rs`](./src-tauri/src/pricing.rs)\n- 🗄️ SQLite layer — [`src-tauri/src/usage/store.rs`](./src-tauri/src/usage/store.rs)\n\n---\n\n## 🔒 Data \u0026 Privacy\n\n- 🏠 **100 % local.** All snapshots, costs, and recent activity are stored in a local SQLite file under your OS app-data directory.\n- 🔑 **Credentials never leave the device.** OAuth tokens are read from the official CLI keychain entries; API requests go directly from your machine to Anthropic / OpenAI / Google.\n- 🚫 **No telemetry.** No analytics, no crash reporting, no phone-home.\n- 🧹 **Reset by deleting** the app-data SQLite file (`%APPDATA%\\com.opentokenmonitor.desktop\\usage.db` on Windows; equivalents on macOS / Linux).\n\n---\n\n## 🗺️ Roadmap\n\n- [ ] Per-project budget alerts with native notifications\n- [ ] Export usage reports to CSV / JSON / PDF\n- [ ] Custom refresh cadences per provider\n- [ ] Cursor / Aider / Continue.dev provider adapters\n- [ ] Multi-month spend forecasting\n\nHave a request? [Open an issue](https://github.com/Hitheshkaranth/OpenTokenMonitor/issues/new).\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome — start with the architecture map and pricing module:\n\n1. Read [`ARCHITECTURE.md`](./ARCHITECTURE.md) for the module layout.\n2. For new providers: implement the `UsageProvider` trait in `src-tauri/src/providers/\u003cname\u003e/` and register it in `registry.rs`.\n3. For pricing updates: edit `src-tauri/src/pricing.rs` and bump the review-date stamp at the top of the file.\n4. Run the test suite before opening a PR:\n\n```bash\ncd src-tauri \u0026\u0026 cargo test --lib\nnpx tsc --noEmit\n```\n\n---\n\n## 📜 License\n\nReleased under the [MIT License](./LICENSE) — free for personal and commercial use.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**Built with ❤️ for developers who use more than one AI agent.**\n\nOpenTokenMonitor is not affiliated with Anthropic, OpenAI, or Google.\n\n[⬆ Back to top](#opentoken-monitor)\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhitheshkaranth%2Fopentokenmonitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhitheshkaranth%2Fopentokenmonitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhitheshkaranth%2Fopentokenmonitor/lists"}