Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 1.46 KB

File metadata and controls

64 lines (45 loc) · 1.46 KB

GitHub CLI

Sources

Usage

Installation

Download binary from GitHub CLI repository:

curl -fsSLo "gh_2.73.0_linux_amd64.tar.gz" "https://github.com/cli/cli/releases/download/v2.73.0/gh_2.73.0_linux_amd64.tar.gz"

Extract the tar file:

tar -xf gh_2.73.0_linux_amd64.tar.gz

Copy binary to your /usr/local/bin:

sudo cp gh_2.73.0_linux_amd64/bin/gh /usr/local/bin/

Get gh cli version:

gh version

Uninstall

Delete binary in /usr/local/bin:

sudo rm -rf /usr/local/bin/gh

Authentication

Authenticate against github.com by reading the token from a file:

gh auth login --with-token < mytoken.txt

Use this method when your token is stored in an environment variable (e.g., in CI/CD pipelines or scripts). The token is piped into the gh auth login command via standard input:

echo "$GITHUB_AUTH_TOKEN" | gh auth login --with-token

Install GitHub CLI with Arkade

Run arkade get and follow the instructions:

arkade get gh

You must be wondering what is arkade?

arkade - Open Source Marketplace For Developer Tools

Reletad links