DevLogTechnical writing
Tools

GitHub CLI: Pull Requests, Issues, and More, Without Leaving the Terminal

November 09, 2026

If you live in a terminal, the browser tab waiting for you at the end of every "open a PR" click is friction you've learned to ignore. The GitHub CLI, gh, removes it: it's GitHub's official command-line tool, written in Go, MIT-licensed, and maintained by GitHub itself. The current stable release is v2.103.3 as of late October 2026. Install it with your package manager: brew install gh on macOS, sudo apt install gh on Debian/Ubuntu, sudo dnf install gh on Fedora, or winget install --id GitHub.cli (or choco install gh) on Windows.

Once installed, gh exposes 25+ commands and 200+ subcommands covering almost everything you'd click through in the web UI.

Authenticate once

First, connect your account:

gh auth login

This launches an OAuth device flow: it shows you a one-time code and a GitHub URL, you paste the code and approve in your browser, and gh stores the credentials locally. Do it once, and you're set up. (gh auth status shows you which accounts are active.)

Repos: clone and create

Cloning a repo needs no full URL:

gh repo clone github/docs

Creating a new one is just as direct:

gh repo create my-project

Issues and pull requests

You can file an issue from the terminal in a couple of keystrokes:

gh issue create

Reviewing code is where gh shines. Create a PR from your current branch:

gh pr create

Then switch to any pull request without touching the UI:

gh pr checkout 123

And when it's approved, merge it:

gh pr merge

Each of these commands is interactive: launched without flags, gh walks you through the options like a friendly dialogue rather than asking you to memorize a wall of flags.

GitHub Actions and gists

gh also reaches into your other GitHub work. List and inspect workflow runs:

gh run list

And share a snippet without the web app:

gh gist create notes.md

Make gh yours

Finally, keep your most-used combinations short. Aliases map a name to any command:

gh alias set co 'pr checkout'

The real payoff is composition. gh doesn't replace git; it sits beside it. You branch and commit with git, then create the PR, run the review round-trip, and merge all within the same terminal session. No tab management, no copy-pasting URLs, no context switch. For anyone who reviews PRs daily, that's the difference between a tool and a habit.

← More Tools