| title | Installing GitHub Copilot CLI | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| shortTitle | Install Copilot CLI | |||||||||
| intro | Learn how to install {% data variables.copilot.copilot_cli_short %} so that you can use {% data variables.product.prodname_copilot_short %} directly from the command line. | |||||||||
| product | {% data reusables.gated-features.copilot-cli %} | |||||||||
| versions |
|
|||||||||
| redirect_from |
|
|||||||||
| contentType | how-tos | |||||||||
| category |
|
|||||||||
| docsTeamMetrics |
|
To find out about {% data variables.copilot.copilot_cli_short %} before you install it, see AUTOTITLE.
- An active {% data variables.product.prodname_copilot %} subscription. See {% data variables.product.prodname_copilot_short %} plans.
- (On Windows) PowerShell v6 or higher
If you have access to {% data variables.product.prodname_copilot %} via your organization or enterprise, you cannot use {% data variables.copilot.copilot_cli_short %} if your organization owner or enterprise administrator has disabled it in the organization or enterprise settings. See AUTOTITLE.
You can install {% data variables.copilot.copilot_cli_short %} using WinGet (Windows), Homebrew (macOS and Linux), npm (all platforms), or an install script (macOS and Linux).
Prerequisite: {% data variables.copilot.copilot_cli_npm_version %}.
npm install -g @github/copilotNote
If you have ignore-scripts=true in your ~/.npmrc file, you must use the command:
npm_config_ignore_scripts=false npm install -g @github/copilotTo install the prerelease version:
npm install -g @github/copilot@prereleasewinget install GitHub.CopilotTo install the prerelease version:
winget install GitHub.Copilot.Prereleasebrew install copilot-cliTo install the prerelease version:
brew install copilot-cli@prereleasecurl -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 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:
curl -fsSL https://gh.io/copilot-install | VERSION="v0.0.369" PREFIX="$HOME/custom" bashYou can download the executables directly from the copilot-cli repository.
Download the executable for your platform, unpack it, and run.
On first launch, if you're not currently logged in to {% data variables.product.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 AUTOTITLE.
You can also authenticate using a {% data variables.product.pat_v2 %} with the "{% data variables.product.prodname_copilot_short %} Requests" permission enabled.
{% data reusables.copilot.copilot-cli-pat-steps %}
You can now use {% data variables.product.prodname_copilot_short %} from the command line. See AUTOTITLE.