GitHub from Your Terminal
GitHub CLI (gh) brings GitHub functionality to your terminal—create PRs, manage issues, and more without leaving the command line.
Installation
macOS:
brew install ghWindows:
winget install GitHub.cliLinux: See github.com/cli/cli#installation
Authentication
gh auth loginFollow the prompts to authenticate with GitHub.
Common Commands
Create Repository
gh repo create my-project --publicClone Repository
gh repo clone username/repositoryCreate Pull Request
gh pr create --title "Add feature" --body "Description"List Pull Requests
gh pr listView PR
gh pr view 123Create Issue
gh issue create --title "Bug report"List Issues
gh issue listWorkflows
View and manage GitHub Actions:
gh workflow list
gh run list
gh run view <run-id>Why Use GitHub CLI?
- Faster than the web interface
- Scriptable workflows
- Never leave the terminal
- Consistent across platforms
Next: Quick Commands
GitHub CLI supercharges your workflow. Next, learn Git aliases—custom shortcuts that speed up your most common commands.