Skip to content

2802AdityA/git-contribution-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-contribution-analyzer

A high-performance tool to analyze GitHub Pull Requests by author, generating comprehensive summaries with LLM-powered insights.

Features

  • Parallel batch processing for faster PR analysis
  • Safe git operations with mutex-based locking
  • Full PR diffs with automatic fallback for large PRs
  • Auto-numbered output files
  • Robust error handling
  • LLM-powered analysis using Google Gemini
  • Retry mechanism for failed analyses

Prerequisites

  • Bun runtime
  • GitHub CLI (authenticated)
  • Git
  • Google Gemini API key

Installation

bun install
gh auth login
cp .env.example .env
# Add your GEMINI_API_KEY to .env

Usage

Step 1: Fetch PRs and Generate Diffs

bun run src/analyzePR.ts --repo OWNER/REPO --author USERNAME --limit 50

Options:

  • --repo (required): Repository in OWNER/REPO format
  • --author (required): GitHub username
  • --limit (optional): Number of PRs to analyze (default: 10)
  • --batch-size (optional): Parallel processing batch size (default: 20)

Example:

bun run src/analyzePR.ts --repo OWNER/REPO --author USERNAME --limit 100

Step 2: Run LLM Analysis

bun run src/llmRunner.ts ./cache/report.json

Analyzes PRs from cache and generates comprehensive reports.

Step 3: Retry Failed Analyses (Optional)

bun run src/llmRunner.ts retry ./reports/1_pr-analysis-report.json ./cache/report.json

Output

PR Reports: cache/{N}_{author}_report.json

  • Contains PR metadata and diff file references

Diff Files: cache/diff/{N}_{repo}_pr{number}_diff.patch

  • Complete PR changes in git patch format

Analysis Reports: reports/{N}_pr-analysis-report.json

  • LLM-generated insights and summaries

Customization

Edit src/prompt.ts to customize LLM analysis prompts.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors