Skip to content

Commit 34dc0ee

Browse files
committed
Improve README, add screenshots
1 parent cee4d09 commit 34dc0ee

File tree

5 files changed

+61
-36
lines changed

5 files changed

+61
-36
lines changed

README.md

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,66 @@
11
# 🚀 prs
22

3-
> Only shows PRs waiting on YOU - preserving your focus time and sanity
3+
> Only shows PRs waiting on YOU
44
5-
A blazingly fast CLI tool that filters out all the noise to show only the PRs that need your action. No more context switching through dozens of PRs that don't need you right now.
5+
A fast CLI that filters GitHub PRs to show only what needs your attention. No more digging through dozens of PRs to find the ones that actually need you.
66

77
## Quick Start
88

99
```bash
1010
go install github.com/ready-to-review/prs@latest
11+
prs
1112
```
1213

13-
**Prerequisites:** Go 1.23+ and GitHub CLI (`gh`) authenticated
14+
**Requirements:** Go 1.23+ and GitHub CLI (`gh`) authenticated
1415

1516
## Usage
1617

1718
```bash
18-
# The default - shows ONLY PRs waiting on your input
19+
# Show PRs you're involved with (filters out stale PRs)
1920
prs
2021

21-
# See everything you're involved with (if you really want to)
22-
prs --all
22+
# Only PRs waiting for your review
23+
prs --blocked
24+
25+
# Include old/stale PRs
26+
prs --include-stale
2327

24-
# Stay focused - auto-refresh what needs your attention (every 10 min)
28+
# Auto-refresh view
2529
prs --watch
2630

27-
# Get alerted to newly blocking PRs (notifications currently unavailable)
31+
# Get notified when PRs need attention
2832
prs --notify
2933
```
3034

3135
## What You'll See
3236

33-
```
34-
🔥 2 PRs awaiting your review
35-
36-
⬇️ Incoming PRs
37+
### Default View (`prs`)
38+
![Default View](media/default.png)
3739

38-
● 🚧 Fix authentication bug ⚡
39-
3h • https://github.com/org/repo/pull/123
40+
### Focus Mode (`prs --blocked`)
41+
![Watch Blocked View](media/watch_blocked.png)
4042

41-
● ✅ Add user preferences
42-
1d • https://github.com/org/repo/pull/456
43-
44-
⬆️ Your PRs
43+
## Options
4544

46-
● 📝 Update documentation
47-
2h • https://github.com/org/repo/pull/789
48-
```
45+
- `--blocked` - Only PRs blocking on you
46+
- `--include-stale` - Include old PRs (hidden by default)
47+
- `--watch` - Live updates
48+
- `--notify` - Desktop notifications
49+
- `--org` - Filter to specific organization
50+
- `--debug` - Show debug info
4951

50-
## Options
52+
## Status Icons
5153

52-
- `--all` - Show all your PRs, not just review requests
53-
- `--watch` - Keep watching for updates (10 min intervals)
54-
- `--watch-interval N` - Customize refresh rate (minutes)
55-
- `--notify` - New PR alerts (⚠️ currently disabled)
56-
- `--verbose` - Debug mode for the curious
54+
- 🚧 Draft PR
55+
- ✅ Ready to merge
56+
- 👍 Has approval
57+
- 💥 Merge conflict
58+
- ⏰ Stale PR
59+
- ❌ Failing tests
60+
- 📝 Regular PR
5761

58-
## Why This Exists
62+
## Why This Tool?
5963

60-
**Focus is precious.** This tool shows ONLY the PRs blocked on your input - nothing else. No PRs waiting on CI, no PRs waiting on other reviewers, no PRs you've already reviewed. Just the ones that need you, right now.
64+
Stop context switching through GitHub tabs. This tool uses smart filtering to show only PRs that actually need your input - not PRs waiting on CI, other reviewers, or ones you've already reviewed.
6165

62-
Built with Go for speed, because waiting for your tools is another focus killer.
66+
Built fast in Go because your development tools shouldn't slow you down.

