Daily accountability for your GitHub PR habits. Reports, for a trailing window (default 7 days):
- PRs you opened
- PRs you authored that were closed (merged or otherwise)
- PR reviews you submitted
and fires a desktop notification (and exits non-zero) when either target is missed:
- Review pull-weight —
reviews >= RATIO × opened(defaultRATIO=1.5). Roughly: every PR you open consumes ~1.2 reviews from teammates, so 1.5 keeps you a net contributor of review attention. - Backlog drain —
closed - opened >= DROP × days(defaultDROP=0, i.e. don't let your open-PR count grow; setDROP=1to wind a backlog down by one PR a day).
GitHub PR activity for octocat — last 7 days (since 2026-07-02T09:00:00Z)
PRs opened 12
PRs closed 18 (merged or otherwise)
Reviews submitted 14
Net open-PR change -6 (opened - closed)
🧐 Review 4 PRs — Reviewed 14, want 18.0 (1.5× 12 opened) over 7d
✅ Backlog on target — Net -6 open over 7d, target <= 0 (close 0/day)
ghinstalled and authenticated (gh auth login) — all API access goes through your own gh credentials; nothing else is stored- Python 3.9+ (stock macOS python3 is fine); the script itself is stdlib-only, no pip installs
- macOS for the scheduled runs and notifications
(
terminal-notifieroptional, for nicer banners); the CLI itself works anywhere
git clone https://github.com/brandonrule11/pr-stats ~/src/pr-stats
~/src/pr-stats/bin/pr-stats-install-agentThe installer writes a LaunchAgent plist to ~/Library/LaunchAgents/ that
runs pr-stats weekdays at 09:00 (HOUR=8 MINUTE=30 bin/pr-stats-install-agent
to change), logging to ~/.local/state/pr-stats.log. Runs missed while the
Mac is asleep are caught up on wake — a wrapper script waits until the
network is genuinely back before querying GitHub. Update with git pull;
uninstall with the launchctl bootout line the installer prints.
For ad-hoc use, just put bin/pr-stats on your PATH.
pr-stats # last 7 days, you
pr-stats 14 # last 14 days
pr-stats 30 octocat # last 30 days for a specific user
pr-stats -r 2.0 -d 1 30 # RATIO=2.0, drain 1 PR/day, 30 days
Defaults for ratio/drop/days/user live in ~/.config/pr-stats.ini, created
with commented defaults on first run. CLI flags override the config per run.
Exit codes: 0 all targets met, 1 a target missed, 2 the run aborted
(GitHub unreachable after retries — pr-stats fails loudly rather than
reporting numbers built from partial data).
Reviews are counted from each PR's GraphQL timeline
(itemTypes: PULL_REQUEST_REVIEW) rather than the REST /reviews list,
because REST returns one review object per reply posted in an existing
thread — which never renders as its own review in the UI. The timeline
matches what GitHub itself displays as "a review". Self-reviews on your own
PRs are excluded.