How to install Copilot CLI on Windows 11

To install Copilot CLI on Windows 11, run winget install GitHub.Copilot in PowerShell 7, then start it with copilot and sign in with /login.

This guide covers the WinGet and npm routes, the PowerShell and Node.js requirements, token sign-in, updates, removal and the errors people hit most.

How to install Copilot CLI on Windows 11
Copilot CLI opens with this welcome screen; type a request, @ to mention files, or / for slash commands. (Image: github.com)

Install Copilot CLI on Windows 11

WinGet ships with Windows 11 as part of App Installer, so this route needs no extra tools. GitHub publishes the package under the ID GitHub.Copilot.

  1. Open Start, type PowerShell 7, and open it.
  2. Run winget install GitHub.Copilot and wait for the install to finish.
  3. Close the window and open a new PowerShell 7 window.
  4. Use cd to move into a folder that holds the code you want to work on.
  5. Type copilot and press Enter.
  6. At the trust prompt, choose 1. Yes to trust the folder for this session only.
  7. Type /login, press Enter, and finish the sign-in in the browser window that opens.

Copilot CLI is ready once the prompt accepts a question. To try new features early, install GitHub.Copilot.Prerelease instead of GitHub.Copilot.

Install Copilot CLI on Windows 11 and answer the folder trust prompt
Choose 1. Yes to trust the folder for this session only, or option 2 to remember it for future sessions. (Image: docs.github.com)

What’s GitHub Copilot CLI?

GitHub Copilot CLI brings Copilot into your terminal. It answers questions, writes and debugs code, and works with GitHub.com, for example by making changes to a project and opening a pull request.

On Windows it runs from PowerShell or from Windows Subsystem for Linux (WSL). It can read, change and run files in the folder you start it from, so it asks before it does anything risky.

Feature What it does How to use it
Interactive mode A chat session in the terminal that can plan and carry out tasks Run copilot
Plan mode Copilot drafts an implementation plan before it writes code Press Shift + Tab to switch in and out
Programmatic mode Runs one prompt, completes the task and exits Run copilot -p "your prompt"
File context Adds a file's contents to your prompt Type @ followed by the relative path
Shell commands Runs a command directly without calling the model Start the line with !
Tool approval Asks before running commands that change or execute files Pick 1. Yes, the session option, or 3. No

If you also use Google's terminal agent, you can install Antigravity CLI on Windows 11 in a similar way, with its own command.

GitHub Copilot CLI requirements for Windows 11

GitHub lists three requirements. Node.js matters only if you install through npm.

Requirement Details How to meet it
Copilot plan Copilot CLI is included in every Copilot plan, including Copilot Free and Copilot Student Sign up for a plan on GitHub, or get a seat from your organization
PowerShell v6 or higher Windows 11 includes Windows PowerShell 5.1, which is too old Install PowerShell 7 with WinGet
Node.js 22 or later Needed for the npm install method only Install a current LTS release from nodejs.org
Organization policy If Copilot comes from an organization or enterprise, the Copilot CLI policy must be enabled Ask the organization owner or enterprise administrator

PowerShell 7 installs side by side with Windows PowerShell 5.1 and does not replace it. Both stay in the Start menu.

How to install PowerShell 7 for Copilot CLI

Microsoft's recommended route is WinGet. You can run this from Windows PowerShell 5.1 or Command Prompt, the same way you would install PowerShell 7 on Windows 11 for any other purpose.

winget install --id Microsoft.PowerShell --source winget

--id Microsoft.PowerShell picks the stable PowerShell 7 package, and --source winget skips the Microsoft Store source. From PowerShell 7.6.0 onward the package installs as MSIX by default.

You should see: A PowerShell 7 entry appears in the Start menu, and running pwsh starts it.

If you need the older MSI-based installer, add --installer-type wix to the same command.

Install PowerShell 7 for Copilot CLI, then open PowerShell 7 (x64) from Start
PowerShell 7 installs side by side with Windows PowerShell 5.1, so both show up in Start search results. (Image: Microsoft)

How to install Copilot CLI with npm on Windows

Use npm if you already manage developer tools through Node.js. The npm package is @github/copilot, and it needs Node.js 22 or later.

  1. Install Node.js 22 or later from nodejs.org if it is not already on the PC. The Windows Installer (.msi) is the recommended system-wide option.
  2. Open a new PowerShell 7 window.
  3. Run npm --version to confirm that npm responds.
  4. Run npm install -g @github/copilot to install the stable release.
  5. For the prerelease build, run npm install -g @github/copilot@prerelease instead.
  6. Run copilot from your project folder and sign in with /login.

