GitHub CLI cheat sheet
Every core gh command with its most useful example. Click any command for the full guide, or download the whole thing as Markdown.
Pull Requests
| Command | Does | Example |
| gh pr create |
Open a pull request from the command line |
gh pr create |
| gh pr checkout |
Switch to any PR branch, including forks |
gh pr checkout 123 |
| gh pr list |
List and filter pull requests |
gh pr list |
| gh pr merge |
Merge a PR, your way |
gh pr merge |
| gh pr checks |
See CI status without the browser |
gh pr checks |
| gh pr view |
Read a PR without leaving your shell |
gh pr view |
Repositories
| Command | Does | Example |
| gh repo clone |
Clone with shorthand, no full URL |
gh repo clone cli/cli |
| gh repo create |
Create a repo from your shell |
gh repo create |
| gh repo fork |
Fork and set up remotes in one step |
gh repo fork cli/cli --clone |
| gh repo view |
Read a repo's README and stats in-terminal |
gh repo view |
Issues
Releases & Gists
| Command | Does | Example |
| gh release create |
Tag, note, and ship a release |
gh release create v1.0.0 --generate-notes |
| gh gist create |
Share a snippet in seconds |
gh gist create notes.md |
Automation & API
| Command | Does | Example |
| gh api |
Authenticated API calls, no token juggling |
gh api repos/cli/cli |
| gh workflow run |
Kick off an Actions workflow on demand |
gh workflow run deploy.yml |
| gh run watch |
Follow an Actions run in real time |
gh run watch |
Auth & Config
| Command | Does | Example |
| gh auth status |
Confirm who you're signed in as |
gh auth status |
| gh auth token |
Get the token for scripts and other tools |
gh auth token |
| gh alias set |
Turn long commands into shortcuts |
gh alias set prs 'pr list --author @me' |
| gh extension install |
Add new gh commands from the community |
gh extension install dlvhdr/gh-dash |