A lightweight, native macOS menu bar utility built with SwiftUI. It provides real-time visibility into your API budget and token spending so you never hit unexpected limits.
- macOS 13.0+
- Xcode 15.0+
- Swift 5.9+
- Clone the repository.
- Open
TokenUsageMonitor.xcodeprojin Xcode. - Select your local Mac as the run destination.
- Build and Run (
βR).
To distribute the app outside the Mac App Store, package it as an Apple Disk Image (.dmg). We use create-dmg to script a clean, professional installer window where users can drag the app directly into their Applications folder.
Ensure you have Homebrew installed, then grab the create-dmg CLI:
brew install create-dmg- In Xcode, set the run destination to Any Mac (Apple Silicon, Intel).
- Go to Product > Archive.
- In the Organizer window, select Distribute App > Custom (or Direct Distribution) > Copy App.
- Export the
TokenUsageMonitor.appbundle to a dedicated build folder (e.g.,~/Desktop/Builds).
Open your terminal, navigate to your build folder, and run the following script. Modify the paths if your .app is located elsewhere:
create-dmg \
--volname "Token Usage Monitor" \
--window-pos 200 120 \
--window-size 600 400 \
--icon-size 100 \
--icon "TokenUsageMonitor.app" 150 190 \
--hide-extension "TokenUsageMonitor.app" \
--app-drop-link 450 190 \
"TokenUsageMonitor.dmg" \
"TokenUsageMonitor.app"
This will generate a TokenUsageMonitor.dmg file with a classic drag-to-install interface, ready for distribution!
Note: If distributing to the public, the exported
.appmust be signed with a Developer ID and notarized by Apple before packaging into the DMG to avoid macOS Gatekeeper warnings.