DEV Community

Cover image for Github CLI 1.0 released πŸŽ‰
Jasmin Virdi
Jasmin Virdi

Posted on

Github CLI 1.0 released πŸŽ‰

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
Enter fullscreen mode Exit fullscreen mode

MacPorts

sudo port install gh
sudo port selfupdate && sudo port upgrade gh
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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

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

See the manual for setup and usage instructions.

Contributing

If anything feels off, or if you feel that some functionality is missing, please check out the contributing page. There you will find instructions for sharing your feedback, building the tool locally, and submitting pull requests to the project.

Installation

macOS

gh is available via Homebrew, MacPorts, Conda, Spack, and as a downloadable binary from the releases page.

Homebrew

Install: Upgrade:
brew install gh brew upgrade gh

MacPorts

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

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 😜

Top comments (0)