forked from Maciek-roboblog/Claude-Code-Usage-Monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
Take upstream changes #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
simoncoles
wants to merge
130
commits into
amphora:docker
Choose a base branch
from
Maciek-roboblog:main
base: docker
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add modern Python packaging with uv tool installation support: - Add pyproject.toml with console script entry points (ccusage-monitor, claude-monitor) - Update README.md to prioritize uv installation over legacy methods - Add CLAUDE.md development documentation - Add comprehensive .gitignore for Python project Users can now install with: uv tool install claude-usage-monitor Maintains full backwards compatibility with existing installation methods
Update installation docs to use local directory instead of PyPI: - Change from 'uv tool install claude-usage-monitor' to 'uv tool install .' - Add git clone step since package not yet published to PyPI - Clarify platform-specific uv installation commands Fixes installation errors for users trying to install from PyPI
feat: add uv package manager support
- Add comprehensive .ruff.toml configuration with essential linting rules - Set up pre-commit hooks for automated code quality checks - Create GitHub Actions CI workflow for ruff validation - Configure VS Code settings for real-time ruff integration - Format existing codebase to comply with ruff standards - Update documentation with ruff usage instructions - Update Python requirement from 3.6+ to 3.7+ (ruff minimum) - Replace outdated tools (black, flake8) with modern ruff tooling Resolves #15
feat: integrate ruff for code quality and formatting
Information about CLAUDE_CONFIG_DIR added
Update README.md with CLAUDE_CONFIG_DIR path
Hi there, I noticed that many popular open-source projects include a star history chart in their README to visualize community growth and engagement. I thought it would be a great addition to this project as well. This PR adds a dynamic Star History chart to the end of the `README.md`.
Docs: Add Star History chart to README.md
Uv refactor
Update README.md
- Add --view parameter to CLI for selecting display mode (realtime, daily, monthly) - Implement UsageAggregator for data aggregation by day/month - Create TableViewsController for rendering usage tables - Add format_number utility for formatting numbers with thousand separators - Include comprehensive tests for new functionality This feature allows users to view their Claude token usage aggregated by day or month, making it easier to track usage patterns over time.
- Fix aggregator.py: Change localize_datetime to ensure_timezone method call - Fix table_views.py: Correct entries_count calculation to sum all entries - Fix test_aggregator.py: Add required data_path parameter to fixture - Improve main.py: Replace busy-wait loops with event-driven approach - Enhance table_views.py: Optimize model display for better readability These changes resolve all issues identified in the code review. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove unused time import from main.py - Clean up all trailing whitespace in modified files - Fix blank lines containing whitespace (W293) - Ensure all imports are used (F401) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove unused Tuple import from aggregator.py - Sort and format import statements across all modified files - Replace busy-wait loops with signal.pause() for more efficient event waiting - Move time-related imports to module level in main.py - Optimize model display formatting in table_views.py (truncate long lists) - Extract common table creation logic to reduce code duplication - Add helper methods: _create_base_table, _add_data_rows, _add_totals_row These changes improve code quality, reduce CPU usage in wait loops, and make the code more maintainable by eliminating duplication. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove unused Union import from settings.py - Remove unused threading import from main.py - Fix blank lines containing whitespace in settings.py and themes.py - Remove trailing whitespace from table_views.py - Fix import ordering in aggregator.py (dataclasses before datetime) - Perform comprehensive check for similar issues across all modified files These changes improve code quality and maintain consistent coding standards. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove unused patch import from test_table_views.py - Remove unused timedelta import from test_aggregator.py - Fix blank line containing whitespace in formatting.py - Remove all blank lines containing whitespace from test_table_views.py These changes continue to improve code quality and maintain consistent coding standards. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove unused patch import from test_aggregator.py - Remove unused Mock and Text imports from test_table_views.py - Clean all blank lines containing whitespace in test_table_views.py - Remove trailing whitespace from line 328 in test_table_views.py Performed comprehensive check on all modified files to ensure: - No unused imports - No blank lines with whitespace - No trailing whitespace All Python files in this PR now pass coding standards checks. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixed the `test_successful_main_execution` in `test_cli_main.py` that was causing GitHub Actions to hang and timeout. The issue was caused by improper mocking of `time.sleep` which led to infinite loops in the main monitoring function. Changes: - Updated mock strategy to patch both `signal.pause` and `time.sleep` with KeyboardInterrupt - Added proper orchestrator mock configuration to prevent interference - Removed problematic display controller mock configuration - Test now completes in 0.11s instead of hanging indefinitely This resolves the "The operation was canceled" error in GitHub Actions CI pipeline. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixed all linting issues reported by CodeRabbit AI review: - src/tests/test_aggregator.py: * Removed unused `unittest.mock.Mock` import (F401) * Fixed import sorting to comply with isort configuration * Added missing newline at end of file (W292) - src/tests/test_table_views.py: * Fixed import block sorting and formatting (I001) * Ensured proper single-line imports per force_single_line config * Added missing newline at end of file (W292) All files now pass both ruff and isort linting checks. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Remove unused `mock_display` variable to fix linting error F841. The variable was assigned but never used in the test. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Applied isort and black formatting to PR-modified files only - Updated import statements to follow project style guidelines - No functional changes, only formatting adjustments
- Consolidate multi-line imports into single lines per ruff preferences - Maintain consistency with ruff linting rules - Resolves import formatting conflicts between tools
Add: Daily and monthly token usage views
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.