jvelezpo-pager-cli v4.3.9
Introduction
Pager CLI is an NPM module that exposes a set of cli commands that can be used to monitor the health of a subset of Pager's systems. Checkout the Basic Usage section for an example use case.
Installation
- Clone project to your local
- run npm install -gfrom the command line
- expose Github access token through your shell as GITHUB_ACCESS_TOKEN. Follow the steps here to generate a Github access token. Important Provision the token to minimal permissions to get the data you need (read only is enough). Below is a set of permissions that will work with pager-cli commands.
- repo- enable repo:status
- enable repo_deployment Access deployment status
- enable public_repo Access public repositories
- enable repo:invite Access repository invitations
 
- admin:org- enable read:org Read org and team membership
 
- admin:public_key- enable read:public_key Read user public keys
 
- admin:repo_hook  Full control of repository hooks- read:repo_hook Read repository hooks
 
Deploy shas
A table of deploy shas across Pager's environments can be generated by running pager get deploy-shas.  To display all data, certain permissions need to be granted via Github and Aptible.  If --convert-to-csv command option is present, then a csv file corresponding to the deploy-sha table will be created in the pager-cli/data/deploy-shas directory.
If you do not have permissions, you can view previous (possibly out of date) deploy-sha reports here: https://docs.google.com/spreadsheets/d/1wnF1HXoWWC5K9kE2fnxnNIOFhSxF9sWLPsckGqUjF-4/edit?usp=sharing
Basic Commands
- pager get migration-datareturns a table of backend apps and the versions of hapi, lab, and code currently used by the applications.
- pager get pr-countreturns a table of PR counts for each backend app.
- pager -hreturns a help menu
- pager get deploy-shas [row-filter] [column-filter]returns a table of deploy shas across apps and environments.- row-filtertakes app name. To filter by multiple apps, use multiple flags.
- column-filtertakes environment name (i.e. env-*). To filter by multiple environments, use multiple flags.
 
- pager get auth-code [email] [first-name] [last-name] [private-key]- keys
- emailshould not contain- @whatever.com
 
- pager get hrz-auth-code [first-name] [last-name] [private-key]: for generating authcode for mock horizon patients
Using with npx
Another option is to use this CLI, without installation is using npx:
- Instead of pager get migration-datayou can runnpx -p @pager/pager-cli.js pager get migration-data