On this page you find all important commands for the CLI tool gh. If the
command you are looking for is missing please ask our AI.
gh
GitHub CLI brings GitHub to your terminal. Free and open source.
List of commands for gh:
-
gh-alias:tldr:2c789 gh-alias: List all the aliases `gh` is configured to use.$ gh alias listtry on your machineexplain this command
-
gh-alias:tldr:56d24 gh-alias: Delete a command shortcut.$ gh alias delete ${alias_name}try on your machineexplain this command
-
gh-alias:tldr:6780d gh-alias: Display the subcommand help.$ gh aliastry on your machineexplain this command
-
gh-alias:tldr:85253 gh-alias: Set a shell command as a `gh` subcommand.$ gh alias set --shell ${alias_name} ${command}try on your machineexplain this command
-
gh-alias:tldr:8539c gh-alias: Create a `gh` subcommand alias.$ gh alias set ${pv} '${pr view}'try on your machineexplain this command
-
gh-api:tldr:0098f gh-api: Display the result of a GraphQL query in JSON format.$ gh api graphql --field ${name=':repo'} --raw-field '${query}'try on your machineexplain this command
-
gh-api:tldr:4de5c gh-api: Include the HTTP response headers in the output.$ gh api --include ${endpoint}try on your machineexplain this command
-
gh-api:tldr:51da4 gh-api: Send a request to a specific GitHub Enterprise Server.$ gh api --hostname ${github-example-com} ${endpoint}try on your machineexplain this command
-
gh-api:tldr:a170a gh-api: Display the releases for the current repository in JSON format.$ gh api repos/:owner/:repo/releasestry on your machineexplain this command
-
gh-api:tldr:d87ea gh-api: Create a reaction for a specific issue.$ gh api --header ${Accept:application-vnd-github-squirrel-girl-preview+json} --raw-field '${content=+1}' ${repos-:owner-:repo-issues-123-reactions}try on your machineexplain this command
-
gh-api:tldr:e97dd gh-api: Do not print the response body.$ gh api --silent ${endpoint}try on your machineexplain this command
-
gh-auth:tldr:6b9a4 gh-auth: Refresh the session to ensure authentication credentials have the correct minimum scopes (removes additional scopes requested previously).$ gh auth refreshtry on your machineexplain this command
-
gh-auth:tldr:ccda9 gh-auth: Expand the permission scopes.$ gh auth refresh --scopes ${repo,admin:repo_hook,admin:org,admin:public_key,admin:org_hook,---}try on your machineexplain this command
-
gh-auth:tldr:fb833 gh-auth: Log in with interactive prompt.$ gh auth logintry on your machineexplain this command
-
gh-auth:tldr:ffacf gh-auth: Log in with a specific GitHub Enterprise Server.$ gh auth login --hostname ${github-example-com}try on your machineexplain this command
-
gh-browse:tldr:0ef10 gh-browse: Open the settings page of the current repository in the default web browser.$ gh browse --settingstry on your machineexplain this command
-
gh-browse:tldr:18a1d gh-browse: Open the homepage of the current repository in the default web browser.$ gh browsetry on your machineexplain this command
-
gh-browse:tldr:64e8b gh-browse: Open the wiki of the current repository in the default web browser.$ gh browse --wikitry on your machineexplain this command
-
gh-browse:tldr:888b8 gh-browse: Print the destination URL without open the web browser.$ gh browse --no-browsertry on your machineexplain this command
-
gh-browse:tldr:99190 gh-browse: Open a specific issue or pull request in the web browser.$ gh browse ${select}try on your machineexplain this command
-
gh-browse:tldr:dd9d7 gh-browse: Open a specific branch in the web browser.$ gh browse --branch ${branch_name}try on your machineexplain this command
-
gh-browse:tldr:e4d1a gh-browse: Open the homepage of a specific repository in the default web browser.$ gh browse ${owner}/${repository}try on your machineexplain this command
-
gh-codespace:tldr:008ea gh-codespace: Display the logs from a codespace interactively.$ gh codespace logstry on your machineexplain this command
-
gh-codespace:tldr:19b98 gh-codespace: Delete a codespace interactively.$ gh codespace deletetry on your machineexplain this command
-
gh-codespace:tldr:522ec gh-codespace: Transfer a specific file to a codespace interactively.$ gh codespace cp ${path-to-source_file} remote:${path-to-remote_file}try on your machineexplain this command
-
gh-codespace:tldr:69f8b gh-codespace: Create a codespace in GitHub interactively.$ gh codespace createtry on your machineexplain this command
-
gh-codespace:tldr:83f77 gh-codespace: List all available codespaces.$ gh codespace listtry on your machineexplain this command
-
gh-codespace:tldr:d47b0 gh-codespace: Connect to a codespace via SSH interactively.$ gh codespace sshtry on your machineexplain this command
-
gh-codespace:tldr:f71c3 gh-codespace: List the ports of a codespace interactively.$ gh codespace portstry on your machineexplain this command
-
gh-completion:tldr:2241d gh-completion: Append the `gh` completion script to `~/.bashrc`.$ gh completion --shell ${bash} >> ${~--bashrc}try on your machineexplain this command
-
gh-completion:tldr:49962 gh-completion: Display the subcommand help.$ gh completiontry on your machineexplain this command
-
gh-completion:tldr:6dcd2 gh-completion: Print a completion script.$ gh completion --shell ${select}try on your machineexplain this command
-
gh-config:tldr:00f7d gh-config: Set a specific configuration value.$ gh config set ${key} ${value}try on your machineexplain this command
-
gh-config:tldr:3c69e gh-config: Use `delta` in side-by-side mode as the default pager for all `gh` commands.$ gh config set pager '${delta --side-by-side}'try on your machineexplain this command
-
gh-config:tldr:507b2 gh-config: Set protocol to SSH.$ gh config set git_protocol ${ssh}try on your machineexplain this command
-
gh-config:tldr:5aff2 gh-config: Display what Git protocol is being used.$ gh config get git_protocoltry on your machineexplain this command
-
gh-config:tldr:cb4da gh-config: Set text editor to Vim.$ gh config set editor ${vim}try on your machineexplain this command
-
gh-config:tldr:d51da gh-config: Disable interactive prompts.$ gh config set prompt ${disabled}try on your machineexplain this command
-
gh-environment:tldr:2fde0 gh-environment: Display help about environment variables that can be used with `gh`.$ gh environmenttry on your machineexplain this command
-
gh-extension:tldr:078df gh-extension: Display help about a subcommand.$ gh extension ${subcommand} --helptry on your machineexplain this command
-
gh-extension:tldr:17352 gh-extension: Upgrade a specific extension.$ gh extension upgrade ${extension_name}try on your machineexplain this command
-
gh-extension:tldr:a566f gh-extension: Initialize a new GitHub CLI extension project in a directory of the same name.$ gh extension create ${extension_name}try on your machineexplain this command
-
gh-extension:tldr:be942 gh-extension: Install an extension from a GitHub repository.$ gh extension install ${owner}/${repository}try on your machineexplain this command
-
gh-extension:tldr:e27d0 gh-extension: Upgrade all extensions.$ gh extension upgrade --alltry on your machineexplain this command
-
gh-extension:tldr:e3910 gh-extension: List installed extensions.$ gh extension listtry on your machineexplain this command
-
gh-extension:tldr:ef1d8 gh-extension: Remove an extension.$ gh extension remove ${extension_name}try on your machineexplain this command
-
gh-formatting:tldr:53283 gh-formatting: Display help about formatting JSON output from `gh` using `jq`.$ gh formattingtry on your machineexplain this command
-
gh-gist:tldr:45ed8 gh-gist: List up to 42 Gists owned by the currently logged in user.$ gh gist list --limit ${42}try on your machineexplain this command
-
gh-gist:tldr:51ab7 gh-gist: Edit a Gist.$ gh gist edit ${select}try on your machineexplain this command
-
gh-gist:tldr:5ef3c gh-gist: Create a new Gist from a space-separated list of files.$ gh gist create ${filename1 filename2 ---}try on your machineexplain this command
-
gh-gist:tldr:af818 gh-gist: Create a new Gist with a specific [desc]ription.$ gh gist create ${filename1 filename2 ---} --desc "${description}"try on your machineexplain this command
-
gh-gist:tldr:bea6e gh-gist: View a Gist in the default browser without rendering Markdown.$ gh gist view ${select} --web --rawtry on your machineexplain this command
-
gh-help:tldr:1252e gh-help: Display help about environment variables that can be used with `gh`.$ gh help environmenttry on your machineexplain this command
-
gh-help:tldr:215ab gh-help: Display a markdown reference of all `gh` commands.$ gh help referencetry on your machineexplain this command
-
gh-help:tldr:86508 gh-help: Display help about formatting JSON output from `gh` using `jq`.$ gh help formattingtry on your machineexplain this command
-
gh-help:tldr:90a94 gh-help: Display help for a subcommand.$ gh help ${subcommand}try on your machineexplain this command
-
gh-help:tldr:9e262 gh-help: Display help about using `gh` with MinTTY.$ gh help minttytry on your machineexplain this command
-
gh-help:tldr:9f53a gh-help: Display help for a subcommand action.$ gh help ${pr} ${create}try on your machineexplain this command
-
gh-help:tldr:a442b gh-help: Display general help.$ gh helptry on your machineexplain this command
-
gh-help:tldr:b69d1 gh-help: Display help for the `gh help` subcommand.$ gh help --helptry on your machineexplain this command
-
gh-issue-create:tldr:06993 gh-issue-create: Create a new issue with a title, body and assign it to the current user.$ gh issue create --title "${title}" --body "${body}" --assignee "${@me}"try on your machineexplain this command
-
gh-issue-create:tldr:0a61e gh-issue-create: Create a new issue in the default web browser.$ gh issue create --webtry on your machineexplain this command
-
gh-issue-create:tldr:161e6 gh-issue-create: Display the help.$ gh issue create --helptry on your machineexplain this command
-
gh-issue-create:tldr:22a73 gh-issue-create: Create a new issue interactively and assign it to the specified users.$ gh issue create --assignee ${user1,user2,---}try on your machineexplain this command
-
gh-issue-create:tldr:3870e gh-issue-create: Create a new issue interactively, reading the body text from a file.$ gh issue create --body-file ${filename}try on your machineexplain this command
-
gh-issue-create:tldr:6885f gh-issue-create: Create a new issue with the `bug` label interactively.$ gh issue create --label "${bug}"try on your machineexplain this command
-
gh-issue:tldr:02308 gh-issue: Display the status of issues relevant to the user, in a specific repository.$ gh issue status --repo ${owner}/${repository}try on your machineexplain this command
-
gh-issue:tldr:5f01a gh-issue: Display a specific issue.$ gh issue view ${issue_number}try on your machineexplain this command
-
gh-issue:tldr:63c7e gh-issue: Reopen a specific issue.$ gh issue reopen ${issue_number}try on your machineexplain this command
-
gh-issue:tldr:893ea gh-issue: List the last 10 issues with the `bug` label.$ gh issue list --limit ${10} --label "${bug}"try on your machineexplain this command
-
gh-issue:tldr:f97f0 gh-issue: List closed issues made by a specific user.$ gh issue list --state closed --author ${username}try on your machineexplain this command
-
gh-label:tldr:17969 gh-label: Update the name and description for a specific label for the repository in the current directory.$ gh label edit ${name} --name ${new_name} --description "${description}"try on your machineexplain this command
-
gh-label:tldr:5e46e gh-label: View labels for the repository in the current directory in the default web browser.$ gh label list --webtry on your machineexplain this command
-
gh-label:tldr:7f80f gh-label: Clone labels from a specific repository into the repository in the current directory.$ gh label clone ${owner}/${repository}try on your machineexplain this command
-
gh-label:tldr:8eebf gh-label: Display help for a subcommand.$ gh label ${subcommand} --helptry on your machineexplain this command
-
gh-label:tldr:ea7d7 gh-label: List labels for the repository in the current directory.$ gh label listtry on your machineexplain this command
-
gh-label:tldr:f17f1 gh-label: Create a label with a specific name, description and color in hexadecimal format for the repository in the current directory.$ gh label create ${name} --description "${description}" --color ${color_hex}try on your machineexplain this command
-
gh-label:tldr:f22e3 gh-label: Delete a label for the repository in the current directory, prompting for confirmation.$ gh label delete ${name}try on your machineexplain this command
-
gh-mintty:tldr:896b9 gh-mintty: Display help about using `gh` with MinTTY.$ gh minttytry on your machineexplain this command
-
gh-pr-create:tldr:37988 gh-pr-create: Create a draft pull request.$ gh pr create --drafttry on your machineexplain this command
-
gh-pr-create:tldr:a3e51 gh-pr-create: Start opening a pull request in the default web browser.$ gh pr create --webtry on your machineexplain this command
-
gh-pr-create:tldr:af687 gh-pr-create: Create a pull request, determining the title and description from the commit messages of the current branch.$ gh pr create --filltry on your machineexplain this command
-
gh-pr-create:tldr:cba9c gh-pr-create: Create a pull request specifying the base branch, title, and description.$ gh pr create --base ${base_branch} --title "${title}" --body "${body}"try on your machineexplain this command
-
gh-pr-merge:tldr:12597 gh-pr-merge: Merge the current pull request with the specified merge strategy.$ gh pr merge --${select}try on your machineexplain this command
-
gh-pr-merge:tldr:198fe gh-pr-merge: Merge the pull request associated with the current branch interactively.$ gh pr mergetry on your machineexplain this command
-
gh-pr-merge:tldr:23b7c gh-pr-merge: Merge the pull request, removing the branch on both the local and the remote.$ gh pr merge --delete-branchtry on your machineexplain this command
-
gh-pr-merge:tldr:4555b gh-pr-merge: Display help.$ gh pr merge --helptry on your machineexplain this command
-
gh-pr-merge:tldr:66adb gh-pr-merge: Squash the current pull request into one commit with the message body and merge.$ gh pr merge --squash --body="${commit_message_body}"try on your machineexplain this command
-
gh-pr-merge:tldr:f7d98 gh-pr-merge: Merge the current pull request with the specified merge strategy and commit message.$ gh pr merge --${select} --subject ${commit_message}try on your machineexplain this command
-
gh-pr:tldr:342b6 gh-pr: Approve the pull request for the current branch.$ gh pr review --approvetry on your machineexplain this command
-
gh-pr:tldr:643cb gh-pr: Edit a pull request interactively.$ gh pr edittry on your machineexplain this command
-
gh-pr:tldr:73178 gh-pr: Edit the base branch of a pull request.$ gh pr edit --base ${branch_name}try on your machineexplain this command
-
gh-pr:tldr:f541a gh-pr: View the changes made in the pull request for the current branch.$ gh pr difftry on your machineexplain this command
-
gh-reference:tldr:5ee3c gh-reference: Display a markdown reference of all `gh` commands.$ gh referencetry on your machineexplain this command
-
gh-release:tldr:2ef5e gh-release: Delete a specific release.$ gh release delete ${tag}try on your machineexplain this command
-
gh-release:tldr:83a3e gh-release: Download assets from a specific release.$ gh release download ${tag}try on your machineexplain this command
-
gh-release:tldr:86b54 gh-release: List releases in a GitHub repository, limited to 30 items.$ gh release listtry on your machineexplain this command
-
gh-release:tldr:9b1ef gh-release: Create a new release.$ gh release create ${tag}try on your machineexplain this command
-
gh-release:tldr:bc02f gh-release: Display information about a specific release.$ gh release view ${tag}try on your machineexplain this command
-
gh-release:tldr:dfe49 gh-release: Upload assets to a specific release.$ gh release upload ${tag} ${filename1 filename2 ---}try on your machineexplain this command
-
gh-repo:tldr:0843e gh-repo: Fork and clone a repository.$ gh repo fork ${owner}/${repository} --clonetry on your machineexplain this command
-
gh-repo:tldr:6d9de gh-repo: Create a new repository (if the repository name is not set, the default name will be the name of the current directory).$ gh repo create ${name}try on your machineexplain this command
-
gh-repo:tldr:dfa87 gh-repo: View a repository in the default web browser.$ gh repo view ${repository} --webtry on your machineexplain this command
-
gh-repo:tldr:e0ed6 gh-repo: List repositories owned by a specific user or organization (if the owner is not set, the default owner will be the currently logged in user).$ gh repo list ${owner}try on your machineexplain this command
-
gh-repo:tldr:fc8d3 gh-repo: List only non-forks repositories.$ gh repo list ${owner} --non-forkstry on your machineexplain this command
-
gh-run:tldr:30139 gh-run: Display information about a specific run.$ gh run view ${workflow_run_number}try on your machineexplain this command
-
gh-run:tldr:423f9 gh-run: Interactively select a run to see information about the jobs.$ gh run viewtry on your machineexplain this command
-
gh-run:tldr:44a5c gh-run: Check a specific workflow and exit with a non-zero status if the run failed.$ gh run view ${workflow_run_number} --exit-status && ${echo "run pending or passed"}try on your machineexplain this command
-
gh-run:tldr:57fe0 gh-run: Re-run a specific workflow.$ gh run rerun ${workflow_run_number}try on your machineexplain this command
-
gh-run:tldr:9d4a2 gh-run: Display the log of a job.$ gh run view --job=${job_number} --logtry on your machineexplain this command
-
gh-run:tldr:e3ee5 gh-run: Display the jobs for a run and wait until it's done.$ gh run watch ${workflow_run_number}try on your machineexplain this command
-
gh-run:tldr:e7d59 gh-run: Interactively select an active run and wait until it's done.$ gh run watchtry on your machineexplain this command
-
gh-run:tldr:ffb22 gh-run: Display information about the steps of a job.$ gh run view --job=${job_number}try on your machineexplain this command
-
gh-screensaver:tldr:42af5 gh-screensaver: Run a specific screensaver.$ gh screensaver --saver ${select}try on your machineexplain this command
-
gh-screensaver:tldr:66b1e gh-screensaver: List available screensavers.$ gh screensaver --listtry on your machineexplain this command
-
gh-screensaver:tldr:e1086 gh-screensaver: Run a random screensaver.$ gh screensavertry on your machineexplain this command
-
gh-secret-set:tldr:34413 gh-secret-set: Set an organization secret with a specific visibility.$ gh secret set ${name} --org ${organization} --visibility ${select}try on your machineexplain this command
-
gh-secret-set:tldr:7e480 gh-secret-set: Set a secret from a file for the current repository.$ gh secret set ${name} < ${filename}try on your machineexplain this command
-
gh-secret-set:tldr:bee91 gh-secret-set: Set a secret for a specific repository.$ gh secret set ${name} --body ${value} --repo ${owner}/${repository}try on your machineexplain this command
-
gh-secret-set:tldr:edd45 gh-secret-set: Set a secret for the current repository (user will be prompted for the value).$ gh secret set ${name}try on your machineexplain this command
-
gh-secret-set:tldr:f2e7f gh-secret-set: Set an organization secret for specific repositories.$ gh secret set ${name} --org ${organization} --repos "${repository1,repository2,---}"try on your machineexplain this command
-
gh-secret:tldr:15fde gh-secret: List secret keys for a specific repository.$ gh secret list --repo ${owner}/${repository}try on your machineexplain this command
-
gh-secret:tldr:1d9f8 gh-secret: Remove a secret for a specific organization.$ gh secret remove ${name} --org ${organization}try on your machineexplain this command
-
gh-secret:tldr:25bac gh-secret: List secret keys for a specific organization.$ gh secret list --org ${organization}try on your machineexplain this command
-
gh-secret:tldr:37aa6 gh-secret: Remove a secret for the current repository.$ gh secret remove ${name}try on your machineexplain this command
-
gh-secret:tldr:63f6e gh-secret: List secret keys for the current repository.$ gh secret listtry on your machineexplain this command
-
gh-ssh-key:tldr:00202 gh-ssh-key: Add an SSH key to the currently authenticated user's account with a specific title.$ gh ssh-key add --title ${title} ${path-to-key-pub}try on your machineexplain this command
-
gh-ssh-key:tldr:6e8d4 gh-ssh-key: List SSH keys for the currently authenticated user.$ gh ssh-key listtry on your machineexplain this command
-
gh-ssh-key:tldr:a2032 gh-ssh-key: Display help.$ gh ssh-keytry on your machineexplain this command
-
gh-ssh-key:tldr:f2b84 gh-ssh-key: Add an SSH key to the currently authenticated user's account.$ gh ssh-key add ${path-to-key-pub}try on your machineexplain this command
-
gh-workflow:tldr:0194e gh-workflow: List workflow files (use `--all` to include disabled workflows).$ gh workflow listtry on your machineexplain this command
-
gh-workflow:tldr:24d24 gh-workflow: Interactively select a workflow to view the latest jobs for.$ gh workflow viewtry on your machineexplain this command
-
gh-workflow:tldr:71ea7 gh-workflow: Run a manual workflow with parameters.$ gh workflow run ${select} ${--raw-field param1=value1 --raw-field param2=value2 ---}try on your machineexplain this command
-
gh-workflow:tldr:97f6c gh-workflow: View a specific workflow in the default browser.$ gh workflow view ${select} --webtry on your machineexplain this command
-
gh-workflow:tldr:a3eb2 gh-workflow: Display the YAML definition for a specific Git branch or tag.$ gh workflow view ${select} --ref ${select1} --yamltry on your machineexplain this command
-
gh-workflow:tldr:ba426 gh-workflow: Enable or disable a specific workflow.$ gh workflow ${select} ${select1}try on your machineexplain this command
-
gh-workflow:tldr:cc2b4 gh-workflow: Display the YAML definition of a specific workflow.$ gh workflow view ${select} --yamltry on your machineexplain this command
-
github:api:help gh-api: Display the subcommand help.$ gh api --helptry on your machineexplain this command
-
github:codespace:subcommand:help gh-codespace: Display help for a subcommand.$ gh codespace ${select} --helptry on your machineexplain this command
-
github:issue:filter View and filter the open issues of the current repository.$ gh issue listtry on your machineexplain this command
-
github:issue:show:in-browser View an issue in the default web browser.$ gh issue view --web ${issue_number}try on your machineexplain this command
-
github:pull-request:checkout Check out a specific pull request locally.$ gh pr checkout ${pr_number}try on your machineexplain this command
-
github:pull-request:create Create a pull request.$ gh pr createtry on your machineexplain this command
-
github:pull-request:show:in-browser View a pull request in the default web browser.$ gh pr view --web ${pr_number}try on your machineexplain this command
-
github:pull-request:status Check the status of a repository's pull requests.$ gh pr statustry on your machineexplain this command
-
github:repository:clone Clone a GitHub repository locally.$ gh repo clone ${owner}/${repository}try on your machineexplain this command
-
gitsome:tldr:04e15 gitsome: List the current account's starred repos, filtered by a given search string.$ gh starred "${python 3}"try on your machineexplain this command
-
gitsome:tldr:0dab3 gitsome: View the recent activity feed for a given GitHub user, using the default pager (e.g. `less`).$ gh feed ${torvalds} -ptry on your machineexplain this command
-
gitsome:tldr:6d53c gitsome: Setup GitHub integration with the current account.$ gh configuretry on your machineexplain this command
-
gitsome:tldr:7d622 gitsome: List notifications for the current account (as would be seen in https://github.com/notifications).$ gh notificationstry on your machineexplain this command
-
gitsome:tldr:a7c37 gitsome: View the recent activity feed of a given GitHub repository.$ gh feed ${tldr-pages-tldr}try on your machineexplain this command