Skip to content

maxbeizer/gh-contrib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

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.

πŸ€– 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

License

Stars

Watchers

Forks