Skip to content

Releases: CHW0n9/OpenCode-Token-Meter

OpenCode Token Meter v1.1.2

15 Mar 16:56
614d459

Choose a tag to compare

Added

  • Windows Support: Full support for Windows platform with native system tray integration.
  • Unified Build System: Single .spec file for building on Windows and macOS.
  • Embedded Agent: Background agent now runs as a thread within the main application, eliminating the need for a separate process.
  • Platform-Aware Paths: Standardized data and settings locations for Windows (%APPDATA%) and macOS (Library/Application Support).
  • Settings Migration: Automatic migration of settings from legacy macOS-style paths on Windows to the correct platform-appropriate directory.
  • Model Management UI:
    • "(customized)" label for models with user-defined pricing.
    • "Mark as Deleted" to hide default models.
    • "Reset to Default" and "Reset All to Default" functionality.
  • Registry Integration (Windows): Added scripts for setting AppUserModelID and handling shortcuts for better toast notification support.

Changed

  • Settings Refactor: Stabilized settings logic to separate user overrides from default model definitions.
  • Normalization: User settings now only store values that differ from defaults, keeping settings.json clean.
  • Build Process: Windows builds now use build_windows.bat for a single-executable output.

Fixed

  • Settings Data Loss: Fixed a bug where merging user settings could inadvertently delete default models due to shallow copying.
  • Pathing Issues: Resolved hardcoded macOS paths in settings and IPC logic.
  • Windows Icon Support: Integrated multi-size .ico resource for Windows executables.
  • IPC Reliability: Standardized Unix Domain Socket (macOS) and TCP (Windows) for inter-process communication.

OpenCode Token Meter v1.1.1

03 Mar 18:01
d0c9224

Choose a tag to compare

Added

  • Dual-Source Database Sync: Implemented parallel synchronization from both legacy message.json files and the new opencode.db SQLite database for seamless data migration.
  • New Model Pricing: Added pricing support for the latest AI models:
    • anthropic/claude-sonnet-4-6 ($0.04/request)
    • github-copilot/claude-opus-4-6 ($0.12/request)
    • github-copilot/gemini-3.1-pro-preview ($0.04/request)
    • nvidia/moonshotai/kimi-k2.5 (Free)
    • nvidia/minimaxai/minimax-m2.5 (Free)
    • nvidia/z-ai/glm5 (Free)
  • Centralized Version Management: Created VERSION file as single source of truth for version numbers across all components.

Changed

  • Version Management Refactor: All components (Python code, build scripts, PyInstaller spec) now read version from the centralized VERSION file instead of hardcoded values.
  • Documentation Updates: Refreshed README.md and README_CN.md with current architecture and dual-source sync capabilities.
  • Developer Workflow: Added comprehensive version management documentation in AGENTS.md for easier future updates.

Fixed

  • Sync State Advancement Bug: Fixed a critical issue where parsing errors would still advance the sync state, causing messages to be permanently skipped.
  • Timestamp Type Safety: Added robust type checking for JSON timestamps to prevent TypeError when comparing string timestamps with integers.
  • Deduplication Logic: Enhanced message deduplication to work correctly with both legacy file-based and new database-based message sources.

Technical Details

Database Sync Architecture

  • Parallel Scanning: Both legacy message directory (~/.local/share/opencode/storage/message/) and opencode.db are scanned simultaneously.
  • State Management: Added sync_state table in index.db to track synchronization progress for each data source.
  • Fallback Behavior: Graceful degradation if one data source is unavailable.

Version Management

  • Single Source of Truth: VERSION file in project root contains the version number.
  • Automatic Propagation: Python modules, shell scripts, and PyInstaller spec all read from VERSION file.
  • Fallback Support: All components have hardcoded fallback versions (1.1.1) if VERSION file is missing.

OpenCode Token Meter v1.1.0

10 Feb 22:57
b32489a

Choose a tag to compare

Added

  • Modern UI Architecture: Fully transitioned from PyQt6 to pywebview, enabling a modern, responsive web-based interface while reducing bundle size.
  • Embedded Lifecycle: Unified the Agent and Stats Worker as background threads within a single application process for both Windows and macOS.
  • Enhanced Typography: Standardized on Lato with a font-weight of 900 for headers and chart labels for a premium, bold aesthetic.
  • Dashboard Visualization: New real-time usage trend charts and distribution analytics.

Changed

  • Packaging Refactor: Completely redesigned the build system with a unified .spec file and improved sub-process handling (fixing the "window not opening" bug in packaged apps).
  • Documentation Consolidation: Merged BUILD.md and PROJECT_ARCHITECTURE.md into the main README.md for a single-source-of-truth.
  • Project Structure Cleanup: Removed legacy main files, redundant scripts, and standalone installer folders to streamline the codebase.

Fixed

  • Subprocess Launch: Resolved a critical issue where the webview window failed to open in the packaged .app bundle due to module path resolution errors.
  • Layout Alignment: Centered navigation controls and refined padding across all pages for better visual balance.
  • Import Robustness: Improved module loading logic in __main__.py to handle both development and frozen environments.

OpenCode Token Meter v1.0.1

10 Feb 22:46
e0cb7e9

Choose a tag to compare

OpenCode Token Meter v1.0.1

Added

  • Windows Support: Full support for Windows platform with native system tray integration.
  • Unified Build System: Single .spec file for building on Windows and macOS.
  • Embedded Agent: Background agent now runs as a thread within the main application, eliminating the need for a separate process.
  • Platform-Aware Paths: Standardized data and settings locations for Windows (%APPDATA%) and macOS (Library/Application Support).
  • Settings Migration: Automatic migration of settings from legacy macOS-style paths on Windows to the correct platform-appropriate directory.
  • Model Management UI:
    • "(customized)" label for models with user-defined pricing.
    • "Mark as Deleted" to hide default models.
    • "Reset to Default" and "Reset All to Default" functionality.
  • Registry Integration (Windows): Added scripts for setting AppUserModelID and handling shortcuts for better toast notification support.

Changed

  • Settings Refactor: Stabilized settings logic to separate user overrides from default model definitions.
  • Normalization: User settings now only store values that differ from defaults, keeping settings.json clean.
  • Build Process: Windows builds now use build_windows.bat for a single-executable output.

Fixed

  • Settings Data Loss: Fixed a bug where merging user settings could inadvertently delete default models due to shallow copying.
  • Pathing Issues: Resolved hardcoded macOS paths in settings and IPC logic.
  • Windows Icon Support: Integrated multi-size .ico resource for Windows executables.
  • IPC Reliability: Standardized Unix Domain Socket (macOS) and TCP (Windows) for inter-process communication.

OpenCode Token Meter v1.0.0

01 Feb 17:15
37a88b8

Choose a tag to compare

OpenCode Token Meter v1.0.0 - Initial Release

Features

  • Real-time AI token usage tracking (Claude, ChatGPT, Gemini, etc.)
  • Costs calculation based on provider models
  • Token usage analytics and reporting
  • Export to CSV format
  • macOS menubar application with native UI

System Requirements

  • macOS 11.0 or later

Installation

  • Download the DMG file from releases
  • Or build from source: ./build.sh

Documentation

See README.md for detailed instructions.