Installation and Upgrading

macOS

Install: brew install github/gh/gh

Upgrade: brew update && brew upgrade gh

Windows

gh is available via scoop:

Install:

scoop bucket add github-gh https://github.com/cli/scoop-gh.git
scoop install gh

Upgrade: scoop update gh

Signed MSI installers are also available on the releases page.

Debian/Ubuntu Linux

Install and upgrade:

  1. Download the .deb file from the releases page
  2. sudo apt install git && sudo dpkg -i gh_*_linux_amd64.deb install the downloaded file

Fedora/Centos Linux

Install and upgrade:

  1. Download the .rpm file from the releases page
  2. sudo yum localinstall gh_*_linux_amd64.rpm install the downloaded file

Arch Linux

Arch Linux users can install from the AUR: https://aur.archlinux.org/packages/github-cli/

$ yay -S github-cli

Other platforms

Install a prebuilt binary from the releases page

Setting an editor

For macOS and Linux,gh will respect the following environment variables, in this order, based on your OS and shell setup:

  1. GIT_EDITOR
  2. VISUAL
  3. EDITOR

On Windows, the editor will currently always be Notepad.