opencode-bar  by opgginc

Real-time AI provider usage tracker for macOS

Created 4 months ago
256 stars

Top 98.5% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a macOS menu bar application for real-time monitoring of AI provider usage, integrating seamlessly with OpenCode configurations. It targets AI power users and developers who need a consolidated view of their API consumption across various services, offering an effortless way to track costs and quotas without manual intervention.

How It Works

OpenCode Bar automatically detects and monitors AI providers by reading authentication tokens and configurations from OpenCode's auth.json file and other specified locations. It employs multi-source discovery for services like GitHub Copilot and ChatGPT, aggregating credentials from OpenCode plugins, CLI configurations, macOS Keychain, and browser cookies. The application queries provider APIs in parallel, utilizes smart caching for network resilience, and presents usage data with visual indicators and detailed submenus.

Quick Start & Requirements

  • Installation: Install via Homebrew (brew install --cask opgginc/tap/opencode-bar) or download the latest .dmg from the Releases page.
  • Prerequisites: macOS 13.0+ is required. For building from source, Xcode 15.0+ is necessary. OpenCode must be installed and authenticated with AI providers.
  • Links: Releases Page (implied by DMG download).

Highlighted Details

  • Zero Configuration: Automatically detects and monitors all AI providers registered in your OpenCode configuration.
  • Multi-Source Account Discovery: Aggregates accounts for services like GitHub Copilot and ChatGPT from OpenCode, CLI, Keychain, VS Code/Cursor configs, and browser cookies, with automatic deduplication.
  • Real-time Menu Bar Dashboard: Provides an at-a-glance view of usage across all detected providers, with color-coded indicators and detailed submenus.
  • Command Line Interface (CLI): Offers programmatic access to query provider usage, status, and detailed information, with JSON output options for scripting.
  • Privacy Focused: Operates locally on the user's machine with read-only access to existing tokens and no third-party server communication.

Maintenance & Community

The project is primarily developed by Sangrak Choi. No specific community channels (e.g., Discord, Slack), sponsorships, or detailed roadmap links are provided in the README. Contributions are welcomed via Pull Requests.

Licensing & Compatibility

The project is released under the MIT License, which permits broad usage, including commercial applications and closed-source linking, with minimal restrictions.

Limitations & Caveats

This application is exclusively for macOS and requires version 13.0 or later. Building from source necessitates Xcode 15.0+. Users may encounter setup complexities if OpenCode or its authentication files are not located in standard paths, with specific troubleshooting guidance provided for common issues like "No providers found" or GitHub Copilot detection failures.

Health Check
Last Commit

5 days ago

Responsiveness

Inactive

Pull Requests (30d)
11
Issues (30d)
0
Star History
19 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.