Subcommands131 subcommands
gh alias
Create command shortcuts
gh alias delete
Delete an alias
gh alias list
List available aliases
gh alias set
Set an alias for a gh command
gh api
Make an authenticated GitHub API request
gh auth
Login, logout, and refresh your authentication
gh auth login
Authenticate with a GitHub host
gh auth logout
Log out of a GitHub host
gh auth refresh
Refresh stored authentication credentials
gh auth setup-git
Configure git to use GitHub CLI as a credential helper
gh auth status
View authentication status
gh gpg-key
Manage GPG keys registered with your GitHub account
gh gpg-key add
Add a GPG key to your GitHub account
gh gpg-key list
Lists GPG keys in your GitHub account
gh browse
Open the repository in the browser
gh completion
Generate shell completion scripts
gh config
Manage configuration for gh
gh config get
Print the value of a given configuration key
gh config set
Update configuration with a value for the given key
gh config set git_protocol
The protocol to use for git clone and push operations
gh config set editor
The text editor program to use for authoring text
gh config set prompt
Toggle interactive prompting in the terminal
gh config set pager
The terminal pager program to send standard output to
gh config set http_unix_socket
The path to a unix socket through which to make HTTP connection
gh extensions
Manage gh extensions
gh extensions create
Create a new extension
gh extensions install
Install a gh extension from a repository
gh extensions list
List installed extension commands
gh extensions remove
Remove an installed extension
gh extensions upgrade
Upgrade installed extensions
gh gist clone
Clone a gist locally
gh gist create
Create a new gist
gh gist delete
Delete a gist
gh gist edit
Edit one of your gists
gh gist list
List your gists
gh issue close
Close issue
gh issue comment
Create a new issue comment
gh issue create
Create a new issue
gh issue delete
Delete issue
gh issue edit
Edit an issue
gh issue list
List and filter issues in this repository
gh issue reopen
Reopen issue
gh issue status
Show status of relevant issues
gh issue transfer
Transfer issue to another repository
gh issue view
View an issue
gh pr
Manage pull requests
gh pr checkout
Check out a pull request in git
gh pr checks
Show CI status for a single pull request
gh pr close
Close a pull request
gh pr edit
Edit a pull request. Without an argument, the pull request that belongs to the current branch is selected
gh pr comment
Create a new pr comment
gh pr create
Create a pull request
gh pr diff
View changes in a pull request
gh pr list
List and filter pull requests in this repository
gh pr merge
Merge a pull request
gh pr ready
Mark a pull request as ready for review
gh pr reopen
Reopen a pull request
gh pr review
Add a review to a pull request
gh pr status
Show status of relevant pull requests
gh pr view
View a pull request
gh release
Manage GitHub releases
gh repo
Work with GitHub repositories
gh repo archive
Archive a GitHub repository. With no argument, archives the current repository
gh repo clone
Clone a GitHub repository locally.
If the "OWNER/" portion of the "OWNER/REPO" repository argument is omitted, it
defaults to the name of the authenticating user.
Pass additional 'git clone' flags by listing them after '--'
gh repo create
Create a new GitHub repository.
To create a repository interactively, use 'gh repo create' with no arguments.
To create a remote repository non-interactively, supply the repository name and one of '--public', '--private', or '--internal'.
Pass '--clone' to clone the new repository locally.
To create a remote repository from an existing local repository, specify the source directory with '--source'.
By default, the remote repository name will be the name of the source directory.
Pass '--push' to push any local commits to the new repository
gh repo deploy-key
Manage deploy keys in a repository
gh repo deploy-key add
Add a deploy key to a GitHub repository
gh repo deploy-key delete
Delete a deploy key from a GitHub repository
gh repo deploy-key list
List deploy keys in a GitHub repository
gh repo delete
Delete a GitHub repository.
With no argument, deletes the current repository. Otherwise, deletes the specified repository.
Deletion requires authorization with the "delete_repo" scope.
To authorize, run "gh auth refresh -s delete_repo"
gh repo edit
Edit repository settings
gh repo fork
Create a fork of a repository.
With no argument, creates a fork of the current repository. Otherwise, forks
the specified repository.
By default, the new fork is set to be your 'origin' remote and any existing
origin remote is renamed to 'upstream'. To alter this behavior, you can set
a name for the new fork's remote with --remote-name.
Additional 'git clone' flags can be passed in by listing them after '--'
gh repo list
List repositories owned by user or organization.
For more information about output formatting flags, see 'gh help formatting'
gh repo rename
Rename a GitHub repository.
By default, this renames the current repository; otherwise renames the specified repository
gh repo set-default
Sets the default remote repository to use when querying the GitHub API for the locally cloned repository
gh repo sync
Sync destination repository from source repository. Syncing uses the main branch
of the source repository to update the matching branch on the destination
repository so they are equal. A fast forward update will be used execept when the
'--force' flag is specified, then the two branches will
by synced using a hard reset.
Without an argument, the local repository is selected as the destination repository.
The source repository is the parent of the destination repository by default.
This can be overridden with the '--source' flag
gh repo view
Display the description and the README of a GitHub repository.
With no argument, the repository for the current directory is displayed.
With '--web', open the repository in a web browser instead.
With '--branch', view a specific branch of the repository.
For more information about output formatting flags, see 'gh help formatting'
gh run
View details about workflow runs
gh run download
Download artifacts generated by a workflow run
gh run list
List recent workflow runs
gh run rerun
Rerun a failed run
gh run view
View a summary of a workflow run
gh run watch
Watch a run until it completes, showing its progress
gh secret
Manage GitHub secrets
gh secret list
List secrets for a repository, environment, or organization
gh secret remove
Remove secrets
gh secret set
Create or update secrets
gh ssh-key
Manage SSH keys
gh ssh-key add
Add an SSH key to your GitHub account
gh ssh-key list
Lists SSH keys in your GitHub account
gh workflow
View details about GitHub Actions workflows
gh workflow disable
Disable a workflow
gh workflow enable
Enable a workflow
gh workflow list
List workflows
gh workflow run
Run a workflow by creating a workflow_dispatch event
gh workflow view
View the summary of a workflow
gh codespace
Connect to and manage codespaces
gh codespace code
Open a codespace in Visual Studio Code
gh codespace cp
The cp command copies files between the local and remote file systems
gh codespace create
Create a codespace
gh codespace delete
Delete codespaces based on selection criteria. All codespaces for the authenticated user can be deleted, as well as codespaces for a specific repository. Alternatively, only codespaces older than N days can be deleted. Organization administrators may delete any codespace billed to the organization
gh codespace edit
Edit a codespace
gh codespace jupyter
Open a codespace in JupyterLab
gh codespace list
List codespaces of the authenticated user. Alternatively, organization administrators may list all codespaces billed to the organization
gh codespace logs
Access codespace logs
gh codespace ports
List ports in a codespace
gh codespace ports forward
Forward ports
gh codespace ports visibility
Change the visibility of the forwarded port
gh codespace rebuild
Rebuild a codespace
gh codespace ssh
SSH into a codespace
gh codespace stop
Stop running a codespace
gh project
Manage projects
gh project create
Create a project
gh project edit
Edit a project
gh project list
List projects
gh project delete
Delete a project
gh project close
Close a project
gh project view
View a project
gh project copy
Copy a project
gh project field-create
Create a project field
gh project field-delete
Delete a project field
gh project field-list
List project fields
gh project item-create
Create a draft issue item in a project
gh project item-edit
Edit a project item
gh project item-delete
Delete a project item
gh project item-list
List project items
gh project item-add
Add a pull request or an issue to a project
gh project item-archive
Archive a project item