A
cd ..
Git

GitHub CLI (gh)

Manage GitHub repositories, issues, and PRs from the command line.

2025-09-27
github, git, cli

Install GitHub CLI

# macOS
brew install gh

# Ubuntu/Debian
sudo apt install gh

Authenticate

gh auth login

Clone repository

gh repo clone owner/repo

Create repository

gh repo create my-new-repo --public

View repository

gh repo view

List repositories

gh repo list

Create issue

gh issue create --title "Bug: Login fails" --body "Description here"

List issues

gh issue list

View issue

gh issue view 123

Close issue

gh issue close 123

Create pull request

gh pr create --title "Add new feature" --body "Description"

List pull requests

gh pr list

Checkout PR locally

gh pr checkout 456

View PR

gh pr view 456

Merge PR

gh pr merge 456

Review PR

gh pr review 456 --approve

List releases

gh release list

Create release

gh release create v1.0.0 --title "Version 1.0.0" --notes "Release notes"

Download release asset

gh release download v1.0.0

View workflow runs

gh run list

View workflow run

gh run view 789

Trigger workflow

gh workflow run deploy.yml

List gists

gh gist list

Create gist

gh gist create file.txt

Fork repository

gh repo fork owner/repo

Browse repository on GitHub

gh browse

Search repositories

gh search repos "react hooks"

Search issues

gh search issues "bug label:frontend"

Was this useful?

Share with your team

Browse More