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 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.
GitHub CLI is supported for users on GitHub.com and GitHub Enterprise Server 2.20+ with support for macOS, Windows, and Linux.
Documentation
For installation options see below, for usage instructions see the manual.
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.
If you are a hubber and are interested in shipping new commands for the CLI, check out our doc on internal contributions.
Installation
macOS
gh
is available via Homebrew, MacPorts, Conda, Spack, Webi, and as aβ¦
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)