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
It can be installed on Windows, macOS, and Linux
On macOS, it can be easily installed using Homebrew or MacPorts using the following commands.
brew install gh brew upgrade gh
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.
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.
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.
GitHub CLI is available for repositories hosted on GitHub.com and GitHub Enterprise Server 2.20+, and to install on macOS, Windows, and Linux.
See the manual for setup and usage instructions.
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.
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 😜