GitHub CLI Tool ⚒

SaravananVijayamuthu
Frontend Weekly
Published in
3 min readOct 19, 2020

--

The GitHub CLI is a recent GitHub released tool that takes tasks of issue / PR management to the terminal. It will be a useful tool that will put more of our workflow for software creation into the textual domain rather than the visual domain. It’s just called.gh

**Installation of GitHub CLI 💡**

GitHub CLI has releases with significant operating systems, visit the installation page and find instructions on how to install GitHub CLI for your operating system.

For [Windows] and [macOS], you will use the package managers to update and maintain GitHub CLI, and for Linux users, you may need to grab the software from the latest release website.

Here are examples of the installation instructions for each compatible platform:

→ Windows

→ macOS

→ Debian/Ubuntu Linux

→ Fedora/Centos Linux

→ Arch Linux

You’ll need to authenticate your account after you install GitHub CLI. Running any command would activate this process of authentication(via OAuth). Well, you can use Git CLI.

**What is CLI really doing? 🤔**

The GitHub CLI lets you handle issues/ PRs / repositories from inside your console. Let’s have a look at it:

It should be said that gh is not the same stuff as git. It’s because gh just adds GitHub tools to the terminal. Version management is yet to be managed with git.

CLI Commands ➫

We’re going to cover a bunch of exciting commands. Let’s use the official Angular.js repo to run gh commands

Clone the Angular repo, and navigate to the repository. You can either clone the repo through HTTPS/ ssh/ Git CLI. I'm going to clone the repo through git CLI since we are working on GIT CLI.

Let’s execute the $gh issue --help see what commands are available.

It’s Time to view Problems/issues in the angular repo.😁

Pull Requests 🤖

It is now possible to build a Pull Request (PR) on the terminal. You will perform $gh pr create right after you have committed a feature or bug branch. This interactively creates the pull request.😉

Let’s execute the $gh pr --help see what commands are available.

Current PR’s in the repo:

$ gh pr list

Let’s view an individual pr:

I’m going with the first pull request.#38899 Through gh cmd $ gh pr view.38899

**Repository 🤖**

Let’s execute the $gh repo --help see what commands are available

It is better to clone a repository using the gh command than with the git command. I have done this above. Only through gh cmd, I have cloned angular repo.

Start functioning. You should create a new PR after this ($gh pr create)! It's sort of remarkable that all of that element is now available in the terminal!😍

Gist 🐱‍🚀

It is now simple to create a gist on GitHub from the terminal using the CLI cmd.

Conclusion 🙀

Git CLI’s primary objective is to “minimize context switching” by allowing you to continue inside your terminal/console, rather than opening your browser to access GitHub. For additional functionality and knowledge on using the current resources, you may link to the manual.

Originally published at https://www.loginradius.com.

--

--

SaravananVijayamuthu
Frontend Weekly

Ambivert. Webdev. Communicator. Internet guru. Coffee enthusiast. cynophile.