Skip to main content
Copilotbeginner

GitHub Copilot CLI: Install on Mac/Windows (brew, winget) & Fix "command not found"

Install GitHub Copilot CLI with `brew install copilot-cli`, `winget install GitHub.Copilot`, or the official script. Authenticate with /login and fix "command not found: copilot" PATH errors.

6 min readUpdated May 2026

Want us to handle this for you?

Get expert help →

GitHub Copilot CLI brings the power of Copilot's coding agent directly to your terminal. It can help with code generation, debugging, git workflows, and shell commands - all through natural language.

Quick Install

If you already have a GitHub Copilot subscription, install the CLI with one command for your platform, then run copilot and use /login to authenticate.

macOS — Homebrew:

brew install copilot-cli

Windows — WinGet (PowerShell):

winget install GitHub.Copilot

Linux, WSL, or any platform — official install script:

curl -fsSL https://gh.io/copilot-install | bash

Any platform with Node.js — npm:

npm install -g @github/copilot

After install, launch it in any terminal:

copilot

Then run /login inside the CLI to authenticate via your browser. Prerequisites, troubleshooting, and platform-specific notes follow below.

Prerequisites

Before installing Copilot CLI, ensure you have:

  • An active GitHub Copilot subscription (Individual, Business, or Enterprise)
  • PowerShell v6 or higher (Windows only - see note below)
  • Organization approval (if using Business/Enterprise, verify your admin has not disabled CLI access)

Windows Note: Windows 11 ships with PowerShell 5.1 by default. You will need to manually install PowerShell 6 or later, or use WSL for the best experience.

Installing on macOS

macOS users have three installation options.

The easiest method for macOS users:

brew install copilot-cli

For prerelease/beta features:

brew install copilot-cli@prerelease

To update later:

brew upgrade copilot-cli

Option 2: Install Script

Quick installation with a single command:

curl -fsSL https://gh.io/copilot-install | bash

Option 3: npm

If you prefer npm:

npm install -g @github/copilot

For prerelease versions:

npm install -g @github/copilot@prerelease

Installing on Windows

Windows users have multiple options, with WSL being recommended for the best experience.

Open PowerShell and run:

winget install GitHub.Copilot

For prerelease versions:

winget install GitHub.Copilot.Prerelease

For the most stable experience on Windows, use Copilot CLI within WSL:

  1. Install WSL if you have not already:
wsl --install
  1. Open your WSL terminal (Ubuntu or your preferred distribution)

  2. Install using the install script:

curl -fsSL https://gh.io/copilot-install | bash

Or use Homebrew in WSL:

brew install copilot-cli

Option 3: npm on Windows

If you have Node.js installed:

npm install -g @github/copilot

Windows PowerShell Requirements

Native Windows PowerShell support is experimental. If you choose native Windows over WSL:

  1. Check your PowerShell version:
$PSVersionTable.PSVersion
  1. If below version 6, install the latest PowerShell from Microsoft's GitHub releases

Authentication

After installation, authenticate with your GitHub account:

  1. Start Copilot CLI:
copilot
  1. Use the /login slash command when prompted

  2. Follow the browser authentication flow to connect your GitHub account

Alternative: Personal Access Token

If you prefer token-based authentication:

  1. Generate a fine-grained PAT at github.com/settings/personal-access-tokens/new

  2. Select the Copilot Requests permission

  3. Set the environment variable:

macOS/Linux/WSL:

export GH_TOKEN="your-token-here"

Windows (PowerShell):

$env:GH_TOKEN="your-token-here"

Verify Installation

After authentication, verify everything is working:

copilot --version

Then try a simple command:

copilot "explain what files are in this directory"

Basic Usage

Once installed, navigate to any code directory and run:

copilot

Common tasks:

# Ask questions about your code
copilot "how does the authentication work in this project?"

# Generate code
copilot "write a function to parse CSV files"

# Get help with git
copilot "create a commit message for my staged changes"

# Change AI model
/model  # Shows available models

Changing Models

The default model is Claude Sonnet 4.5. To change models:

  1. Start Copilot CLI: copilot
  2. Use the /model command
  3. Select from available options (GPT-5 mini, GPT-4.1, etc.)

Models included with your Copilot subscription do not consume premium requests on paid plans.

Updating Copilot CLI

Keep your installation up to date:

Homebrew:

brew upgrade copilot-cli

WinGet:

winget upgrade GitHub.Copilot

npm:

npm install -g @github/copilot@latest

Troubleshooting

"command not found: copilot"

If the command is not found after installation:

  1. Close and reopen your terminal
  2. Check if the installation directory is in your PATH
  3. Try reinstalling with a different method

Authentication Issues

If you cannot authenticate:

  1. Verify your Copilot subscription is active at github.com/settings/copilot
  2. Check if your organization has enabled CLI access (Business/Enterprise users)
  3. Try using a Personal Access Token instead

PowerShell Version Issues (Windows)

If you see errors about PowerShell version:

  1. Install PowerShell 7+ from github.com/PowerShell/PowerShell
  2. Or switch to using WSL for better compatibility

Next Steps

Compare other AI coding CLIs

Shipping code with AI?

Get alerted when it breaks

AI assistants ship code you didn't write line-by-line. GlitchReplay gives you error tracking plus session replay — so when AI-generated code breaks in production, you see the exact stack trace and the user's screen. Sentry-SDK compatible, flat-rate pricing.

Try GlitchReplay free

Frequently Asked Questions

Find answers to common questions

No, Copilot CLI is included with your existing GitHub Copilot subscription (Individual, Business, or Enterprise). No separate billing or API keys are required.

macOS or Windows with PowerShell v6 or higher. You also need an active GitHub Copilot subscription.

Yes, WSL is actually the recommended way to run Copilot CLI on Windows for the best stability and shell compatibility.

The default model is Claude Sonnet 4.5. You can change models using the /model command within the CLI.

Close and reopen your terminal first so the updated PATH loads. If it persists, ensure your package manager's bin directory is on your PATH — Homebrew uses /opt/homebrew/bin (Apple Silicon) or /usr/local/bin (Intel). On Windows, reopen PowerShell or sign out and back in. Confirm the install with copilot --version.