Installing GitHub CLI on Windows: A Step-by-Step Guide
In today's fast-paced development environment, having efficient tools is crucial. GitHub CLI (Command Line Interface) is a powerful tool that allows you to interact with GitHub directly from your terminal, boosting your productivity. Here's a comprehensive guide on how to install GitHub CLI on Windows.
Prerequisites
Before you start, ensure you have the following prerequisites:
- An active GitHub account.
- Windows 10 (64-bit) or later.
- PowerShell 5.0 or later (included in Windows 10).
Installing GitHub CLI
Now, let's dive into the installation process. We'll use the Windows Package Manager (winget) for this guide, as it's the recommended method by GitHub.

Step 1: Install Windows Package Manager
First, you need to install winget. Open PowerShell as an administrator and run the following command:
Set-ExecutionPolicy Bypass -Force -Scope Process; iex ((New-Object System.Net.WebClient).DownloadString('https://aka.ms/installwinget'))
Press Y to confirm, then press Enter.
Step 2: Install GitHub CLI
Now, you can install GitHub CLI using winget. Run the following command in PowerShell:

winget install --id GitHub.cli
This command will download and install GitHub CLI. Once the installation is complete, you'll see a confirmation message.
Verifying the Installation
To verify that GitHub CLI is installed correctly, open a new PowerShell window and type:
gh --version
You should see the installed version of GitHub CLI displayed.

Setting Up GitHub CLI
Before you can start using GitHub CLI, you need to authenticate it with your GitHub account. Run the following command:
gh auth login
Follow the prompts to log in to your GitHub account. Once authenticated, you're ready to start using GitHub CLI.
Troubleshooting Common Issues
If you encounter any issues, here are some common solutions:
| Issue | Solution |
|---|---|
| GitHub CLI not recognized as a command. | Add GitHub CLI to your system's PATH. You can find the installation directory using where gh in PowerShell. |
| Authentication fails. | Ensure you've entered the correct GitHub username and token. You can generate a personal access token in your GitHub account settings. |
That's it! You've successfully installed and set up GitHub CLI on your Windows machine. Happy coding!





















