A powerful command-line tool for comprehensive GitHub Pull Request activity tracking and analysis. Monitor and visualize your contribution patterns across multiple repositories.
- 📊 Multi-repository PR data retrieval and analysis
- 📈 Detailed PR creation and review statistics
- 📅 Flexible date range filtering
- 📊 Monthly activity breakdown
- 📉 ASCII chart visualization of PR trends
- 💾 Data export in multiple formats (JSON, CSV, Excel)
- 🔐 GitHub OAuth authentication support
- Ensure you have Go 1.19 or later installed
- Clone the repository:
git clone https://github.com/adonism2k/gh-pr-tracker
cd gh-pr-tracker- Install dependencies:
make install- Build the binary:
make build- Copy the example environment file:
cp .env.example .env- Configure your environment variables in
.env:
# Option 1: Using Personal Access Token (Classic)
GITHUB_TOKEN=your_github_token_here
# Option 2: Using OAuth (recommended)
GITHUB_CLIENT_ID=your_client_id_here
GITHUB_CLIENT_SECRET=your_client_secret_here
# Default settings
DEFAULT_REPOSITORY=owner/repo
DEFAULT_START_DATE=2025-01-01
DEFAULT_END_DATE=2025-02-22To create a GitHub token:
- Go to GitHub Settings > Developer Settings > Personal Access Tokens > Tokens (classic)
- Generate a new token with 'repo' scope access
- Copy the token to your
.envfile asGITHUB_TOKEN
For a more secure authentication experience:
- View OAuth setup instructions:
make setup-oauth- Go to GitHub Settings > Developer Settings > OAuth Apps > New OAuth App
- Fill in the application details:
- Application name:
GitHub PR Tracker - Homepage URL:
http://localhost:4000 - Authorization callback URL:
http://localhost:4000/callback
- Application name:
- After creating the app, you'll receive a Client ID and can generate a Client Secret
- Add these credentials to your
.envfile:GITHUB_CLIENT_ID=your_client_id_here GITHUB_CLIENT_SECRET=your_client_secret_here
When running the application without a GITHUB_TOKEN, it will automatically:
- Start a local server for OAuth callback
- Open your browser for GitHub authentication
- Handle the OAuth flow securely
- Store and use the received token for API access
# Using default repository and date range from .env
./gh-pr-tracker fetch
# Specify repository and date range
./gh-pr-tracker fetch --repo=owner/repo --start=2025-01-01 --end=2025-02-22
# Multiple repositories
./gh-pr-tracker fetch --repo=owner/repo1,owner/repo2 --start=2025-01-01 --end=2025-02-22# Using default repository and date range
./gh-pr-tracker chart
# Custom repository and date range
./gh-pr-tracker chart --repo=owner/repo --start=2025-01-01 --end=2025-02-22Export PR data in various formats:
# Export to JSON (default)
./gh-pr-tracker export --format=json --output=pr_data.json
# Export to CSV
./gh-pr-tracker export --format=csv --output=pr_data.csv
# Export to Excel
./gh-pr-tracker export --format=xlsx --output=pr_data.xlsx# Build the application
make build
# Fetch PR data
make fetch REPO=owner/repo START_DATE=2025-01-01 END_DATE=2025-02-22
# Generate chart
make chart REPO=owner/repo START_DATE=2025-01-01 END_DATE=2025-02-22
# Export data in different formats
make export REPO=owner/repo START_DATE=2025-01-01 END_DATE=2025-02-22
make export-csv REPO=owner/repo START_DATE=2025-01-01 END_DATE=2025-02-22
make export-excel REPO=owner/repo START_DATE=2025-01-01 END_DATE=2025-02-22
# View OAuth setup instructions
make setup-oauthYour PR Activity Summary:
✓ Total PRs Created: 21
✓ Reviews Made: 1
✓ Open PRs: 1
✓ Closed PRs: 20
✓ Average PRs per month: 10.50
✓ Reviews/PRs Ratio: 0.05
14.00 ┼─╮
13.53 ┤ ╰───╮
12.60 ┤ ╰───╮
11.67 ┤ ╰───╮
10.73 ┤ ╰───╮
9.80 ┤ ╰───╮
8.87 ┤ ╰───╮
7.93 ┤ ╰───╮
7.00 ┤ ╰─
Monthly Breakdown:
• 2025-01 (14 PRs)
• 2025-02 (7 PRs)
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.