Manage GitHub repositories, issues, and pull requests using the gh CLI
Interact with GitHub using the gh CLI. Manage repos, issues, PRs, and CI runs.
gh auth loginList your repos:
gh repo list
Create a new repo:
gh repo create my-project --public
Clone a repo:
gh repo clone owner/repo
View repo info:
gh repo view owner/repo
List issues:
gh issue list --repo owner/repo
Create an issue:
gh issue create --title "Bug: Login fails" --body "Description here"
View an issue:
gh issue view 123 --repo owner/repo
Close an issue:
gh issue close 123 --repo owner/repo
List PRs:
gh pr list --repo owner/repo
Create a PR:
gh pr create --title "Add feature" --body "Description"
Check CI status:
gh pr checks 55 --repo owner/repo
Merge a PR:
gh pr merge 55 --repo owner/repo
List workflow runs:
gh run list --repo owner/repo --limit 10
View run details:
gh run view <run-id> --repo owner/repo
View failed logs:
gh run view <run-id> --repo owner/repo --log-failed
Get PR with specific fields:
gh api repos/owner/repo/pulls/55 --jq '.title, .state, .user.login'
JSON output with filtering:
gh issue list --repo owner/repo --json number,title --jq '.[] | "\(.number): \(.title)"'
User: "Show my GitHub repos"
Response:
📦 Your Repositories:
1. my-project (public) ⭐ 42
2. awesome-app (private)
3. dotfiles (public) ⭐ 15
User: "Create issue: Login button not working"
Response:
🐙 Issue Created!
Title: Login button not working
Number: #42
URL: https://github.com/owner/repo/issues/42
User: "Show open PRs"
Response:
🔀 Open Pull Requests (3):
#45 - Add dark mode (feature/dark-mode) by @user1
#44 - Fix memory leak (bugfix/memory) by @user2
#43 - Update deps (chore/deps) by @dependabot
Required scopes:
repo - Full repository accessread:org - Read organization infoworkflow - Update GitHub Actions workflows