You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An active GitHub Copilot subscription. See Copilot plans.
(On Windows) PowerShell v6 or higher
If you have access to GitHub Copilot via your organization or enterprise, you cannot use Copilot CLI if your organization owner or enterprise administrator has disabled it in the organization or enterprise settings. See Managing policies and features for GitHub Copilot in your organization.
Installing or updating Copilot CLI
You can install Copilot CLI using WinGet (Windows), Homebrew (macOS and Linux), npm (all platforms), or an install script (macOS and Linux).
Installing with npm (all platforms)
Prerequisite: Node.js 22 or later.
npm install -g @github/copilot
Note
If you have ignore-scripts=true in your ~/.npmrc file, you must use the command:
Installing with the install script (macOS and Linux)
curl -fsSL https://gh.io/copilot-install | bash
Or:
wget -qO- https://gh.io/copilot-install | bash
To run as root and install to /usr/local/bin, use | sudo bash.
To install to a custom directory, set the PREFIX environment variable. It defaults to /usr/local when run as root or $HOME/.local when run as a non-root user.
To install a specific version, set the VERSION environment variable. It defaults to the latest version.
For example, to install version v0.0.369 to a custom directory:
Download the executable for your platform, unpack it, and run.
Authenticating with Copilot CLI
On first launch, if you're not currently logged in to GitHub, you'll be prompted to use the /login slash command. Enter this command and follow the on-screen instructions to authenticate. For more information on the authentication process, see Authenticating GitHub Copilot CLI.
Authenticating with a personal access token
You can also authenticate using a fine-grained personal access token with the "Copilot Requests" permission enabled.
Under Resource owner, select your personal account. Do not select an organization. The Copilot Requests permission is only available on user-owned fine-grained personal access tokens.
Under Repository access, select the level of access appropriate for your use case:
Public repositories if you only need to work with public repos.
All repositories if you need access across all your current and future repos.
Only select repositories if you want to restrict access to specific repos.
Under Permissions, select the Account tab.
Click Add permissions and select Copilot Requests.
Click Generate token.
Export the token in your terminal or environment configuration. Use the COPILOT_GITHUB_TOKEN, GH_TOKEN, or GITHUB_TOKEN environment variable (in order of precedence).
Type of issue
Typo
Feedback
Installing GitHub Copilot CLI
Learn how to install Copilot CLI so that you can use Copilot directly from the command line.
To find out about Copilot CLI before you install it, see About GitHub Copilot CLI.
Prerequisites
If you have access to GitHub Copilot via your organization or enterprise, you cannot use Copilot CLI if your organization owner or enterprise administrator has disabled it in the organization or enterprise settings. See Managing policies and features for GitHub Copilot in your organization.
Installing or updating Copilot CLI
You can install Copilot CLI using WinGet (Windows), Homebrew (macOS and Linux), npm (all platforms), or an install script (macOS and Linux).
Installing with npm (all platforms)
Prerequisite: Node.js 22 or later.
Note
If you have
ignore-scripts=truein your~/.npmrcfile, you must use the command:To install the prerelease version:
Installing with WinGet (Windows)
To install the prerelease version:
Installing with Homebrew (macOS and Linux)
To install the prerelease version:
Installing with the install script (macOS and Linux)
curl -fsSL https://gh.io/copilot-install | bashOr:
wget -qO- https://gh.io/copilot-install | bashTo run as root and install to
/usr/local/bin, use| sudo bash.To install to a custom directory, set the
PREFIXenvironment variable. It defaults to/usr/localwhen run as root or$HOME/.localwhen run as a non-root user.To install a specific version, set the
VERSIONenvironment variable. It defaults to the latest version.For example, to install version
v0.0.369to a custom directory:Download from GitHub.com
You can download the executables directly from the
copilot-clirepository.Download the executable for your platform, unpack it, and run.
Authenticating with Copilot CLI
On first launch, if you're not currently logged in to GitHub, you'll be prompted to use the
/loginslash command. Enter this command and follow the on-screen instructions to authenticate. For more information on the authentication process, see Authenticating GitHub Copilot CLI.Authenticating with a personal access token
You can also authenticate using a fine-grained personal access token with the "Copilot Requests" permission enabled.
COPILOT_GITHUB_TOKEN,GH_TOKEN, orGITHUB_TOKENenvironment variable (in order of precedence).Next steps
You can now use Copilot from the command line. See Using GitHub Copilot CLI.
For a list of commands for Copilot CLI, including the command to update, see GitHub Copilot CLI command reference.
Page URL
https://learn.microsoft.com/en-us/windows/wsl/install
Content source URL
https://github.com/MicrosoftDocs/wsl/blob/main/WSL/install.md
Author
@GrantMeStrength
Document Id
7ed8fb81-5b8f-4d56-7b89-bf600ce6080a
Platform Id
be29a304-5e0d-f710-845d-404c0feacfec