git-leaderboard
v1.0.3
Published
A colorful git contribution leaderboard for your repo
Downloads
226
Maintainers
Readme
Git Leaderboard 🏆
A colorful git contribution leaderboard for your repository. Track and visualize contributions from all team members with detailed statistics.
Features
- 📊 View detailed contribution statistics (lines added, removed, net changes)
- 📈 Visual bar chart showing relative contributions
- 🔢 Track commit counts per contributor
- 📅 Filter by date range
- 🎯 Sort by different metrics (commits, added, removed, net lines)
- 📋 Multiple output formats (table, JSON, CSV)
- 🎨 Colorful terminal output
- 🔍 Filter contributors (include/exclude)
- 📧 Display author email addresses
- ⚡ Fast and lightweight
Installation
Run directly
npx --yes git-leaderboardGlobal Installation
npm install -g git-leaderboardLocal Installation
npm install
npm linkUsage
Navigate to any git repository and run:
git-leaderboard [options]Options
| Option | Description |
|--------|-------------|
| -V, --version | Output the version number |
| -s, --sort <type> | Sort by: commits, added, removed, net (default: net) |
| -l, --limit <number> | Limit the number of contributors shown |
| -r, --reverse | Reverse the sort order |
| --since <date> | Show contributions since date (e.g., '2024-01-01', '1 week ago') |
| --until <date> | Show contributions until date |
| -f, --format <type> | Output format: table, json, csv (default: table) |
| --no-color | Disable colored output |
| -e, --exclude <authors...> | Exclude specific authors |
| -i, --include <authors...> | Include only specific authors |
| --show-email | Show author email addresses |
| --show-commits | Show commit count in the table |
| --no-chart | Hide the bar chart (shown by default) |
| -h, --help | Display help for command |
Examples
Basic Usage
Show all contributors with net line changes:
git-leaderboardSort by Commits
git-leaderboard --sort commits --show-commitsShow Top 5 Contributors
git-leaderboard --limit 5Filter by Date Range
Show contributions from the last month:
git-leaderboard --since "1 month ago"Show contributions for a specific year:
git-leaderboard --since "2024-01-01" --until "2024-12-31"Export to JSON
git-leaderboard --format json > stats.jsonExport to CSV
git-leaderboard --format csv > stats.csvExclude Bot Accounts
git-leaderboard --exclude "dependabot,renovate"Show Only Specific Contributors
git-leaderboard --include "John,Sarah"Show with Email Addresses
git-leaderboard --show-emailSort by Lines Added (Descending)
git-leaderboard --sort addedSort by Commits (Ascending)
git-leaderboard --sort commits --reverse --show-commitsHide the Bar Chart
git-leaderboard --no-chartComplete Example
Show top 10 contributors by commits in the last 6 months with commit counts:
git-leaderboard --sort commits --show-commits --limit 10 --since "6 months ago"Output Examples
Table Format (Default)
No. Contributor Added Removed Net Chart
1 John Doe 5234 892 4342 ████████████████████
2 Jane Smith 3421 654 2767 ████████████▌
3 Bob Johnson 1876 432 1444 ██████▌
Summary:
Total 10531 1978 8553The bar chart visualizes the sorted metric (net changes by default). Use --no-chart to hide it.
JSON Format
[
{
"name": "John Doe",
"added": 5234,
"removed": 892,
"net": 4342,
"commits": 45
},
{
"name": "Jane Smith",
"added": 3421,
"removed": 654,
"net": 2767,
"commits": 38
}
]CSV Format
No,Contributor,Commits,Added,Removed,Net
1,"John Doe",45,5234,892,4342
2,"Jane Smith",38,3421,654,2767Use Cases
- 📈 Team Performance: Track team contributions over time
- 🎯 Sprint Reviews: Analyze contributions during specific sprints
- 📊 Reports: Generate contribution reports in various formats
- 🏅 Recognition: Identify top contributors for recognition
- 📅 Historical Analysis: Compare contributions across different time periods
- 🔍 Code Reviews: Understand contribution patterns
Tips
- Use
--sinceand--untilto analyze specific time periods - Combine
--sortwith--show-commitsfor detailed insights - The bar chart scales based on your sort metric (
--sort addedshows bars for lines added) - Export to CSV for use in spreadsheets and further analysis
- Use
--excludeto filter out bot accounts (dependabot, renovate, etc.) - Pipe JSON output to tools like
jqfor advanced filtering
License
MIT
Author
Saad5400
Repository
https://github.com/Saad5400/git-leaderboard
