Skip to content

About

A CLI extension for understanding your contributions on GitHub

Topics

Resources

Code of conduct

Stars

3 stars

Watchers

1 watching

Forks

Repository files navigation

📊 gh-contrib

A powerful GitHub CLI extension to visualize and understand contributions across your organization

License: MIT Go

gh-contrib helps you track, visualize, and analyze GitHub contributions with beautiful graphs, detailed summaries, and AI-powered insights. Perfect for team leads, project managers, and developers who want to understand contribution patterns.

✨ Features

  • 📈 Visual contribution graphs - See weekly activity patterns at a glance
  • 🔍 Detailed contribution lists - Pull requests, issues, and combined views
  • 🤖 AI-powered summaries - Automatically summarize PR/issue content
  • 🎯 Flexible filtering - Filter by date ranges and organizations
  • ⚡ Fast and intuitive - Built with Go for speed and efficiency

🚀 Quick Start

Installation

gh ext install maxbeizer/gh-contrib

Your First Command

# See your own contributions from the last 30 days
gh contrib graph

# Or check someone else's contributions
gh contrib graph octocat

💡 Tip: If no username is provided, the extension automatically uses your GitHub username!

📖 Usage Guide

📊 Visualize Contributions

Create beautiful weekly contribution graphs:

gh contrib graph [username]

Example output:

Week  1 (Apr 15 - Apr 21): •□■
Week  2 (Apr 22 - Apr 28): ○••
Week  3 (Apr 29 - May 05): ■□

Legend:
• = Closed PR  ○ = Open PR  ■ = Closed Issue  □ = Open Issue

Total Contributions: 7 over 31 days (avg: 0.23 per day)
PRs: 4 total (3 closed, 1 open)
Issues: 3 total (1 closed, 2 open)

🔍 List Contributions

Pull Requests Only:

gh contrib pulls [username]

Issues Only:

gh contrib issues [username]

Everything Together:

gh contrib all [username]

🤖 AI-Powered Summaries

Summarize multiple PR/issue descriptions using AI:

gh contrib summarize

Pass content via stdin, separated by ---END-OF-ENTRY--- delimiters.

🐛 Debug Mode

Get detailed execution information:

gh contrib --debug graph octocat

🎛️ Advanced Options

📅 Date Filtering

Filter contributions by date range:

# Get contributions since a specific date
gh contrib --since 2025-04-01 pulls octocat

# Works with all commands
gh contrib --since 2025-04-01 graph octocat

Date format: YYYY-MM-DD (defaults to 30 days ago if not specified)

📝 Content Focus

Get just the content without metadata:

# Show only PR/issue body content
gh contrib --body-only pulls octocat

🏢 Organization Override

Query different organizations on the fly:

# Check contributions in a specific org
gh contrib --org primer pulls octocat

⚠️ Note: GitHub's search API doesn't support OR queries, so you can only query one organization at a time.

🔓 Visibility Filter

Filter contributions by repository visibility:

# Show only open source (public repo) contributions
gh contrib --visibility public pulls octocat

# Show only private repo contributions
gh contrib --visibility private pulls octocat

# Works with all commands
gh contrib --visibility public graph octocat

🤖 AI Model Selection

Choose your preferred AI model for summaries:

# Use a specific model for summarization
gh contrib --model gpt-3.5 summarize

View available models →

⚙️ Configuration

Customize default settings in ~/.config/gh/config.yml:

extensions:
  gh-contrib:
    org: my-custom-org # Default organization
    model: gpt-4o # Default AI model

Configuration options:

  • org: Default organization name (fallback: github)
  • model: Default AI model (fallback: gpt-4o)

🛠️ Development & Testing

Prerequisites

  • Go 1.16 or later
  • GitHub CLI installed and authenticated

Quick Development

# Build and test locally
make build

# Run tests
make test

# See all available commands
make help

Testing

Run the comprehensive test suite:

./script/test

Includes race condition detection and timeout handling.

💡 Pro Tips

  • 🔄 Default behavior: All commands default to your own username when none is provided
  • 📊 Best visualization: Use graph command for quick visual insights
  • 🎯 Focused analysis: Combine --since with specific date ranges for targeted analysis
  • 🏃‍♂️ Quick debugging: Add --debug to any command for detailed execution info

📋 Examples

# Quick personal overview
gh contrib graph

# Team member analysis (last 2 weeks)
gh contrib --since 2025-07-15 all teammate

# Organization-specific search
gh contrib --org microsoft pulls octocat

# Debug a slow query
gh contrib --debug --since 2025-01-01 graph octocat

📜 License

This project is licensed under the MIT License. See the LICENSE file for details.


Made with ❤️ for the GitHub community

Report Bug • Request Feature • Contribute

About

A CLI extension for understanding your contributions on GitHub

Topics

Resources

Code of conduct

Stars

3 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages