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
prmautomatically 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.comfor GitHub orhttps://app.harness.iofor 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
prmto 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 | bashTo 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_versionYou 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.comAfter 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 allTo list the open PRs
prm list prs --state openYou 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 jsonyaml
prm list prs --output yamlYou 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-githubThis is applicable only to Harness. When you add a Harness SCM provider,
prmfetches 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 theprmconfig.
prm refresh providersYou can filter by name and type.
If you wish to remove all the data persisted by prm
prm purgeYou will be prompted for confirmation post running this command.
Or you can force it
prm purge --forceIf you want to uninstall prm, you can execute the following
curl -L https://raw.githubusercontent.com/dhruv1397/prm/main/uninstall.sh | bashIf
prmwas 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 -mScopes 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