GitHub CLI dev
GitHub's official CLI for PRs, issues, repos, and more
gh is GitHub’s official command-line tool. It brings pull requests, issues, repos, gists, and GitHub Actions to your terminal. Essential for any developer workflow that touches GitHub.
Features
- Create and manage pull requests and issues
- Clone, fork, and create repositories
- View and trigger GitHub Actions workflows
- Manage releases and gists
- Authenticate and switch between GitHub accounts
Install
brew: brew install ghapt: sudo apt install ghwinget: winget install GitHub.cli Commands
| Command | Syntax | Description |
|---|---|---|
pr create | gh pr create --title <title> --body <body> | Create a new pull request |
issue list | gh issue list | List issues in the current repository |
repo clone | gh repo clone <owner/repo> | Clone a GitHub repository |
Links
Agent Usage Example
Use cases:
- Create pull requests after code changes
- List and triage open issues
- Clone repositories for analysis
Example workflow:
gh issue list --label bug --state open && gh pr create --title 'Fix: resolve crash' --body 'Fixes #42'