How kkmaple/codex-usage-monitor works
This is a Windows taskbar usage monitor for Codex, with optional Claude Code and Antigravity providers. The principal flow is credential discovery and provider polling, conversion into shared usage data, then display in a taskbar widget and tray icons; the app also provides settings, localization, diagnostics, and update handling. Provider polling and several UI call sites are only partially sampled, so some documented runtime links are dashed rather than asserted as verified calls.
Main entry points: window.rs Taskbar widget · poller.rs Usage poller · main.rs Application entry · updater.rs Update handling
Components 18
Application runtime
- Application entry
src/main.rs - Usage data
src/models.rs
Usage providers
- Usage poller
src/poller.rs - Provider credentials
src/poller.rs - Anthropic endpoints
- ChatGPT endpoints
- Google endpoints
Taskbar interface
- Taskbar widget
src/window.rs - Windows interop
src/native_interop.rs - Tray badges
src/tray_icon.rs - Theme detection
src/theme.rs
Settings and support
- Localized strings
src/localization - Widget settings
src/window.rs - Update handling
src/updater.rs - Diagnostic logging
src/diagnose.rs
Other components
- Windows user
- GitHub releases
- Windows taskbar
Connections 20
- Windows user → Application entry: launches
README.md - Application entry → Taskbar widget: starts
src/main.rs - Application entry → Diagnostic logging: initializes
src/main.rs - Application entry → Update handling: checks CLI mode
src/main.rs - Usage poller → Provider credentials: reads
src/poller.rs - Usage poller → Anthropic endpoints: requests usage
src/poller.rs - Usage poller → ChatGPT endpoints: requests usage
README.md - Usage poller → Google endpoints: requests quota
src/poller.rs - Usage poller → Usage data: returns usage
src/poller.rs - Taskbar widget → Usage poller: refreshes periodically
README.md - Taskbar widget → Usage data: displays usage
README.md - Taskbar widget → Windows interop: uses helpers
src/window.rs - Taskbar widget → Windows taskbar: embeds widget
README.md - Taskbar widget → Tray badges: manages tray icons
README.md - Taskbar widget → Theme detection: uses theme
src/window.rs - Taskbar widget → Localized strings: resolves language
src/window.rs - Taskbar widget → Widget settings: loads and saves
README.md - Taskbar widget → Update handling: checks updates
src/window.rs - Update handling → GitHub releases: checks releases
src/updater.rs - Windows user → Taskbar widget: configures display
README.md