@hemsoft/prs
v0.1.6
Published
Tool to check PR assignments across GitHub and Bitbucket
Maintainers
Readme
prs
Tool to check PR assignments and do agentic analysis on PRs across GitHub and Bitbucket.
Features
- 🔍 Multi-platform: Check PRs from GitHub and Bitbucket simultaneously
- ⚙️ Flexible Configuration: Environment variables, config files, or CLI options
- 🔄 Watch Mode: Continuous monitoring with configurable refresh intervals
- 📊 Filtered Views: Show approved PRs, merged PRs, or all PRs you're involved with
- 🎯 Smart Detection: Uses gh CLI for GitHub and REST API for Bitbucket
Installation
bun install
bun run build:exeConfiguration
Configuration is loaded from multiple sources (highest priority first):
- Environment variables
- Local config file (
./.prs.json) - User config file (
~/.prs.json) - Defaults
Environment Variables
# GitHub
GITHUB_ORG=your-org
GITHUB_TOKEN=ghp_xxx # Optional, uses gh CLI auth by default
GH_TOKEN=ghp_xxx # Alternative to GITHUB_TOKEN
# Bitbucket
BITBUCKET_WORKSPACE=your-workspace
BITBUCKET_USERNAME=your-username
BITBUCKET_API_KEY=your-api-key
BITBUCKET_USER_DISPLAY_NAME="Your Name"
# Behavior
SKIP_BITBUCKET=false
WATCH_INTERVAL=15Config File Example
Create .prs.json in your home directory or project root:
{
"github": {
"org": "your-org",
"accounts": [
{ "account": "account1", "org": "org1" },
{ "account": "account2", "org": "org2" },
{ "account": "account3", "org": "org3" }
]
},
"bitbucket": {
"workspace": "your-workspace",
"userDisplayName": "Your Name"
},
"skipBitbucket": false,
"watchInterval": 15
}Multi-Account Support:
- If you have multiple GitHub accounts authenticated via
gh, you can specify which accounts to check - Each account can check a different organization
- If
accountsis not specified, only the activeghaccount will be used
See .prs.json.example for a full example.
Usage
Basic Commands
# Check GitHub authentication status
prs auth-check
# Check authentication for a specific org
prs auth-check --org my-organization
# Run in watch mode (default: refreshes every 15 minutes)
prs
# Run once and exit
prs --once
# List PRs you've approved that are still open
prs --approved-open
# List PRs you've approved that were merged since a date
prs --approved-merged-since 2025-01-01
# Custom watch interval (in minutes)
prs --watch 30
# Skip Bitbucket checks
prs --skip-bitbucket
# Enable debug output
prs --debugExamples
# Verify your GitHub authentication before running
prs auth-check
# Quick check of all open PRs
prs --once
# Watch for new PRs every 10 minutes
prs --watch 10
# GitHub only, watch mode
prs --skip-bitbucket
# Check merged PRs from last week
prs --approved-merged-since 2025-01-09 --onceTroubleshooting
GitHub Authentication Issues
If you see errors about missing PRs or authentication:
Check your authentication status:
prs auth-check # or gh auth statusAuthenticate with GitHub CLI:
gh auth loginMake sure to select the account that has access to your organization.
Refresh expired tokens:
gh auth refreshSwitch accounts if needed:
gh auth switchVerify organization access:
prs auth-check --org your-org
Requirements
- Bun runtime
- gh CLI (for GitHub integration) - Install from https://cli.github.com/
- Bitbucket credentials (optional, for Bitbucket integration)
Installation
bun installUsage
bun run devBuild
# Build JavaScript bundle
bun run build
# Build standalone executable (Windows)
bun run build:exeTesting
# Run tests in watch mode
bun test
# Run tests once with coverage
bun run test:coverageQuality Gates
- Linting: Biome (strict mode)
- Type Safety: TypeScript strict mode
- Test Coverage: 90%+ required
- Pre-commit: Auto-lint and test on commit
License
MIT
