--- name: github-cli intent: github, vcs description: Interact with GitHub repositories, issues, PRs, workflows, and more using the gh CLI. Use for GitHub operations like creating issues/PRs, managing repos, checking workflow runs, and browsing GitHub resources. --- # GitHub CLI (gh) **CRITICAL:** Run `gh` commands from within the git repository directory. Use `--repo owner/name` only when operating on a different repo. ## Commands **Repository:** - Create repo: `gh repo create ` - Clone repo: `gh repo clone ` - View repo: `gh repo view [repo]` - Fork repo: `gh repo fork [repo]` **Issues:** - Create: `gh issue create --title "..." --body "..."` - List: `gh issue list` - View: `gh issue view ` - Close: `gh issue close ` **Pull Requests:** - Create: `gh pr create` - List: `gh pr list` - View: `gh pr view ` - Checkout: `gh pr checkout ` - Merge: `gh pr merge ` - Status: `gh pr status` **Actions:** - List runs: `gh run list` - View run: `gh run view ` - Watch run: `gh run watch ` - List workflows: `gh workflow list` - View workflow: `gh workflow view ` **Releases:** - Create: `gh release create ` - List: `gh release list` - View: `gh release view ` **Search:** - Repos: `gh search repos ` - Issues: `gh search issues ` - PRs: `gh search prs ` **Browse:** - Open repo: `gh browse` - Open issue/PR: `gh browse ` **API:** - Call endpoint: `gh api ` - Example: `gh api repos/:owner/:repo/issues` ## Common Flags `--repo owner/repo` `--json` `--jq ` `--web` `--help` ## Auth - Check: `gh auth status` - Login: `gh auth login` ## Examples ```bash gh issue create --title "Bug" --body "Description" gh pr list --state open --json number,title,author gh run view 12345 gh repo clone owner/repo gh search repos --language rust --sort stars gh api graphql -f query='query { viewer { login } }' ```