loading...
Cover image for Github CLI 1.0 released πŸŽ‰

Github CLI 1.0 released πŸŽ‰

jasmin profile image Jasmin Virdi ・2 min read

Github has recently released Github CLI which will help us to easily create workflows from the terminal with the aim of less context switching.

It provides the following benefits which will help you in several ways

  • Run the entire workflow, from issues through releases.

  • Call Github API to script any action, and set custom alias for any command.

  • Connect to enterprise server in addition to Github.com

Installation

It can be installed on Windows, macOS, and Linux

On macOS, it can be easily installed using Homebrew or MacPorts using the following commands.

Homebrew

brew install gh
brew upgrade gh

MacPorts

sudo port install gh
sudo port selfupdate && sudo port upgrade gh

For Linux, you can follow the installation process here.

Windows installation can be done using scoop, Chocolatey, and as downloadable MSI.

Commands (the interesting part πŸ€” )

After a successful installation, you need to authenticate your Github account.

To authenticate your account use the following command. Series of steps will be followed to complete your authentication process.

gh auth login

After authentication, you can use the GitHub CLI πŸ₯³

With the help of commands that come with Github CLI, you can easily achieve the tasks required to be done using the browser.

I found the following things pretty useful to done using CLI πŸ˜‰

  • Creating and forking your repo

  • Create, delete upload, download and manage your release.

  • Create, review and check the status of your PR.

  • Open, review, tag, create and check the status of all the issues or the ones specifically assigned to you.

  • Create gist using a specific file or multiple files.

  • Make a request to Github API and print the response.

  • Generate shell scripts for Github CLI commands.

  • Set up aliases for most used GitHub commands.

You can find more details about the commands and setup process here.

GitHub logo cli / cli

GitHub’s official command line tool

GitHub CLI

gh is GitHub on the command line. It brings pull requests, issues, and other GitHub concepts to the terminal next to where you are already working with git and your code.

screenshot of gh pr status

Availability

GitHub CLI is available for repositories hosted on GitHub.com and GitHub Enterprise Server 2.20+, and to install on macOS, Windows, and Linux.

Documentation

Read the official docs for usage and more information.

We want your feedback

We'd love to hear your feedback about gh. If you spot bugs or have features that you'd really like to see in gh, please check out the contributing page.

Installation

macOS

gh is available via Homebrew and MacPorts.

Homebrew

Install: Upgrade:
brew install gh brew upgrade gh

MacPorts

Install: Upgrade:
sudo port install gh sudo port selfupdate && sudo port upgrade gh

Linux

See Linux installation docs.

Windows

gh is available via scoop, Chocolatey…

I am excited to explore more about Github CLI as this will make my work a bit easy with less context switching and I'll be able to concentrate better without switching desktops 😜

Posted on by:

Discussion

pic
Editor guide