productivity

Discovering Github CLI

July 8, 2019

Did you know Github has a tool to allow you to access remote repositories right from your command line? Speed up your workflow with this tool.

I recently stumbled onto a package written by Github, which allows for more direct access to your repositories, pull requests and other utilities as well. Quickly install it via homebrew with the following command:

$ brew install hub

It comes with a variety of features, but here are some of the first few that I've found to be useful, such as hub browse. It will open your default browser and navigate to the repository represented in your current directory. You can also navigate to specific sections of the repository as well.

$ hub browse 
$ hub browse -- issues
$ hub browse -- commits
$ hub browse -- wiki

Another useful utility is the ability to navigate pull requests . You can list PR's and even checkout a PR to review it locally as well without leaving your terminal.

$ hub pr list
$ hub checkout <pull request id>

You can even check the status of your last build on your CI tool directly from the plugin as well.

$ hub ci-status

These are just a few features. To check out more of what it has to offer, check out Github's website for hub.