github-pr
Fetch, preview, merge, and test GitHub PRs locally. Great for trying upstream PRs before they're merged.
When & Why to Use This Skill
The GitHub PR skill is a specialized developer utility designed to streamline the local management of GitHub pull requests. By integrating with the GitHub CLI (gh) and Git, it allows developers to fetch, preview, and merge PRs directly from their terminal. Its standout feature is the ability to run full test cycles—including dependency installation and build checks—on upstream PRs before they are merged, ensuring code stability and reducing the friction of open-source maintenance and collaborative development.
Use Cases
- Pre-merge Validation: Previewing PR metadata, CI status, and comments locally to evaluate the quality of a contribution before integration.
- Local Testing & QA: Using the 'test' command to automatically fetch a PR, install dependencies, and run the full test suite in a local environment to catch regressions.
- Streamlined Code Reviews: Fetching a contributor's branch to a local environment to perform deep-dive code reviews or manual UI testing that the web interface cannot provide.
- Conflict Resolution: Merging upstream PRs into a local branch to manually resolve complex merge conflicts and verify the fix before pushing back to the repository.
- Feature Experimentation: Quickly incorporating features from open PRs into a local fork to test compatibility with other experimental changes.
| name | github-pr |
|---|---|
| description | Fetch, preview, merge, and test GitHub PRs locally. Great for trying upstream PRs before they're merged. |
| homepage | https://cli.github.com |
| emoji | "🔀" |
| bins | ["gh", "git"] |
GitHub PR Tool
Fetch and merge GitHub pull requests into your local branch. Perfect for:
- Trying upstream PRs before they're merged
- Incorporating features from open PRs into your fork
- Testing PR compatibility locally
Prerequisites
ghCLI authenticated (gh auth login)- Git repository with remotes configured
Commands
Preview a PR
github-pr preview <owner/repo> <pr-number>
Shows PR title, author, status, files changed, CI status, and recent comments.
Fetch PR branch locally
github-pr fetch <owner/repo> <pr-number> [--branch <name>]
Fetches the PR head into a local branch (default: pr/<number>).
Merge PR into current branch
github-pr merge <owner/repo> <pr-number> [--no-install]
Fetches and merges the PR. Optionally runs install after merge.
Full test cycle
github-pr test <owner/repo> <pr-number>
Fetches, merges, installs dependencies, and runs build + tests.
Examples
# Preview MS Teams PR from clawdbot
github-pr preview clawdbot/clawdbot 404
# Fetch it locally
github-pr fetch clawdbot/clawdbot 404
# Merge into your current branch
github-pr merge clawdbot/clawdbot 404
# Or do the full test cycle
github-pr test clawdbot/clawdbot 404
Notes
- PRs are fetched from the
upstreamremote by default - Use
--remote <name>to specify a different remote - Merge conflicts must be resolved manually
- The
testcommand auto-detects package manager (npm/pnpm/yarn/bun)