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/rulesetsWhy 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
| Alternative | Type | Trade-off |
|---|---|---|
| glab | Open source | The same tool for GitLab |
| tea | Open source | The same tool for Gitea and Forgejo |
| GitHub Desktop | Free | The graphical equivalent for the pull request half |
git plus curl against the API | — | What gh saves you from writing |
Install
brew install gh