Skip to content

GitHub CLI

Pull requests, checks and Actions runs without opening a browser.

Homebrew formula Direct download

What it does

gh wraps the GitHub API in task-shaped commands: open and review pull requests, watch check runs, list and rerun workflow runs, manage releases, and gh api for anything without a dedicated subcommand.

gh pr create --fill
gh pr checks --watch
gh run list --branch main --limit 5
gh api repos/:owner/:repo/rulesets

Why it matters

Once a branch is protected — no direct pushes, a required status check — the only route to shipping is a pull request whose checks passed. gh makes that a three-command loop from the terminal instead of a browser round trip, and it is what most make pr-style wrappers are built on.

Notes

gh auth status is the first thing to check when a command returns a 404 on a repository that plainly exists: it is almost always authenticated as the wrong account, or as an account without access.

Alternative to

AlternativeTypeTrade-off
glabOpen sourceThe same tool for GitLab
teaOpen sourceThe same tool for Gitea and Forgejo
GitHub DesktopFreeThe graphical equivalent for the pull request half
git plus curl against the API—What gh saves you from writing

Install

brew install gh

Links

This post is licensed under CC BY 4.0 by the author.
Last updated on