GitHub CLI Cheatsheet
GitHub CLI lets you do everything on GitHub from the terminal: clone, create PRs, review code, manage issues, trigger Actions, publish releases.
Updated: 2026-07-20·21 commands
Quick Start
``bash
gh auth login # Log in
gh repo clone cli/cli # Clone repo
gh repo create my-project --public
gh pr create --fill # Create PR from commits
gh pr list --state open # List open PRs
gh issue list --label bug # List bug issues
gh run list --limit 5 # List Actions runs
gh release download v1.0 --pattern '*.tar.gz'
``
Startup & Modes(21)
| Command | Level | ||
|---|---|---|---|
gh --helpShow gh help | Basic | gh --help | |
gh auth loginLog in to GitHub account | Basic | gh auth login | |
gh auth statusCheck auth status | Basic | gh auth status | |
gh repo cloneClone a repository locally | Basic | gh repo clone cli/cli | |
gh repo createCreate a new repo (local + remote) | Basic | gh repo create my-project --public | |
gh repo forkFork a repository | Basic | gh repo fork cli/cli | |
gh pr createCreate a Pull Request | Basic | gh pr create --title 'Fix bug' --body 'Description' | |
gh pr listList Pull Requests | Basic | gh pr list --state open | |
gh pr checkoutCheck out a PR locally | Basic | gh pr checkout 42 | |
gh pr reviewSubmit a PR review | Intermediate | gh pr review 42 --approve | |
gh pr mergeMerge a PR | Intermediate | gh pr merge 42 --squash | |
gh issue listList Issues | Basic | gh issue list --label bug | |
gh issue createCreate an Issue | Basic | gh issue create --title 'Bug report' --body '...' | |
gh issue closeClose an Issue | Basic | gh issue close 123 | |
gh run listList Actions workflow runs | Intermediate | gh run list --limit 10 | |
gh run watchWatch Actions run logs in real-time | Intermediate | gh run watch 1234 | |
gh release listList releases | Basic | gh release list | |
gh release downloadDownload release assets | Intermediate | gh release download v1.0 --pattern '*.tar.gz' | |
gh gist createCreate a Gist | Basic | gh gist create script.py --public | |
gh search reposSearch repositories | Intermediate | gh search repos 'topic:rag language:python' --limit 20 | |
gh config setSet git config | Intermediate | gh config set git_protocol ssh |
FAQ
This cheatsheet is compiled from official tool documentation. Last updated: 2026-07-20.