What does gh do?

the official GitHub CLI.

▸ Explain your own gh command →

gh examples, explained

$ gh pr create --title 'fix' --body 'closes #1'

  • ghthe official GitHub CLI
  • prmanage pull requests (create, checkout, merge, …)
  • createan argument passed to the command
  • --titleset the title (PR/issue/release)
  • fixvalue for --title
  • --bodyset the body text (PR/issue/release)
  • closes #1value for --body

$ gh repo clone owner/name

  • ghthe official GitHub CLI
  • repomanage repositories (create, clone, view, fork)
  • clonean argument passed to the command
  • owner/namean argument passed to the command

$ gh api repos/owner/name --jq .stargazers_count

  • ghthe official GitHub CLI
  • apimake an authenticated GitHub API request
  • repos/owner/namean argument passed to the command
  • --jqfilter JSON output with a jq expression
  • .stargazers_countan argument passed to the command

gh subcommands

repo — manage repositories (create, clone, view, fork)pr — manage pull requests (create, checkout, merge, …)issue — manage issues (create, list, close, …)release — manage releasesrun — view and manage GitHub Actions runsworkflow — view and manage GitHub Actions workflowsauth — authenticate gh and manage credentialsapi — make an authenticated GitHub API requestgist — manage gistssecret — manage repository/organization secrets

gh flags & options

-Roperate on the given owner/repo instead of the current one
--repooperate on the given owner/repo instead of the current one
--titleset the title (PR/issue/release)
--bodyset the body text (PR/issue/release)
--webopen the relevant page in a browser
--jsonoutput selected fields as JSON
--jqfilter JSON output with a jq expression

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.