Installation

macOS

gh is available via Homebrew and MacPorts.

Homebrew

Install:

brew install gh

Upgrade:

brew upgrade gh

MacPorts

Install:

sudo port install gh

Upgrade:

sudo port selfupdate && sudo port upgrade gh

Windows

gh is available via scoop, Chocolatey, and as downloadable MSI.

scoop

Install:

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

Upgrade:

scoop update gh

Chocolatey

Install:

choco install gh

Upgrade:

choco upgrade gh

Signed MSI

MSI installers are available for download on the releases page.

Linux

See Linux installation instructions.

Other platforms

Install a prebuilt binary from the releases page

Setting an editor

To set your preferred editor, you can use gh config set [editor]. Read more about gh config.

Additionally if the above is not set, 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.