How to install GitHub CLI (gh) window on Linux

You can download this article in PDF format to support us through the following link.

Download the guide in PDF format

turn off


This guide will explain the installation steps of GitHub CLI on Linux-Ubuntu, Debian, CentOS, Fedora and Windows 10 or Windows server system. GitHub CLI (gh) Is a tool that introduces Github functionality to the command line. The tool brings pull requests, issues, and other GitHub concepts to the terminal next to where git and code are already used.

GitHub CLI (gh) Currently available in Beta, and only applicable to repo agreements hosted on The development team plans to move the project out of the Beta version (probably before the end of 2020). Currently, the GitHub CLI does not support repositories hosted on GitHub Enterprise Server or other hosting providers, but it will be supported once it exits the beta version.

How to install GitHub CLI on Linux

If you are running any version of Linux, the GitHub CLI binaries should work for you.

The latest version you can view gh Use the following command:

VERSION=`curl  "" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/1/' | cut -c2-` 

Download the latest binary file.

curl -sSL${VERSION}/gh_${VERSION}_linux_amd64.tar.gz

Unzip the downloaded file:

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

Copy binary file to /usr/local/bin table of Contents.

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

Use the gh command to confirm the version:

$ gh version
gh version 0.9.0 (2020-05-26)

Copy man page gh.

sudo cp -r gh_${VERSION}_linux_amd64/share/man/man1/* /usr/share/man/man1/

You can see the complete list:

$ ls gh_${VERSION}_linux_amd64/share/man/man1/
gh.1             gh-config-set.1   gh-issue.1         gh-issue-reopen.1  gh-pr-checkout.1  gh-pr-list.1    gh-pr-review.1  gh-repo-clone.1
gh-completion.1  gh-credits.1      gh-issue-close.1   gh-issue-status.1  gh-pr-close.1     gh-pr-merge.1   gh-pr-status.1  gh-repo-create.1
gh-config.1      gh-gist.1         gh-issue-create.1  gh-issue-view.1    gh-pr-create.1    gh-pr-ready.1   gh-pr-view.1    gh-repo-fork.1
gh-config-get.1  gh-gist-create.1  gh-issue-list.1    gh-pr.1            gh-pr-diff.1      gh-pr-reopen.1  gh-repo.1       gh-repo-view.1

Example manual page usage:

$ man gh
$ man gh-issue
$ man gh-pr

If you are using Arch Linux, you can install gh from AUR:

$ yay -S github-cli

How to install GitHub CLI (gh) on Windows

For Windows installation, you can use scoop Or chocolate flavor. Please refer to the following guide:

  • How to install applications from the Windows command line interface
  • Use Chocolatey software management tools to manage Windows applications

Once one of these tools is installed, you can use it to download the GitHub CLI to a Windows computer.

--- Using Chocolatey ---
choco install gh

--- Using scoop ---
scoop bucket add github-gh
scoop install gh

Use GitHub command line tools

Visit Official documentation For more information on using the GitHub CLI (gh)tool

You can download this article in PDF format to support us through the following link.

Download the guide in PDF format

turn off