commands.sh

gh

all

Work seamlessly with GitHub. Some subcommands such as `config` have their own usage documentation.

More info →

Subcommands (40)

gh a11y

This command is an alias of `gh accessibility`.

gh accessibility

Learn about GitHub CLI's accessibility experiences.

gh agent

This command is an alias of `gh agent-task`.

gh alias

Manage GitHub CLI command aliases.

gh api

Make authenticated HTTP requests to the GitHub API and print the response.

gh at

This command is an alias of `gh attestation`.

gh attestation

Download and verify artifact attestations to ensure their integrity and provenance.

gh auth

Authenticate with a GitHub host.

gh browse

Open a GitHub repository in the browser or print the URL.

gh cache

Manage GitHub Actions caches.

gh codespace

Connect and manage your codespaces in GitHub.

gh completion

Generate shell completion scripts for GitHub CLI commands.

gh config

Change configuration for GitHub CLI.

gh copilot

Interact with GitHub Copilot. Note: Deprecated in favor of `copilot`.

gh cs

This command is an alias of `gh codespace`.

gh environment

Display help about environment variables for the GitHub CLI command.

gh extension

Manage extensions for the GitHub CLI.

gh formatting

Formatting options for JSON data exported from gh GitHub CLI command.

gh gist

Work with GitHub Gists.

gh help

Display help about the GitHub CLI command.

gh issue

Manage GitHub issues.

gh label

Work with GitHub labels.

gh mintty

Display help about MinTTY integration for the GitHub CLI command.

gh org

Work with GitHub organizations.

gh pr

Manage GitHub pull requests. Some subcommands such as `create` have their own usage documentation.

gh preview

Preview GitHub CLI programs for testing and development purposes. These commands are unstable and may change at any time.

gh project

Work with GitHub Projects.

gh reference

Display a reference about the GitHub CLI command.

gh release

Manage GitHub releases.

gh repo

Work with GitHub repositories.

gh rs

This command is an alias of `gh ruleset`.

gh ruleset

Manage GitHub repository rulesets.

gh run

View, run, and watch recent GitHub Actions workflow runs.

gh screensaver

Extension for GitHub CLI that runs animated terminal screensavers. See also: `gh extension`.

gh search

Search across all of GitHub.

gh secret

Manage GitHub secrets.

gh skyline

Generate a 3D model of your GitHub contribution history. By default, it will create a `{username}-{year}-github-skyline.stl` file in the current directory.

gh status

Check the status of subscribed repositories on GitHub.

gh variable

Manage GitHub Actions and Dependabot variables.

gh workflow

List, view, and run GitHub Actions workflows.

Options (4)

boolean

Create a new issue

Example: gh issue {{[new|create]}}
boolean

View and filter the open issues of the current repository

Example: gh issue {{[ls|list]}}
-w, --webboolean

View an issue in the default web browser

Example: gh issue view {{[-w|--web]}} {{issue_number|url}}
boolean

Check out a specific pull request locally

Example: gh {{[co|pr checkout]}} {{pr_number|url|branch}}

Examples (8)

Clone a GitHub repository locally

gh repo clone owner/repository

Create a new issue

gh issue [new|create]

View and filter the open issues of the current repository

gh issue [ls|list]

View an issue in the default web browser

gh issue view [-w|--web] issue_number|url

Create a pull request

gh pr [new|create]

View a pull request in the default web browser

gh pr view [-w|--web] pr_number|url|branch

Check out a specific pull request locally

gh [co|pr checkout] pr_number|url|branch

Check the status of a repository's pull requests

gh pr status
made by @shridhargupta | data from tldr-pages