MuseBar: Syncing AI Quota, Weekly Cost History, and Bus Departures Across macOS, iOS, and an ESP32
Nov 17, 2026If you switch between a Mac, an iPhone, and your desk all day, checking AI quota windows or whether your bus is about to leave shouldn't mean opening a terminal or unlocking a web dashboard.
MuseBar is a native Swift menu-bar app and widget suite for macOS and iOS—paired with an ESP32 OLED bus board—all reading from one Cloudflare Workers + D1 + R2 backend.
What it tracks
- 5-hour & weekly quota windows: Shows
% leftand reset countdowns directly in the macOS menu bar (5h 95% · wk 62%) and desktop/iOS widgets, pulled straight from the provider's own quota state without guessing. - Requests, tokens, and 52-week history: Aggregates local session logs over Sunday-to-Sunday weekly windows (including per-model breakdowns and configurable API-equivalent cost estimates with
0.1xcache-read weighting) and stores up to 52 weeks in D1 so you can page back through prior weeks. - Live bus departures: Pulls Metro Transit E Line departures (via Ghost Bus Tracker) into the iOS widgets and an ESP32 + SSD1306 OLED desk board.
Architecture
- Mac collector (
launchd): A jittered 1–4 minute collector runscollect-muse.pyand pushes snapshots to themusebar-syncWorker using a write-onlyPUSH_SECRET. - Cloudflare Workers + D1 + R2:
musebar-syncstores raw JSON snapshots in R2 and normalized weekly/model rows in D1, serving/api/usage,/api/weeks, and/api/historybehind a separate read-onlyREAD_SECRET(failing closed with401if unset, so a read token in an app binary can never write). - Native Swift + xcodegen: One
project.ymlgenerates the macOS menu-bar app, macOS WidgetKit desktop widget, and iOS app + widgets.
Check out the source on GitHub.