GitHub CLI

GitHub from the command line -- PRs, issues, repos, and more

Quick summary

The GitHub CLI (gh) brings GitHub to your terminal. It lets you manage repositories, pull requests, issues, actions, and more without leaving the command line. Installed via Homebrew.

Common tasks

Basic Usage

gh auth login

Basic Usage

gh repo create my-project --public --clone

Basic Usage

gh pr create --title "My PR" --body "Description"

Basic Usage

gh pr view

What is it?

The GitHub CLI (gh) brings GitHub to your terminal. It lets you manage repositories, pull requests, issues, actions, and more without leaving the command line. Installed via Homebrew.

Basic Usage

Authenticate with GitHub:

$gh auth login

Create a repository:

$gh repo create my-project --public --clone

Work with pull requests:

$gh pr create --title "My PR" --body "Description"
$gh pr view
$gh pr checkout 123

List and manage issues:

$gh issue list
$gh issue create --title "Bug" --body "Details"
$gh issue view 42

View GitHub Actions runs:

$gh run list
$gh run view
$gh run watch

Open in browser:

$gh browse

Tips

Always run gh auth login first.
gh status shows your latest notifications.
If you have the GitHub Copilot CLI extension installed, try gh copilot.