team-pr-radar
v0.2.0
Published
AI-assisted PR review brief sender for Google Chat.
Maintainers
Readme
Team PR Radar
A lightweight PR review brief generator for teams.
It uses GitHub CLI search to find relevant open PRs, classifies their review state, optionally adds AI-powered action insights, and sends a concise brief to Google Chat.
No dashboard. No server. No database. Just a command.
What it does
Team PR Radar helps answer:
- Which PRs are waiting for our team review?
- Which of my PRs are still open and need attention?
- Which PRs I reviewed/commented on may need follow-up?
- What is the likely next action for each PR?
It supports:
- Team review queue via
team-review-requested:<org>/<team> - My open PRs via
author:<me> - Review follow-up via
reviewed-by:<me>andcommenter:<me> - Stale/urgent detection
- CI state detection
- Draft PR filtering
- Optional AI insights using API keys, custom commands, or logged-in Cursor Agent
- Google Chat dry-run and real send modes
Requirements
- Node.js 20+
- GitHub CLI:
gh - Authenticated GitHub/GHE access:
gh auth login --hostname github.example.comFor Cursor Agent AI support, optional:
cursor agent login
cursor agent statusQuick start
# 1. Generate config and GitHub Actions workflow
npx team-pr-radar init
# 2. Edit config
vim config/pr-radar.yml
# 3. Test locally without sending Google Chat
PR_RADAR_DRY_RUN=true npx team-pr-radar
# 4. Send to Google Chat
GOOGLE_CHAT_WEBHOOK_URL='https://chat.googleapis.com/...' npx team-pr-radarFor local development from source:
PR_RADAR_DRY_RUN=true npx tsx scripts/cli.ts --config=config/pr-radar.ymlCLI usage
Team review queue
npx team-pr-radarUses config/pr-radar.yml and shows open PRs currently requested from the configured reviewer team(s).
Example GitHub search:
team-review-requested:acme/ui-reviewersMy open PRs
npx team-pr-radar --mineShows open PRs authored by the current GitHub user in the configured repos.
Example GitHub search:
author:<me>This includes PRs that no longer have pending review requests.
My review follow-ups
npx team-pr-radar --follow-upFinds open PRs you reviewed or commented on, then flags PRs that may need your attention again.
Current follow-up signals:
- New commits after your last review/comment
- Your previous
CHANGES_REQUESTEDreview is still waiting on author action
Example GitHub searches:
reviewed-by:<me>
commenter:<me>Custom config path
npx team-pr-radar --config=config/my-team.yml
npx team-pr-radar --mine --config=config/my-team.yml
npx team-pr-radar --follow-up --config=config/my-team.yml--mine and --follow-up are separate modes and cannot be used together.
Configuration
Example config/pr-radar.yml:
github:
host: github.example.com
org: acme
repos:
- web-app
filters:
reviewers:
include:
- ui-reviewers
exclude: []
rules:
ignore_draft: true
stale_after_hours: 24
urgent_after_hours: 48
max_open_prs_per_repo: 100
max_prs_in_brief: 8
max_prs_to_ai_summarize: 5
include_approved_waiting_merge: true
ai:
enabled: true
provider: auto
model: auto
chat:
title: Team PR Review Brief
timezone: America/Los_AngelesReviewer filters
Bare reviewer names are treated as team names:
filters:
reviewers:
include:
- ui-reviewersEquivalent GitHub search:
team-review-requested:<org>/ui-reviewersYou can also be explicit:
filters:
reviewers:
include:
- team:ui-reviewers
- team:acme/ui-reviewers
- user:some-loginPR states
| State | Meaning | |---|---| | 🟢 Ready for Review | Review has been requested | | 🟠 Needs Reviewer | No reviewer is currently requested | | 🟡 Re-Review Needed | Author pushed after changes were requested | | 🔴 Author Action Needed | Reviewer requested changes | | ✅ Approved | Approved and waiting for merge/maintainer action |
Additional flags:
- CI failure / pending state
- Stale PRs
- Urgent PRs
- Draft PRs ignored by default
AI insights
AI is optional. When enabled, Team PR Radar adds structured insights to the top PRs:
AI: High risk · Owner: reviewer · Confidence: 82%
Summary: Remove moment.js from automation-ui; replace with day-js shim.
Next: Reviewers prioritize stale review; author must fix failing CI before merge.AI returns:
summary— what the PR appears to changenextAction— what should happen nextowner— author, reviewer, maintainer, CI, or unknownrisk— low, medium, high, or unknownconfidence— AI confidence scoreevidence— short reasoning hints
AI provider: auto
Recommended local config:
ai:
enabled: true
provider: auto
model: autoAuto mode tries, in order:
ANTHROPIC_API_KEYOPENAI_API_KEYAI_API_KEYwithai.base_urlAI_COMMANDorai.command- Logged-in Cursor Agent
If Cursor Agent is logged in, no API key is required:
cursor agent statusThe tool automatically uses:
cursor agent -p --mode ask --model auto --trust --output-format textAI provider: command
Use any local AI CLI that reads prompt from stdin and writes answer to stdout:
ai:
enabled: true
provider: command
command: "cursor agent -p --mode ask --model auto --trust --output-format text"Or via environment variable:
AI_COMMAND="cursor agent -p --mode ask --model auto --trust --output-format text" \
PR_RADAR_DRY_RUN=true \
npx team-pr-radarWhen AI runs, logs look like:
AI enabled: using Cursor Agent
Generating AI insights for 5 PR(s)...
AI 1/5: automation #34994
AI insights completed: 5 attempted, 5 succeeded, 0 failed.Google Chat
Dry run:
PR_RADAR_DRY_RUN=true npx team-pr-radarSend for real:
GOOGLE_CHAT_WEBHOOK_URL='https://chat.googleapis.com/...' npx team-pr-radarGitHub Actions
npx team-pr-radar init generates .github/workflows/pr-radar.yml.
Example:
name: PR Radar
on:
schedule:
- cron: '0 10 * * 1-5'
workflow_dispatch:
jobs:
pr-radar:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Send PR brief
run: npx team-pr-radar
env:
GOOGLE_CHAT_WEBHOOK_URL: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}For GitHub Enterprise, ensure your workflow can authenticate to the configured host.
Development
npm install
npm run typecheck
npm run build
# dry-run message generation
npm run test:message
# source CLI dry-run
PR_RADAR_DRY_RUN=true npx tsx scripts/cli.ts --config=config/pr-radar.ymlUseful validation commands:
# Team queue
PR_RADAR_DRY_RUN=true npx tsx scripts/cli.ts --config=config/pr-radar.yml
# My open PRs
PR_RADAR_DRY_RUN=true npx tsx scripts/cli.ts --mine --config=config/pr-radar.yml
# My review follow-ups
PR_RADAR_DRY_RUN=true npx tsx scripts/cli.ts --follow-up --config=config/pr-radar.yml