If npm install stops with a scripts error, check your .npmrc file for ignore-scripts=true and use the fix in the troubleshooting section below.

Install Node.js for Copilot CLI with npm from the nodejs.org download page
Pick Windows and x64, then use Windows Installer (.msi), the recommended system-wide option for Node.js 22 or later. (Image: nodejs.org)

How to log in to Copilot CLI

On a local Windows desktop, Copilot CLI uses a browser sign-in by default. You can sign in with a GitHub account or a Microsoft Entra account.

  1. Start Copilot CLI with copilot in PowerShell 7.
  2. Type /login and press Enter. Outside a session, copilot login does the same job.
  3. Approve the request in the browser window that opens.
  4. Return to PowerShell and wait for the CLI to confirm the sign-in.
  5. On a remote terminal or when the browser cannot reach the PC, run copilot login --device-code and enter the code it shows.

After sign-in, the token is saved in the system credential store. If no credential store is available, it goes into a plain text file under the .copilot folder in your user profile.

Copilot CLI personal access token on Windows

A token suits scripts and automation where no browser sign-in is possible. It must be a fine-grained personal access token owned by your personal account. Classic tokens that start with ghp_ are not supported.

  1. Open github.com/settings/personal-access-tokens/new in your browser.
  2. Under Resource owner, select your personal account, not an organization.
  3. Under Repository access, choose Public repositories, All repositories or Only select repositories.
  4. Under Permissions, select the Account tab, click Add permissions and select Copilot Requests.
  5. Click Generate token and copy it.
  6. For the current PowerShell session, run $Env:COPILOT_GITHUB_TOKEN = 'your-token'.
  7. To keep it for future sessions, run [Environment]::SetEnvironmentVariable('COPILOT_GITHUB_TOKEN', 'your-token', 'User') and open a new window.

Copilot CLI checks COPILOT_GITHUB_TOKEN first, then GH_TOKEN, then GITHUB_TOKEN. A stale value in a higher variable wins over a fresh one lower down.

How to check if Copilot CLI is installed

  1. Open a new PowerShell 7 window.
  2. Run copilot --version. A version number means the command is on your PATH.
  3. Run copilot version to see the version and check whether an update is available.
  4. Start copilot and type a short question. A reply means sign-in and your plan both work.
  5. Type /usage to see the session's usage and per-model token totals.

How to update Copilot CLI on Windows

Copilot CLI can update itself, whichever way you installed it. Inside a session, /update does the same thing, and /update stable or /update prerelease also saves the channel for future updates.

copilot update

Downloads and installs the latest Copilot CLI release.

You should see: copilot --version reports the newer version number in a new window.

Copilot CLI slash commands list

Slash commands control the session itself. Type them at the Copilot prompt, not at the PowerShell prompt.

Command What it does
/login, /logout Sign in to or out of Copilot
/model Pick the AI model, or choose Auto
/help Show help for interactive commands
/cwd or /cd Change or show the working directory
/add-dir Trust another directory for file access
/clear or /new Start a new conversation
/usage Show session usage and token totals
/update Update the CLI to the latest version
/feedback Send feedback about the CLI
/exit or /quit Close the current session

Press Esc twice within half a second to stop a task that is still thinking. Press Ctrl + C twice to exit.

How to change the model in Copilot CLI

Copilot Free and Copilot Student use auto model selection only. Paid plans can pick a model from a list.

  1. Start copilot and type /model.
  2. Select a model in the picker, or choose Auto.
  3. Press Enter to switch the current session to that model.
  4. To make it the default for future sessions, run /model --global and pick the model again.
  5. For a single run, start the CLI with copilot --model followed by the model ID.
Change the model in Copilot CLI from the welcome banner's /model hint
The session banner names /model as the command that opens the model picker for the current session. (Image: docs.github.com)

Uninstall Copilot CLI on Windows 11

Remove Copilot CLI with the same tool you used to install it.

  1. Open PowerShell 7.
  2. If you used WinGet, run winget uninstall --id GitHub.Copilot --source winget. For the prerelease, use GitHub.Copilot.Prerelease.
  3. If you used npm, run npm uninstall -g @github/copilot.
  4. Open a new window and run copilot --version. An error that the command is not recognised confirms removal.
  5. Delete the .copilot folder in your user profile if you also want to remove saved settings and session data.
  6. Revoke any personal access token you created at github.com/settings/personal-access-tokens.

