An open API service indexing awesome lists of open source software.

https://github.com/sulthonzh/gh-prs

See open pull requests across all your GitHub repos at a glance
https://github.com/sulthonzh/gh-prs

cli github productivity pull-requests

Last synced: 8 days ago
JSON representation

See open pull requests across all your GitHub repos at a glance

Awesome Lists containing this project

README

          

# gh-prs

See all open pull requests across your GitHub repos at a glance.

Because `gh pr list` only shows one repo at a time, and you've got better things to do than check them one by one.

## Why

You maintain multiple repos. PRs pile up. Some go stale. Some need review. You want a single command that shows you everything โ€” who opened what, how old it is, whether it's been reviewed.

## Install

```bash
npm install -g gh-prs
```

Requires [gh CLI](https://cli.github.com) to be installed and authenticated.

## Usage

```bash
# Show all open PRs across your repos
gh-prs

# Specific repo
gh-prs --repo sulthonzh/my-project

# Different user
gh-prs --user octocat

# JSON output (pipe to jq, scripts, etc.)
gh-prs --json

# Markdown (paste into docs/issues)
gh-prs --markdown

# Summary stats
gh-prs --summary

# Show repos with zero PRs too
gh-prs --verbose

# Limit repos scanned
gh-prs --limit 10
```

## Output Example

```
๐Ÿ” Open Pull Requests (3 total across 15 repos)

๐Ÿ“‚ sulthonzh/my-project
#42 Fix auth bug [bug]
by @dev1 ยท 2 days old ยท 2 files (+10/-5) โœ…
#43 Add feature X [DRAFT]
by @dev2 ยท 8 days old ยท 5 files (+100/-20) โณ

๐Ÿ“‚ sulthonzh/other-project
#7 Update dependencies
by @dependabot ยท 1 day old ยท 1 file (+5/-5) โณ
```

Review status icons:
- โœ… Approved
- ๐Ÿ”„ Changes requested
- โณ Awaiting review

## Summary Mode

```
๐Ÿ“Š PR Summary
Total open: 3
Drafts: 1
Stale (7+ days): 1
Repos with PRs: 2/15
```

## Exit Codes

- `0` โ€” No open PRs found
- `1` โ€” PRs found (useful for CI: "no stale PRs" checks)
- `2` โ€” Error (gh not installed, auth issue, etc.)

## Programmatic API

```js
const { run, formatJSON, formatSummary } = require('gh-prs');

// Full run
const output = await run({ user: 'octocat', json: true });

// Or use formatters directly
const { getOpenPRs, formatText } = require('gh-prs');
const prs = getOpenPRs('user/repo');
console.log(formatText([{ repo: 'user/repo', prs }]));
```

## License

MIT