Github Cli on Red Hat Enterprise Linux (RHEL) Installation Guide
First step is to add Github CLI Repo by using config manager. See the steps below for different OS
For RHEL8
sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo sudo dnf install gh
For RHEL7
sudo yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo sudo yum install sudo yum install gh
For other operating systems, please checkout Official Github Page Github
Login to start using Github CLI
gh auth login --with-token "token here" # env variable for token export GH_TOKEN="token here" export GH_REPO="[HOST/]OWNER/REPO"
To Authenticate with Github Enterprise Server
gh auth login -h "domain here" --with-token "token here"
If you prefer to use environment variables
export GH_HOST="hostname here" export GH_ENTERPRISE_TOKEN="token here"
To check authentication status
gh auth status # if you have multiple projects gh auth status -h "hostname"