GitHub Contributions
A tool to fetch and analyze your GitHub contributions across all repositories. Get insights on your stars, pull requests, and contribution history.
Features
- 📊 Fetch all your GitHub repositories and contribution stats
- ⭐ Sort by stars, PR count, or combined score
- 🔍 Filter by owned vs external repos
- 🌐 Web interface with HTML and JSON API
- 🚀 CLI tool for quick analysis
- 📈 See your total stars and PR contributions
Getting Started
Prerequisites
- Bun (or Node.js)
- GitHub personal access token
Installation
git clone https://github.com/pablopunk/github-contributions.git
cd github-contributions
bun installConfiguration
Create a .env file with your GitHub token:
GITHUB_TOKEN=your_github_token_here
Get a personal access token from GitHub Settings.
Usage
CLI
# External repos, sorted by stars (default)
bun run cli
# Your own repos only
bun run cli -o
# All repos (owned + external contributions)
bun run cli -a
# Sort by PR contributions
bun run cli --sort contributions
# Top 10 by combined score
bun run cli --sort all -l 10
# Most recent contributions
bun run cli --sort recent
# Include private repos
bun run cli --private
# Exclude specific repos
bun run cli -x owner/repo1,owner/repo2
# Show help
bun run cli --helpWeb Server
bun run serverThen visit http://localhost:3000 in your browser.
API Endpoints
GET /- HTML view with repository tableGET /api- JSON API responseGET /help- Command help
Query Parameters
# All parameters work on both / and /api endpoints
# Scope
?scope=own # Only your own repos
?scope=external # Only external repos (default)
?scope=all # All repos (own + external)
# Sorting
?sort=stars # Sort by stars (default)
?sort=contributions # Sort by PR count
?sort=all # Sort by combined score
?sort=recent # Sort by most recent contribution
# Filtering
?limit=10 # Limit to 10 results
?exclude=owner/repo1,owner/repo2 # Exclude specific repos
?include=owner/repo1,owner/repo2 # Always include these repos
?private=true # Include private repos
# Examples
http://localhost:3000/?scope=all&limit=10
http://localhost:3000/api?scope=own
http://localhost:3000/?sort=recent
http://localhost:3000/?private=true
http://localhost:3000/?exclude=pablopunk/github-contributionsDeployment
This project is ready to deploy on Vercel. The repository includes:
- ✅
vercel.jsonconfiguration with Bun support - ✅ Environment variable setup for
GITHUB_TOKEN - ✅ Compatible build system
Deploy Now
Click the button at the top of this README or visit:
https://vercel.com/new/clone?repository-url=https://github.com/pablopunk/github-contributions&project-name=github-contributions&env=GITHUB_TOKEN
Manual Deployment
# Install Vercel CLI
npm i -g vercel
# Deploy
vercel
# Set environment variable when prompted
GITHUB_TOKEN=your_token_hereDevelopment
Type Checking
bun run typecheckScripts
bun run cli- Run CLI toolbun run server- Start web serverbun run typecheck- Check TypeScript
Technology Stack
- Runtime: Bun
- Language: TypeScript
- Web Framework: Hono
- Deployment: Vercel
License
MIT