Skip to content
By Arunan Skanthan

Reduce context switching from terminal with GitHub CLI

Context switching isn’t great for productivity—at least not for me. So I like to stay in one mode (editing code, reading emails, etc.) for as long as I can, whenever possible.

Previously I had written about gitsh which allowed you to type less and stay in the terminal to make your git tasks a little easier. In this post I’d like to look at GitHub CLI. I’ll use the gh command to reference it for the rest of this post.

gh and hub, it’s unofficial predecessor, are both command line tools to perform tasks on GitHub (the service). Combining gh with gitsh pretty much allows you to pretty much stay in the terminal for working with Git and GitHub most, if not all the time. I do tend to reach for a GUI for looking at timelines in complex scenarios, as I find that a bit more user friendly, and I don’t know every single Git intricacy.

For the more advanced user, this also means you could script and automate parts of your workflow if you choose to do so. Or pair it up with your favourite CLI text editor and you may not have to leave the command line except to switch to the Browser when working on web development. You can even alias complex commands to simplify them and remember them more easily.

Some examples of what you can do with GitHub CLI are:

  • gh issue list will show all issues in current repository
  • gh issue status will show all issues assigned to, mentioning, and opened by you
  • gh pr list will let you see and filter issues in the current repository
  • gh pr status will check the status of current pull requests
  • gh pr create will create a pull request

There are a lot more in the GitHub CLI Manual, I just picked a few for you to get the idea. Give it a spin, it could save you time and make your workflow more efficient.

Popular Articles by Our Team

Our expert team of designers and developers love what the do and enjoy sharing their knowledge with the world.

We Hire Only the Best

reinteractive is Australia’s largest dedicated Ruby on Rails development company. We don’t cut corners and we know what we are doing.

We are an organisation made up of amazing individuals and we take pride in our team. We are 100% remote work enabling us to choose the best talent no matter which part of the country they live in. reinteractive is dedicated to making it a great place for any developer to work.

Free Community Workshops

We created the Ruby on Rails InstallFest and Ruby on Rails Development Hub to help introduce new people to software development and to help existing developers hone their skills. These workshops provide invaluable mentorship to train developers, addressing key skills shortages in the industry. Software development is a great career choice for all ages and these events help you get started and skilled up.

  • Webinars


    Webinars are our online portal for tips, tricks and lessons learned in everything we do. Make the most of this free resource to help you become a better developer.

    Learn more about webinars

  • Installfest


    The Ruby on Rails Installfest includes a full setup of your development environment and step-by-step instructions on how to build your first app hosted on Heroku. Over 1,800 attendees to date and counting.

    Learn more about Installfest

  • Development Hub

    Development Hub

    The Ruby on Rails Development Hub is a monthly event where you will get the chance to spend time with our team and others in the community to improve and hone your Ruby on Rails skills.

    Learn more about Development Hub

Get the “reinteractive Review” Monthly Email