GitHub CLI
GitHub CLI is the fastest way to work with GitHub from a terminal.
Start Here
- Authenticate first:
gh auth login - Check active context:
gh auth status - Target another repo when needed:
-R OWNER/REPO - Get command help anytime:
gh <command> --help
Common Workflow
gh auth login
gh repo clone OWNER/REPO
gh issue list
gh pr create --fill
gh run watchReferences
Core
gh auth:references/auth.mdgh browse:references/browse.mdgh codespace:references/codespace.mdgh gist:references/gist.mdgh issue:references/issue.mdgh org:references/org.mdgh pr:references/pr.mdgh project:references/project.mdgh release:references/release.mdgh repo:references/repo.md
Actions
gh cache:references/cache.mdgh run:references/run.mdgh workflow:references/workflow.md
Additional
gh agent-task:references/agent-task.mdgh alias:references/alias.mdgh api:references/api.mdgh attestation:references/attestation.mdgh completion:references/completion.mdgh config:references/config.mdgh copilot:references/copilot.mdgh extension:references/extension.mdgh gpg-key:references/gpg-key.mdgh label:references/label.mdgh licenses:references/licenses.mdgh preview:references/preview.mdgh ruleset:references/ruleset.mdgh search:references/search.mdgh secret:references/secret.mdgh ssh-key:references/ssh-key.mdgh status:references/status.mdgh variable:references/variable.md
Notes
- Prefer
--json,--jq, or--templatefor scripts gh apiis the fallback for anything not covered by a dedicated command- For GitHub Enterprise, use
--hostnameor setGH_HOST