GitHub CLI quickstart

Start using CLI de GitHub to work with GitHub in the command line.

About CLI de GitHub

CLI de GitHub is an open source tool for using GitHub from your computer's command line. When you're working from the command line, you can use the CLI de GitHub to save time and avoid switching context.

Getting started

  1. Install CLI de GitHub on macOS, Windows, or Linux.

  2. In the command line, authenticate to GitHub.

    gh auth login
  3. Start working with GitHub in the command line. For example, find an issue to work on with gh issue status or gh issue list --assignee @me. Create a pull request with gh pr create. Review a pull request with gh pr checkout, gh pr diff and gh pr review.

Next steps

  • Tell CLI de GitHub which text editor to use for commands that open a text editor. For example, enter gh config set editor "code -w" to set your preferred text editor to Visual Studio Code. For more information, see gh config set.

  • Define aliases for commands that you commonly run. For example, if you run gh alias set prd "pr create --draft", you will then be able to run gh prd to quickly open a draft pull request. For more information, see gh alias.

  • Create or add custom commands with CLI de GitHub extensions. For more information, see "Using CLI de GitHub extensions" and "Creating CLI de GitHub extensions."

  • For more information about all of the commands that you can run with CLI de GitHub, see "CLI de GitHub reference."

Did this doc help you?Privacy policy

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

O, learn how to contribute.