Shawn Mervin

GitHub CLI

gh brings GitHub's pull requests, issues and repositories into the same terminal where I do everything else.

Visit cli.github.comAt the command line

What it is

GitHub CLI, run as gh, is GitHub's official command line tool. It lets you create and review pull requests, open and comment on issues, clone and create repositories, watch Actions runs and make authenticated API calls, all from a terminal. It works alongside git rather than replacing it: git handles the code, gh handles the GitHub side.

Because each action is a command, gh is easy to use in scripts and by AI coding agents. Its api subcommand calls GitHub's REST or GraphQL API with the user's existing login, which covers anything the built-in commands do not. It authenticates once through the browser or a token and remembers the login. Output can be formatted as JSON, so other tools can read it.

How I use it

  • Part of the 14 command line tools I work with every day.
  • Used for repositories hosted on GitHub. My product repositories live on AWS CodeCommit, where gh does not apply.
  • Fits the way I work with AI agents: they run in the terminal next to me, under the same scripts and rules, and every change is reviewed before release.

gh is the right tool when the code lives on GitHub and the workflow around it, pull requests and reviews, should be as scriptable as the code itself. I reach for it because my day already happens in a terminal, and keeping review in the same place means fewer steps to forget.

Questions

What is the difference between git and the GitHub CLI?

git manages the code and its history on your machine. The GitHub CLI manages the things that only exist on GitHub, like pull requests, issues and Actions runs.

Do you use GitHub for your products?

My product repositories are on AWS CodeCommit. I use the GitHub CLI where a project is hosted on GitHub.

Working with GitHub CLI?

Tell me what you're building. Start a project or see the whole stack.

Got an operation that's outgrown its spreadsheets?

Tell me what your business does and where it's jamming up. If I'm not the right person for it, I'll say so and point you somewhere better.

What to send, and what happens next