NAV

🌱 Introduction

If you are a maintainer of Open Source Software, you need to review a lot of PR, this tool is made for you.

With the GitHub feature “repository maintainer permissions on existing pull requests”, now we can edit real PR branch. This tool allow to easily manage PR branches and remotes.

prm

💼 Features:

💫 Checkout

Interactive (Remote)

prm
# item "checkout"

# or #

prm checkout

# or #

prm c

Interactive (Local)

prm
# item "list"

By Number

prm checkout 1234

# or #

prm c 1234

💫 Remove

Interactive

Only for the current project.

prm
# item "remove"

# or #

prm rm

By Number

prm rm 1234

# or #

prm remove 1234

All

Only for the current project. (not all PR for all your projects)

prm rm --all

💫 Push

prm push

Push Force

prm pf

💫 List

# display local branches related to PR. (current project only)
prm list

# display local branches related to PR. (all projects)
prm list --all

# display local branches related to PR. (add projects without 0 related PR)
prm list --all --skip-empty=false

Display local branches related to PR for:

💫 Clone

# clone and fork (if needed) a repository.
prm clone git@github.com:user/repo.git

# clone (don't create fork on GitHub).
prm clone -n git@github.com:user/repo.git

# clone and fork (if needed) a repository,
# and use the username as root directory.
prm clone -r git@github.com:user/repo.git

# clone and fork (if needed) a repository.
# The fork will be created in an organization.
prm clone -o myorg git@github.com:user/repo.git

Clone a repository:

💫 Help

prm -h

# or #

prm <command> -h

Display PRM help

🔒 Private Repositories

If you need to use prm for a private repository:

Create a Github Token

PRM_GITHUB_TOKEN

export PRM_GITHUB_TOKEN=xxxxxxx

Set the environment variable PRM_GITHUB_TOKEN with this token’s value.

PRM_GITHUB_TOKEN_FILE

Set the environment variable PRM_GITHUB_TOKEN_FILE with a path to file that contains this token’s value.

export PRM_GITHUB_TOKEN_FILE=/path/to/my/token/secret.txt

🔒 GitHub Enterprise

PRM_GITHUB_API_BASE_URL

To use prm with GitHub Enterprise,

export PRM_GITHUB_API_BASE_URL=https://example.com/api/v3

Set the environment variable PRM_GITHUB_API_BASE_URL with the URL of the domain endpoint of your GitHub Enterprise instance.

PRM_GITHUB_API_BASE_URL_FILE

Set the environment variable PRM_GITHUB_API_BASE_URL_FILE with a path to file that contains the URL of the domain endpoint of your GitHub Enterprise instance.

export PRM_GITHUB_API_BASE_URL_FILE=/path/to/my/token/secret.txt

📦 How to Install

Linux

From Package Manager

ArchLinux (AUR)

yay -S prm

You can use a package manager:

From Binaries

You can use pre-compiled binaries:

MacOS

From Package Manager

Homebrew Taps

brew tap ldez/tap
brew update
brew install prm

You can use a package manager:

From Binaries

You can use pre-compiled binaries:

Windows

From Package Manager

Scoop main bucket

scoop install prm

Scoop Bucket

scoop bucket add prm https://github.com/ldez/scoop-bucket.git
scoop install prm

You can use a package manager:

From Binaries

You can use pre-compiled binaries:

From Sources

go get -u github.com/ldez/prm