GitHub's official CLI (gh) lets you interact with GitHub directly from the command line: create and clone repos, manage issues and Pull Requests, view GitHub Actions status and much more, without opening a browser.
winget install GitHub.cli
gh auth login
| Category | Command | Action |
|---|---|---|
| Repos | gh repo create --public | Create new repository |
| Repos | gh repo clone user/repo | Clone repository |
| Repos | gh repo list | List your repos |
| Issues | gh issue list | View open issues |
| Issues | gh issue create | Create new issue |
| PRs | gh pr create --fill | Create PR from commit info |
| PRs | gh pr merge 15 --squash | Merge PR #15 with squash |
| Actions | gh run list | View recent runs |
| Actions | gh run watch | Follow active run |
git switch -c feature/new-feature
git add . && git commit -m "feat: new feature"
git push -u origin feature/new-feature
gh pr create --title "New feature" --body "Detailed description" --label "enhancement"
gh pr diff 42 to fetch the diff and analyzes it automatically.