- Git for Windows 2.47+ (setup-git-for-windows.md)
GitHub CLI (gh) is the official command-line interface for GitHub. It allows you to
interact with GitHub repositories, issues, pull requests, releases, and Actions workflow
runs directly from a terminal.
For day-to-day development it is optional. It becomes essential once you are publishing releases, managing pull requests from the command line, or scripting repository operations as part of CI automation.
winget install --id GitHub.cli- Go to https://cli.github.com/ or https://github.com/cli/cli/releases/latest
- Download the
.msiinstaller for your architecture (gh_2.x.x_windows_amd64.msi) - Run the installer and accept the defaults
Open a new terminal after installation and run:
gh --versionExpected output should be something like:
gh version 2.65.x (2026-xx-xx)
https://github.com/cli/cli/releases/tag/v2.65.xGitHub CLI requires authentication before it can interact with GitHub. Run:
gh auth loginFollow the interactive prompts:
| Prompt | Recommended choice |
|---|---|
| Where do you use GitHub? | GitHub.com |
| Preferred protocol | HTTPS |
| Authenticate with credentials | Login with a web browser |
A one-time code will be displayed in the terminal. Your browser will open automatically. Enter the code, authorise the application, and return to the terminal. The CLI will confirm successful authentication.
Verify authentication is working:
gh auth statusExpected output confirms your account and the active token.
- GitHub CLI respects the Git credential configuration already set up by Git for Windows.
You do not need to configure credentials separately for
gitoperations. ghcommands operate on the repository in the current directory by default. Runghcommands from inside a cloned repository folder.- To view available commands:
gh help - To check workflow run status for the current repository:
gh run list