Adding --source winget to the uninstall command avoids a Microsoft Store agreement prompt.

Copilot CLI not working on Windows 11

"Error: No authentication information found"

No sign-in or token is stored anywhere the CLI checks.

  1. Run copilot login, or start copilot and type /login.
  2. If you rely on a token, run $Env:COPILOT_GITHUB_TOKEN and check that it prints a value.
  3. Set the variable again if it prints nothing, then open a new window.

"Error: Authentication failed" or 401 Unauthorized

The token was revoked, has expired or lacks the Copilot Requests permission.

  1. Open your fine-grained tokens on GitHub and check the token's expiry date.
  2. Create a new token owned by your personal account with Copilot Requests added.
  3. Replace the old value in COPILOT_GITHUB_TOKEN, GH_TOKEN or GITHUB_TOKEN.

Classic token (ghp_) rejected

Copilot CLI does not accept classic personal access tokens.

  1. Remove the ghp_ token from your environment variables.
  2. Sign in with /login, or create a fine-grained token instead.

403 Forbidden or policy denied

Your account has no Copilot plan, or an organization or enterprise policy blocks Copilot CLI.

  1. Check your Copilot plan in your GitHub account settings.
  2. If Copilot comes from your employer, ask the organization owner to enable the Copilot CLI policy.

Copilot CLI signs in with the wrong account

Several accounts are signed in, or a token variable overrides your sign-in.

  1. Check COPILOT_GITHUB_TOKEN, GH_TOKEN and GITHUB_TOKEN for an old token.
  2. Use /user inside the CLI to switch accounts.

npm install of Copilot CLI fails with ignore-scripts

Your .npmrc file sets ignore-scripts=true, which blocks the package's install scripts.

  1. Run $Env:npm_config_ignore_scripts = 'false' in PowerShell 7.
  2. Run npm install -g @github/copilot again in the same window.

Copilot CLI on Windows FAQ

Is Copilot CLI free?

Yes, with limits. GitHub includes Copilot CLI in every Copilot plan, including Copilot Free and Copilot Student. Free plans get an allowance of AI credits and auto model selection only, while paid plans add larger allowances and model choice.

Does Copilot CLI work in Windows PowerShell 5.1?

No. GitHub requires PowerShell v6 or higher on Windows, and Windows 11 ships with Windows PowerShell 5.1. Install PowerShell 7 with winget install --id Microsoft.PowerShell --source winget and run Copilot CLI from it.

Do I need Node.js to install Copilot CLI?

Only for the npm method, which needs Node.js 22 or later. The WinGet package GitHub.Copilot installs Copilot CLI without Node.js, so most Windows 11 users can skip Node entirely.

Can I use Copilot CLI in WSL?

Yes. GitHub supports Copilot CLI on Windows from PowerShell or from Windows Subsystem for Linux. Inside a WSL distribution, install it with npm or the Linux install script rather than WinGet.

Where does Copilot CLI store its settings on Windows?

Copilot CLI keeps settings and state in the .copilot folder in your user profile. Its user settings file is settings.json in that folder. Set the COPILOT_HOME environment variable to use a different folder.

How do I install the Copilot CLI prerelease?

Run winget install GitHub.Copilot.Prerelease, or npm install -g @github/copilot@prerelease if you use npm. Inside a session, /update prerelease switches the update channel and saves it for later updates.

Can my organization block Copilot CLI?

Yes. If you get Copilot through an organization or enterprise, the owner or administrator can disable Copilot CLI in its settings. You then cannot use the CLI with that seat, even though other Copilot features still work.

Philip Celasco

Philip is a Texas-based technology writer and IT administrator at Techdows.com with more than 10 years of experience creating practical content for everyday users and professionals. He specializes in web browsers, particularly Chromium-based platforms such as Google Chrome, Microsoft Edge, Brave, and Opera. Through his work as an IT administrator, Philip has hands-on experience managing devices, configuring browser policies, troubleshooting software and network issues, and helping people resolve problems that affect productivity and security. His articles are based on practical testing and real-world technical experience. He covers browser settings, extensions, performance problems, privacy controls, security features, and Windows troubleshooting. Outside work, Philip enjoys the quieter side of life in Texas and stepping away from the screen when he can. He has two kids, two cats and loves to play golf with his mother during the weekends.

Leave a Reply

Your email address will not be published. Required fields are marked *