Releases: CHW0n9/OpenCode-Token-Meter
Releases · CHW0n9/OpenCode-Token-Meter
OpenCode Token Meter v1.1.2
Added
- Windows Support: Full support for Windows platform with native system tray integration.
- Unified Build System: Single
.specfile 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.jsonclean. - Build Process: Windows builds now use
build_windows.batfor 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
.icoresource for Windows executables. - IPC Reliability: Standardized Unix Domain Socket (macOS) and TCP (Windows) for inter-process communication.
OpenCode Token Meter v1.1.1
Added
- Dual-Source Database Sync: Implemented parallel synchronization from both legacy
message.jsonfiles and the newopencode.dbSQLite 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
VERSIONfile 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
VERSIONfile instead of hardcoded values. - Documentation Updates: Refreshed
README.mdandREADME_CN.mdwith current architecture and dual-source sync capabilities. - Developer Workflow: Added comprehensive version management documentation in
AGENTS.mdfor 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
TypeErrorwhen 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/) andopencode.dbare scanned simultaneously. - State Management: Added
sync_statetable inindex.dbto track synchronization progress for each data source. - Fallback Behavior: Graceful degradation if one data source is unavailable.
Version Management
- Single Source of Truth:
VERSIONfile in project root contains the version number. - Automatic Propagation: Python modules, shell scripts, and PyInstaller spec all read from
VERSIONfile. - Fallback Support: All components have hardcoded fallback versions (
1.1.1) ifVERSIONfile is missing.
OpenCode Token Meter v1.1.0
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
.specfile and improved sub-process handling (fixing the "window not opening" bug in packaged apps). - Documentation Consolidation: Merged
BUILD.mdandPROJECT_ARCHITECTURE.mdinto the mainREADME.mdfor 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
.appbundle 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__.pyto handle both development and frozen environments.
OpenCode Token Meter v1.0.1
OpenCode Token Meter v1.0.1
Added
- Windows Support: Full support for Windows platform with native system tray integration.
- Unified Build System: Single
.specfile 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.jsonclean. - Build Process: Windows builds now use
build_windows.batfor 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
.icoresource for Windows executables. - IPC Reliability: Standardized Unix Domain Socket (macOS) and TCP (Windows) for inter-process communication.
OpenCode Token Meter v1.0.0
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.