npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pandaswhocode/pr-mirror

v2.3.1

Published

PR Mirror is a CLI tool to mirror an existing pull request from a public GitHub repository.

Readme

PR Mirror

PR Mirror is a CLI tool to mirror an existing pull request from a public GitHub repository by:

  1. Cloning the repo (via SSH),
  2. Fetching the pull request as a local branch,
  3. Creating a new branch based on it with an empty signed commit (to distinguish the mirror),
  4. Pushing the branch to the same repo,
  5. Opening a new pull request (via the GitHub CLI) from the mirrored branch into a specified base branch.

This is useful in scenarios like:

  • Creating a filtered or internal mirror of external PRs
  • Testing PRs against a different base branch (e.g., staging instead of main)

Prerequisites

Node.js (see package engines)

git (must be in PATH)

GitHub CLI (gh) installed and authenticated (via gh auth login)

Git commit signing configured (required). This tool uses git commit -S for the tracking commits.

SSH access to GitHub ([email protected] must be reachable)

Usage

prmirror [-b <base-branch>] -n <pr-number> -o <org> -r <repo> [-d] [-s] [-v]

# Clean up mirror-repo directory and exit
prmirror -c

Installation

npm install -g @pandaswhocode/pr-mirror

Or run without installing:

npx @pandaswhocode/pr-mirror -n <pr-number> -b <base-branch> -o <org> -r <repo>

Arguments

| Flag | Description | | ----------------------- | ------------------------------------------------------------------------------------------------------------------------- | | -b, --base | Base branch to target for the new PR (defaults to DEFAULT_BASE or main) | | -c, --clean | Delete the mirror-repo directory and exit (no other arguments are needed) | | -o, --org | GitHub organization (can use DEFAULT_ORG env var) | | -r, --repo | GitHub repository name (can use DEFAULT_REPO env var) | | -s, --sync | Sync the mirror-pr branch and update the mirror PR | | -d, --deleteAfterAction | Delete the mirror-repo directory after a successful create/sync run (cleanup errors are logged but do not fail the run) | | -h, --help | Show help | | -n, --number | (Required) Pull request number to mirror | | -v, --verify | Show resolved inputs and ask for confirmation before proceeding |

Environment variables

You can set defaults in a .env file in your working directory:

  • DEFAULT_ORG
  • DEFAULT_REPO
  • DEFAULT_BASE
  • DEBUG (set to true for verbose logging)

Note: if DEFAULT_BASE is not set and --base is not provided, the base branch defaults to main.

Example (Create new mirror)

prmirror -n 42 -b main -o PandasWhoCode -r pr-mirror

To verify the resolved inputs before making any changes:

prmirror -n 42 -b main -o PandasWhoCode -r pr-mirror -v

This will:

  • Clone [email protected]:PandasWhoCode/pr-mirror.git into a temporary mirror-repo directory
  • Fetch pull request #42 into a temporary branch
  • Create a new branch mirror/pr-42 from it
  • Add an empty signed commit for traceability
  • Push mirror/pr-42 to origin
  • Open a new pull request targeting main, authored by your GitHub CLI user

Output

The new PR will be titled:

chore:Mirror PR-42

And will include all commits from the original PR, along with an empty commit to mark it as mirrored.

Example (Sync existing mirror)

prmirror -n 42 -b main -o PandasWhoCode -r pr-mirror -s

This will:

  • Clone [email protected]:PandasWhoCode/pr-mirror.git into a temporary mirror-repo directory
  • Fetch pull request #42 into a temporary branch
  • Sync the branch mirror/pr-42 from with the temporary branch
  • Add an empty signed commit for traceability
  • Push mirror/pr-42 to origin

Output

The existing mirror PR will be titled:

chore: Mirror PR-42 (sync)

The PR will include all commits from the original PR, along with an empty commit to mark it as mirrored.

Example (Delete mirror-repo after success)

prmirror -n 42 -b main -o PandasWhoCode -r pr-mirror -d

Example (Clean mode)

This deletes the local mirror-repo directory and exits without doing any other work:

prmirror -c

Notes

The tool exports GITHUB_TOKEN and GITHUB_UNAME using the GitHub CLI so that gh pr create can assign the author correctly.

The mirror-repo directory is created in the current working directory.

License

Apache 2.0