gh --versionDisplay installed GitHub CLI version and build info.
Core GitHub CLI commands for auth, repository context, search, JSON output, and daily workflows.
Install, authenticate, and inspect core CLI behavior.
gh --versionDisplay installed GitHub CLI version and build info.
gh helpShow top-level help and available command groups.
gh help pr createOpen detailed help for a specific subcommand.
Authenticate with GitHub using the default browser-based flow.
gh auth loginAuthenticate with GitHub using the default browser-based flow.
Authenticate against a GitHub Enterprise Server host.
gh auth login --hostname github.example.comAuthenticate against a GitHub Enterprise Server host.
Show which hosts are authenticated and how credentials are stored.
gh auth statusShow which hosts are authenticated and how credentials are stored.
gh auth refresh -s repo,read:org,workflowRefresh token scopes for an authenticated host.
gh auth logout --hostname github.comRemove stored authentication for a host.
gh config set editor "code --wait"Set the editor used by gh when editing text.
gh config get editorShow the current editor configured for gh.
gh config listDisplay CLI configuration values.
Show account, issue, PR, and assignment activity summary.
gh statusShow account, issue, PR, and assignment activity summary.
gh browseOpen the current repository in the browser.
gh browse --branch feature/my-branchOpen a repo page scoped to a specific branch.
gh repo view --webOpen the selected repository in the web UI.
Use JSON, jq, and templates for automation.
gh pr list --json number,title,author,stateReturn pull request data as JSON fields.
Post-process JSON output using the built-in jq expression support.
gh pr list --json number,title --jq ".[] | {number, title}"Post-process JSON output using the built-in jq expression support.
gh pr view 123 --json number,title,mergeStateStatus --template "{{.number}} {{.title}} {{.mergeStateStatus}}"Format JSON output using a Go template.
gh issue list --json number,title,labels,assigneesReturn issue fields as JSON for scripting.
gh run list --json databaseId,workflowName,status,conclusionInspect Actions runs in script-friendly JSON.
Call the API directly and project specific values.
gh api repos/{owner}/{repo} --jq "{default_branch,visibility,open_issues_count}"Call the API directly and project specific values.
gh api repos/{owner}/{repo}/pulls --paginateFetch all pages from a paginated REST endpoint.
gh search repos "topic:terraform stars:>5000" --json name,owner,url,stargazersCountSearch GitHub repositories and output structured JSON.
Search repos, issues, PRs, and code across GitHub.
gh search repos "language:go stars:>1000 topic:kubernetes"Search repositories with qualifiers.
gh search code "TODO owner:cli path:/docs extension:md"Search code across repositories.
gh search issues "is:open is:pr review-requested:@me"Search across issues and pull requests.
gh search commits "fix login author:octocat"Search commits on GitHub.
gh search users "location:California followers:>100"Search GitHub users.
gh repo list cli --limit 50List repositories for a user or organization.
gh repo list my-org --language TypeScript --limit 100Filter listed repos by language.
gh label listShow labels in the current repository.
gh ruleset listList branch and repository rulesets.