A beautiful terminal dashboard for your GitHub activity β contribution heatmaps, activity timelines, and repo stats at a glance.
- π Contribution Heatmap β GitHub-style contribution graph rendered right in your terminal with Unicode blocks and color gradients
- π Activity Timeline β See your recent pushes, PRs, issues, reviews, releases, and more in a clean table
- π€ Language Chart β Horizontal bar chart of your language distribution across repositories
- π Top Repositories β Table of your most-starred repos with descriptions
- π Activity Summary β Quick count of activities by type
- π€ Profile Card β At-a-glance profile with follower count and yearly contributions
- π Side-by-Side Comparison β Compare two users or two organizations
- β° Time-Period Comparison β Compare the same user/org across different years
- π₯ Team Analytics β Organization-wide analytics: contributor rankings, bus factor, repo health, collaboration network, code review metrics, activity trends
- π€ Export β JSON and HTML export for both single targets and comparisons/team analytics
# Install from PyPI (once published)
pip install gh-stats
# Or install from source
git clone https://github.com/jlaportebot/gh-stats.git
cd gh-stats
pip install -e .- Python 3.9+
- GitHub authentication via one of:
- GitHub CLI (
gh) β install and rungh auth login GH_TOKENorGITHUB_TOKENenvironment variable
- GitHub CLI (
# Dashboard for the authenticated user
gh-stats
# Dashboard for a specific user
gh-stats --user octocat
# Dashboard for an organization
gh-stats --org github
# Contribution heatmap for a specific year
gh-stats --year 2025
# Show top repositories table
gh-stats --repos
# Limit activity timeline entries
gh-stats --limit 10
# Skip specific sections
gh-stats --no-heatmap
gh-stats --no-activity# Compare two users
gh-stats compare --user-a octocat --user-b torvalds
# Compare two organizations
gh-stats compare --org-a github --org-b microsoft
# Compare same user across years (time-period comparison)
gh-stats compare --user-a octocat --year-a 2023 --year-b 2024
# Compare same org across years
gh-stats compare --org-a github --year-a 2023 --year-b 2024# Team analytics for an organization
gh-stats team --org github
# Limit repositories analyzed
gh-stats team --org github --repo-limit 50
# Limit contributors shown
gh-stats team --org github --contributors 30
# Skip specific sections
gh-stats team --org github --no-health --no-bus-factor --no-collab --no-reviews
# Analyze specific year
gh-stats team --org github --year 2024# Export single dashboard as JSON
gh-stats --output dashboard.json
# Export single dashboard as HTML
gh-stats --output dashboard.html --format html
# Export comparison as JSON
gh-stats compare --user-a octocat --user-b torvalds --output compare.json
# Export comparison as HTML
gh-stats compare --user-a octocat --user-b torvalds --output compare.html --format html
# Export team analytics as JSON
gh-stats team --org github --output team.json
# Export team analytics as HTML
gh-stats team --org github --output team.html --format html| Option | Short | Description | Default |
|---|---|---|---|
--user |
-u |
GitHub username | Authenticated user |
--org |
-o |
GitHub organization name | β |
--year |
-y |
Year for heatmap | Current year |
--limit |
-l |
Activity entries to show | 20 |
--repos |
Show top repositories | off | |
--no-heatmap |
Skip contribution heatmap | off | |
--no-activity |
Skip activity timeline | off | |
--no-streaks |
Skip contribution streaks | off | |
--output |
Export to file | β | |
--format |
Export format (json/html) | json |
| Option | Description | Default |
|---|---|---|
--user-a / --user-b |
Two users to compare | β |
--org-a / --org-b |
Two organizations to compare | β |
--year-a / --year-b |
Years for time-period comparison | Current year |
--limit |
Activity entries to show | 20 |
--repos |
Show top repositories table | off |
--no-heatmap |
Skip heatmap | off |
--no-activity |
Skip activity timeline | off |
--no-streaks |
Skip streaks | off |
--output |
Export to file | β |
--format |
Export format (json/html) | json |
| Option | Short | Description | Default |
|---|---|---|---|
--org |
-o |
GitHub organization name | Required |
--year |
-y |
Year for analysis | Current year |
--repo-limit |
Repositories to analyze | 20 | |
--contributors |
Top contributors to show | 20 | |
--no-health |
Skip repository health matrix | off | |
--no-bus-factor |
Skip bus factor analysis | off | |
--no-collab |
Skip collaboration network | off | |
--no-reviews |
Skip code review analytics | off | |
--output |
Export to file | β | |
--format |
Export format (json/html) | json |
gh-stats/
βββ gh_stats/
β βββ __init__.py # Package metadata
β βββ cli.py # Click CLI entry point & orchestration
β βββ api.py # GitHub API client (REST + GraphQL)
β βββ activity.py # Event parsing & analysis logic
β βββ ui.py # Rich terminal rendering components
β βββ team.py # Team analytics (contributors, bus factor, health, collaboration, reviews)
β βββ team_trends.py # Team activity trend computation
β βββ team_ui.py # Team dashboard rendering
β βββ team_trends_ui.py # Team trends rendering
β βββ html_export.py # HTML report generation
β βββ comparison.py # Side-by-side & time-period comparison logic
βββ tests/
β βββ test_api.py # API client tests
β βββ test_activity.py # Activity analysis tests
β βββ test_ui.py # UI rendering tests
β βββ test_cli.py # CLI tests
β βββ test_comparison.py # Comparison tests
β βββ test_team.py # Team analytics tests
β βββ test_html_export.py # HTML export tests
βββ pyproject.toml # Project config, deps, entry points
βββ LICENSE # MIT license
βββ README.md # This file
# Clone and set up
git clone https://github.com/jlaportebot/gh-stats.git
cd gh-stats
# Create virtual environment
python -m venv .venv
source .venv/bin/activate
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run linter
ruff check .
# Format code
ruff format .Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project follows Conventional Commits:
feat:β New featuresfix:β Bug fixesdocs:β Documentation changesrefactor:β Code refactoringtest:β Test additions/changeschore:β Build/maintenance changes
This project is licensed under the MIT License β see the LICENSE file for details.
- Rich β Beautiful terminal formatting
- Click β Command-line interface creation
- httpx β Modern HTTP client for Python
- GitHub CLI β Seamless auth integration
gh-stats β Built with π¦ by Mister Lobster