A native macOS Menu Bar application built with SwiftUI to easily monitor your Opencode Go subscription usage (Rolling, Weekly, and Monthly limits).
- Real-Time Monitoring: View your Rolling, Weekly, and Monthly usage directly from the menu bar.
- Smart Progress Bars: Progress bar colors dynamically change based on usage levels (Green for safe, Yellow for medium, Red for critical).
- Auto-Refresh: Automatically fetches new data every 5 minutes, or you can manually refresh.
- Lightweight: Runs as a background agent (
LSUIElement) with no dock icon clutter. - Terminal-Driven: No Xcode GUI required. Generated and built entirely via
xcodegenandmake.
- macOS with Command Line Tools / Xcode installed.
- XcodeGen (can be installed via Homebrew:
brew install xcodegen).
-
Clone the repository (or navigate to the project directory):
cd opencode-usage -
Generate the Xcode project and build:
make build
-
Run the app:
make run
(Note: The app will appear in your macOS Menu Bar. It does not have a dock icon).
Note: Currently, Opencode does not provide an official API or dedicated endpoint to fetch usage statistics. As a workaround, this app parses the payload directly from the web client's internal
_serverrequests.
To fetch your usage data, the app needs your Opencode API URL and Authentication Cookie. You can grab these easily using your browser's Developer Tools.
-
Open your opencode console.
-
Open the Developer Tools (Right-click anywhere on the page -> Inspect).
-
Go to the Network tab.
-
Refresh the page or interact with the Opencode UI until you see a network request made to
_server(orhttps://opencode.ai/_server?...). -
Right-click on that
_serverrequest, select Copy, then choose Copy as cURL (bash). -
Open the OpenCode Usage Monitor from your Mac menu bar.
-
Click the Settings (⚙️) icon in the top right corner of the header.
-
Paste the entire
curlcommand into the text box and click Save.
The app will automatically extract your endpoint, headers, and authentication tokens to keep your usage updated!
A Makefile is provided for easy terminal workflows:
make setup: Generates the.xcodeprojusing XcodeGen.make build: Builds the application (Debug configuration).make run: Kills any existing instance and runs the freshly built app.make clean: Removes the generated.xcodeprojand thebuild/directory.make logs: Streams the unified logs specifically for this app subsystem (com.wiscaksono.opencode-usage).
MIT License