main.go

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ func main() {
193193
notify = flag.Bool("notify", false, "Watch for PRs and notify when they become newly blocking")
194194
turnServer = flag.String("turn-server", defaultTurnServerURL, "Turn server URL for enhanced metadata")
195195
org = flag.String("org", "", "Filter PRs to specific organization")
196+
includeStale = flag.Bool("include-stale", false, "Include stale PRs in the output")
196197
debug bool
197198
)
198199
flag.BoolVar(&debug, "debug", false, "Show debug information including API calls and turnclient data")
@@ -278,7 +279,7 @@ func main() {
278279

279280
// If either watch or notify is set, run in watch mode
280281
if *watch || *notify {
281-
runWatchMode(ctx, token, username, *blocked, *notify, *watchInterval, logger, httpClient, turnClient, debug, *org)
282+
runWatchMode(ctx, token, username, *blocked, *notify, *watchInterval, logger, httpClient, turnClient, debug, *org, *includeStale)
282283
} else {
283284
// One-time display
284285
prs, err := fetchPRsWithRetry(ctx, token, username, logger, httpClient, turnClient, debug, *org)
@@ -290,7 +291,7 @@ func main() {
290291
}
291292
os.Exit(1)
292293
}
293-
displayPRs(prs, username, *blocked, debug)
294+
displayPRs(prs, username, *blocked, debug, *includeStale)
294295
}
295296
}
296297

@@ -707,7 +708,27 @@ func isBlockingOnUser(pr PR, username string) bool {
707708
return false
708709
}
709710

710-
func displayPRs(prs []PR, username string, blockingOnly bool, debug bool) {
711+
func displayPRs(prs []PR, username string, blockingOnly bool, debug bool, includeStale bool) {
712+
// Filter out stale PRs unless includeStale is true
713+
if !includeStale {
714+
var filteredPRs []PR
715+
for _, pr := range prs {
716+
isStale := false
717+
if pr.TurnResponse != nil {
718+
for _, tag := range pr.TurnResponse.PRState.Tags {
719+
if tag == "stale" {
720+
isStale = true
721+
break
722+
}
723+
}
724+
}
725+
if !isStale {
726+
filteredPRs = append(filteredPRs, pr)
727+
}
728+
}
729+
prs = filteredPRs
730+
}
731+
711732
incoming, outgoing := categorizePRs(prs, username)
712733
blockingCount := countBlockingPRs(incoming, username, debug)
713734

@@ -990,7 +1011,7 @@ func truncateURL(url string, maxLen int) string {
9901011
return truncate(url, maxLen)
9911012
}
9921013

993-
func runWatchMode(ctx context.Context, token, username string, blockingOnly bool, notifyMode bool, interval time.Duration, logger *log.Logger, httpClient *http.Client, turnClient *turn.Client, debug bool, org string) {
1014+
func runWatchMode(ctx context.Context, token, username string, blockingOnly bool, notifyMode bool, interval time.Duration, logger *log.Logger, httpClient *http.Client, turnClient *turn.Client, debug bool, org string, includeStale bool) {
9941015
// Clear screen only if not in notify mode
9951016
if !notifyMode {
9961017
fmt.Print("\033[H\033[2J")
@@ -1013,7 +1034,7 @@ func runWatchMode(ctx context.Context, token, username string, blockingOnly bool
10131034
header := "🔄 Live PR Dashboard - Press 'q' to quit"
10141035
fmt.Println(titleStyle.Render(header))
10151036
fmt.Println()
1016-
displayPRs(prs, username, blockingOnly, debug)
1037+
displayPRs(prs, username, blockingOnly, debug, includeStale)
10171038
}
10181039
}
10191040

@@ -1049,7 +1070,7 @@ func runWatchMode(ctx context.Context, token, username string, blockingOnly bool
10491070
header := "🔄 Live PR Dashboard - Press 'q' to quit"
10501071
fmt.Println(titleStyle.Render(header))
10511072
fmt.Println()
1052-
displayPRs(prs, username, blockingOnly, debug)
1073+
displayPRs(prs, username, blockingOnly, debug, includeStale)
10531074
}
10541075
// In notify mode, don't clear screen - just show new PRs below
10551076

media/default.png

397 KB
Loading

media/watch_blocked.png

76.6 KB
Loading

prs

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)