A CLI tool that analyzes GitHub pull requests and shows why they cannot be merged.
- Comprehensive PR status overview:
- CI Status: Lists individual failing/pending check names with color-coded indicators
- Review Status: Shows approval state and requested changes
- Comments: Displays unresolved comment counts with clickable links
- Merge Conflicts: Detects branch conflicts
- Beautiful terminal output with Rich tables and color-coded status indicators
- HTML export for shareable reports with styled tables and clickable links
- Organized multi-column layout for quick scanning
- Summary statistics showing ready-to-merge vs blocked PRs
- Fast async HTTP requests for quick analysis
- ✅ Green - Good/Passing/Ready
- ❌ Red - Blocking issue
- ⏳ Yellow - Pending/In progress
- ➖ Gray - Not applicable/None
# Clone the repository
git clone https://github.com/rnetser/gh-pr-analyzer.git
cd gh-pr-analyzer
# Install with uv
uv syncA GitHub personal access token is optional but recommended for better API limits and access to private repositories.
Without a token:
- ✅ Access to public repositories only
⚠️ Rate limited to 60 requests/hour⚠️ Warning banner shown in output⚠️ Username argument is REQUIRED (cannot analyze your own PRs)
With a token:
- ✅ Access to public and private repositories
- ✅ 5,000 requests/hour rate limit
- ✅ Full functionality
- ✅ Username is optional (defaults to authenticated user)
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click "Generate new token (classic)"
- Give your token a descriptive name
- Select the following scopes:
repo- Full control of private repositoriesread:user- Read user profile data
- Click "Generate token"
- Copy the token immediately (you won't be able to see it again)
export GITHUB_TOKEN="your_token_here"To make this permanent, add it to your shell profile (~/.bashrc, ~/.zshrc, etc.):
# Without token: username is REQUIRED
uv run gh-pr-analyzer <username>
# With token: analyze your own PRs (username optional)
export GITHUB_TOKEN="your_token_here"
uv run gh-pr-analyzer
# With token: analyze another user's PRs
export GITHUB_TOKEN="your_token_here"
uv run gh-pr-analyzer <username>Important: Without a GITHUB_TOKEN, you must provide a username argument. The token is required to analyze your own PRs.
# Export another user's PRs to an HTML file
uv run gh-pr-analyzer username --html report.html
# Export your own PRs to HTML (requires GITHUB_TOKEN)
export GITHUB_TOKEN="your_token_here"
uv run gh-pr-analyzer --html my-prs.htmlThe HTML export includes:
- Summary statistics at the top of the report
- All unresolved comments with clickable links (no truncation)
- Responsive design that fits browser width
- Styled table with color-coded status badges
- Warning banner when running without authentication token
- Generation timestamp
PR Analysis Results
┏━━━━━━━━━━━━━━┳━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Repository ┃ PR #┃ Title ┃ CI Status ┃ Reviews ┃ Comments ┃ Conflicts ┃
┡━━━━━━━━━━━━━━╇━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ org/repo │ #42 │ Add auth feature │ ❌ Failing: │ ❌ Changes │ ❌ 2 unresolved: │ ✅ Clean │
│ │ │ │ • lint │ requested │ • github.com/.../r123 │ │
│ │ │ │ • test-unit │ │ • github.com/.../r456 │ │
├──────────────┼─────┼──────────────────┼─────────────────────┼──────────────┼─────────────────────────────┼────────────┤
│ org/repo2 │ #15 │ Fix login bug │ ✅ Passing │ ✅ Approved │ ✅ Resolved │ ✅ Clean │
├──────────────┼─────┼──────────────────┼─────────────────────┼──────────────┼─────────────────────────────┼────────────┤
│ org/repo3 │ #78 │ Update API docs │ ⏳ Pending: │ ⏳ Pending │ ➖ None │ ❌ Conflicts│
│ │ │ │ • deploy-preview │ │ │ │
└──────────────┴─────┴──────────────────┴─────────────────────┴──────────────┴─────────────────────────────┴────────────┘
Summary:
✅ Ready to merge: 1
❌ Blocked: 2
Total PRs: 3
uv run pytest -vuv run pytest --covuv run mypy src/gh_pr_analyzerMIT License - see the LICENSE file for details.