How to Install GitHub Copilot CLI (npm, WinGet, Homebrew)
Quick answer
Install with npm install -g @github/copilot (needs Node.js 22 or newer), winget install GitHub.Copilot on Windows, or brew install --cask copilot-cli on macOS and Linux. Run copilot in your project folder, then type /login to sign in with GitHub. It needs a Copilot plan; Free, Pro and Pro+ all include it. Update with copilot update.
What GitHub Copilot CLI is
GitHub Copilot CLI is Copilot as an agent in your terminal. You describe a task in plain words and it reads your files, edits code and runs commands, asking for your approval before it uses a tool you haven't allowed yet.
It replaces the older gh copilot extension for the GitHub CLI, which GitHub deprecated on October 25, 2025. If you followed an older guide that tells you to run gh extension install github/gh-copilot, use the steps below instead.
Before you start
| You need | Details |
|---|---|
| A Copilot plan | Free ($0), Pro ($10/mo) and Pro+ ($39/mo) all include Copilot CLI. On Business or Enterprise, your admin must not have turned it off. |
| Node.js 22 or newer | Only for the npm install method. Check with node --version. |
| PowerShell 6 or newer | Windows only. Windows PowerShell 5.1, the version built into Windows, isn't enough. You can also use WSL. |
Supported systems: Linux, macOS, and Windows (PowerShell or WSL).
Step 1: Install it
Pick one method.
npm (any system):
npm install -g @github/copilot
If your ~/.npmrc has ignore-scripts=true, the install won't finish setting up. Run this instead:
npm_config_ignore_scripts=false npm install -g @github/copilot
WinGet (Windows):
winget install GitHub.Copilot
Homebrew (macOS and Linux):
brew install --cask copilot-cli
Install script (macOS and Linux):
curl -fsSL https://gh.io/copilot-install | bash
Direct download: ready-made executables are on the copilot-cli releases page.
Each method also has a prerelease channel for early features: npm install -g @github/copilot@prerelease, winget install GitHub.Copilot.Prerelease or brew install --cask copilot-cli@prerelease.
Step 2: Start it and sign in
Open a terminal in your project folder. Copilot works on the folder you start it from.
Run:
copilotConfirm that you trust the files in this folder. Copilot asks this every time you start in a new folder, because it will read and may change files below it. Don't start it in your home folder or anywhere with files you don't want it to touch.
Type
/loginand follow the prompts to sign in with your GitHub account.
Signing in without a browser (servers, CI): create a fine-grained personal access token:
- choose your personal account as the owner, not an organization;
- under Account permissions, add Copilot Requests.
Then put the token in one of these environment variables. Copilot checks them in this order: COPILOT_GITHUB_TOKEN, GH_TOKEN, GITHUB_TOKEN.
Step 3: Your first task
Type a request in plain words, for example "explain what this project does" or "add input validation to the signup form". Before Copilot uses a tool it hasn't been allowed to use, such as running a shell command or writing a file, it asks for your approval.
Useful commands inside a session:
| Command | What it does |
|---|---|
/help |
Help on a topic |
/clear |
Start a new conversation |
/ask |
Ask a quick side question without adding it to the conversation |
/settings |
Change CLI settings |
/tasks |
See and manage running tasks |
Useful options when starting it:
| Option | What it does |
|---|---|
copilot -p "<prompt>" |
Run a single prompt without the interactive screen |
copilot --continue |
Pick up your most recent session |
copilot --resume |
Choose an earlier session to resume |
copilot --allow-all-tools |
Skip approval prompts. Only use this somewhere Copilot can't do damage, such as a throwaway container. |
How usage is counted
Every interaction uses AI credits, based on how many tokens are processed. That applies to the interactive screen and to -p prompts. The Free plan has limited chat and agent usage and entry-level models only, so long agent sessions use it up quickly. Pro or Pro+ give you more usage and stronger models.
Update it
copilot update
If you installed with WinGet or Homebrew, you can also update the usual way: winget upgrade GitHub.Copilot or brew upgrade --cask copilot-cli.
Common problems
copilot: command not foundafter an npm install. npm's global folder isn't on your PATH, or Node.js is older than 22. Runnode --version, thennpm prefix -g, and add that folder'sbin(on Windows, the folder itself) to your PATH.- The npm install finishes but
copilotwon't start. Check forignore-scripts=truein~/.npmrcand reinstall with thenpm_config_ignore_scripts=falsecommand above. - Errors on Windows in the default PowerShell. Windows PowerShell 5.1 isn't supported. Install PowerShell 7 (
winget install Microsoft.PowerShell) and runcopilotfrom pwsh, or use WSL. - "Not authorized" or a plan error after
/login. Your account has no active Copilot plan, or your organization has turned Copilot CLI off. The Free plan is enough to start; on a company account, ask your admin. - A token in an environment variable is ignored. The token must be fine-grained, owned by your personal account, with the Copilot Requests permission. Also check which variable is set:
COPILOT_GITHUB_TOKENwins overGH_TOKEN, which wins overGITHUB_TOKEN. - You still have the old extension. Remove it with
gh extension remove gh-copilotso the oldgh copilotcommand doesn't get confused with the newcopilotcommand.