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 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 viewWhy Use GitHub CLI?
- Faster than web interface
- Scriptable workflows
- Never leave terminal
- Consistent across platforms
Next: Cargo Hold
GitHub CLI supercharges your workflow. Next, learn git stash for temporarily saving work.