A CLI for GitHub App authentication and git operations.
- Node.js 18+
- A GitHub App with a private key and at least one installation
Install directly from GitHub:
npm install -g git+https://github.com/AztecProtocol/github-app-util.gitOr clone and install locally:
git clone https://github.com/AztecProtocol/github-app-util.git
cd github-app-util
npm install && npm link- Copy the example env file:
cp .env.example .env- Fill in your credentials in
.env:
GITHUB_APP_ID=123456
GITHUB_INSTALLATION_ID=789012
GITHUB_PRIVATE_KEY_PATH=./private-key.pem
- Set
GITHUB_PRIVATE_KEY_PATHto the location of your GitHub App private key (.pemfile). Defaults to./private-key.pemif not set.
gh-app <command> [options]
Commands:
token Generate an installation token
pull Pull a repo using a fresh token
clone Clone a repo using a fresh token
check-token Show token validity and expiry
list-repos List accessible repositories
Run gh-app <command> --help for command-specific help.
gh-app tokenTo capture as an environment variable:
export GITHUB_TOKEN=$(gh-app token 2>/dev/null)gh-app pull owner/repo
gh-app pull owner/repo feature-branchgh-app clone owner/repo
gh-app clone owner/repo my-directorygh-app check-tokengh-app list-repos