prm
is a lightweight command-line tool designed to help developers track their pull requests across multiple repositories and Source Code Management (SCM) providers effortlessly.
- Simple Setup: Provide minimal information about the SCM provider, and
prm
automatically fetches all your repositories. - Fast Performance: Fetch all your PRs, even if there are hundreds, in just a couple of seconds.
- Supports JSON & YAML: Output your data in JSON or YAML for easy integration with other tools.
- Secure: All data stays on your local machine, ensuring privacy. You can purge any locally persisted data with a single command.
A Source Code Management (SCM) provider is any software solution that allows you to host Git repositories, such as GitHub, Harness, GitLab, etc.
- GitHub
- Harness
For any SCM provider you want to use, you need to have the following:
- Host URL: The base URL of that provider (e.g.,
https://github.com
for GitHub orhttps://app.harness.io
for Harness). It can be a cloud service or a self-managed instance, as long as it is accessible from your machine. - PAT: The Personal Access Token (PAT) is a secure way to authenticate with your SCM provider. It allows
prm
to access details like user information, pull requests, and reviewers.
You can run the following command to download the installation script and install prm
. It detects the OS and Arch of your laptop and downloads the latest release of the corresponding binary file.
curl -L https://raw.githubusercontent.com/dhruv1397/prm/main/install.sh | bash
To install a specific version, replace target_version with the version number you'd like to install:
curl -L https://raw.githubusercontent.com/dhruv1397/prm/main/install.sh | bash -s -- target_version
You can download the binary directly from the release page, make it executable and add it to the PATH.
All flags support shorthands ie -t for --type, -o for --output, -s for --state, -n for --name, etc.
1 SCM provider refers to the group of all the repos which can be accessed by a single PAT.
- Github
prm add provider my-github --type github --host https://github.com
- Harness
prm add provider harness-smp --type harness --host https://smp.harness.com
After this you will be prompted to enter your PAT.
You are ready to start monitoring your PRs. To list all the PRs ie open, closed, merged
prm list prs --state all
To list the open PRs
prm list prs --state open
You can filter the PRs further by provider type (--type) and provider name (--name).
You can change the default format from table to json or yaml.
json
prm list prs --output json
yaml
prm list prs --output yaml
You can check what all SCM providers have been configured.
prm list providers
You can filter by name and type.
To remove a provider which is no longer needed or is out of date
prm remove provider my-work-github
This is applicable only to Harness. When you add a Harness SCM provider,
prm
fetches user and repo related data which it uses to fetch the PRs. This user and repo data is persisted in a file to reduce unnecessary calls during fetching the PRs. If any org, project or repo has been added or removed for the user, we need to refresh theprm
config.
prm refresh providers
You can filter by name and type.
If you wish to remove all the data persisted by prm
prm purge
You will be prompted for confirmation post running this command.
Or you can force it
prm purge --force
If you want to uninstall prm, you can execute the following
curl -L https://raw.githubusercontent.com/dhruv1397/prm/main/uninstall.sh | bash
If
prm
was installed in a system directory like /usr/local/bin, you might need sudo to uninstall it
It is important to be aware of what data is accessed by any tool to ensure there is no abuse.
To ensure your data is secure, prm
does not share your data outside your setup.
Moreover, it provides the purge
command to delete all the data persisted by the app.
- linux/amd64
- linux/arm64
- darwin/amd64
- darwin/arm64
Check your OS
uname -s | tr '[:upper:]' '[:lower:]'
Check your Arch
uname -m
Scopes required for PAT: read:org, repo
Generate PAT (classic):
https://docs.github.com/en/rest/authentication/authenticating-to-the-rest-api?apiVersion=2022-11-28#authenticating-with-a-personal-access-token
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#personal-access-tokens-classic
API: https://docs.github.com/en/rest?apiVersion=2022-11-28
Generate PAT: https://developer.harness.io/docs/platform/automation/api/add-and-manage-api-keys/#create-personal-api-keys-and-tokens