Authenticate
gh auth login
--git-protocol ssh | https
--scopes strings
--web
--with-token # Read token from STDIN
gh auth logout
gh auth refresh
--scopes strings
gh auth setup-git # Configure git to use GitHub CLI as credential helper
gh auth status
--show-token
gh auth token
Aliases
gh alias set prd "pr create --draft" # gh prd will now run gh pr create --draft
Browse
gh browse # Open browser to issue/PR #
gh browse filename:line-number
gh browse
--commit # Open the last commit
--no-browser # Just print destination URL
--projects # Open repo projects
--repo owner/repo
--settings # Open repo settings
--wiki # Open repo wiki
Codespace
gh codespace # Manage codespaces
Config
gh config get key
gh config list
gh config set key value
Keys:
git_protocol # the protocol to use for git clone and push operations (default: "https")
editor # the text editor program to use for authoring text
prompt # toggle interactive prompting in the terminal (default: "enabled")
pager # the terminal pager program to send standard output to
http_unix_socket # the path to a Unix socket through which to make an HTTP connection
browser # the web browser to use for opening URLs
Forks
gh repo fork # Fork the current repo
gh repo fork owner/repo
gh repo fork --remote=false # Don't add a git remote
gh repo fork --clone=false # Don't clone the forked repo
Gist
gh gist
GPG-Key
Help
gh help command
Issues
gh issue create
gh issue create --title "title" --body "body"
gh issue create --web # Navigate to the issue on the web
gh issue list --assignee @me
gh issue status
gh issue view issue-#
Labels
gh label
Pull Requests
gh pr create
gh pr create --title "title" --body "body"
gh pr create --web # Navigate to the PR on the web
gh pr checkout pr-# | branch-name | url
gh pr diff
gh pr list # The most recent 30 items
gh pr list --state closed --assignee user
gh pr review
gh pr status
gh pr view pr-#
Release
gh release
Repo
gh repo clone owner/repo | url
gh repo view owner/repo
Run
Search
Secret
gh help secret set
SSH-Key
Status
Get status about your work across all of GitHub.
Workflow
Manage workflows for GitHub Actions.