rikosjett


Install GitHub CLI

Published at 28 March 2021

#git

Manual Install

Get Version

SHELL
VERSION="curl "https://api.github.com/repos/cli/cli/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/' | cut -c2-"

Download latest version

With wget

SHELL
$ wget https://github.com/cli/cli/releases/download/v${VERSION}/gh_${VERSION}_linux_amd64.tar.gz

With curl

SHELL
$ curl -sSL https://github.com/cli/cli/releases/download/v${VERSION}/gh_${VERSION}_linux_amd64.tar.gz -o gh_${VERSION}_linux_amd64.tar.gz

Extract downloaded file

SHELL
$ tar xvf gh_${VERSION}_linux_amd64.tar.gz

Copy to /usr/local/bin

SHELL
$ sudo cp gh_${VERSION}_linux_amd64/bin/gh /usr/local/bin/