How To Use GitHub from your terminal with GitHub CLI

Personally, I never liked switching back and forth between my browser and terminal when working with git repos on GitHub. For this reason, I was excited to hear about the new GitHub CLI.

Installing GitHub CLI 1.0 (beta)


  • homebrew:
  • macPorts:


  • scoop:
  • chocolatey:
  • manual:


If you have Homebrew installed, you can simply use:

  • apt:
  • dnf:
  • zypper:
  • manual:

I will be using Homebrew on WSL Ubuntu for my setup. Follow the appropriate installation instructions from the step above, and you should have the same results.


You must connect to your GitHub account to start using the CLI.

Run gh auth login to start connecting your account.

Next select and then selectPaste an authentication token

Follow the link to get your token: , generate a new token, and paste it into the terminal.

Now select your protocol, I use SSH.

Optional: Run gh auth status to make sure you are logged in.

Creating a New Repo

To create a repo run gh repo your-repo-name

Optionally, you can use flags, for example the -d flag sets the repo’s description.

You will need to tell git where to push for your first push.

Cloning a Repo

gh repo clone <repo>

You can clone a repo using the owner/repo syntax. For example, to clone the repo that I just created, you would use gh repo clone sPesce/my-descriptive-repo . For this example, I will clone the GitHub CLI repo.

That should be enough to get you familiar. GitHub CLI has great documentation — the manual should guide you in performing any of its other functions.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store