Skip to content

Commit 6df9825

Browse files
devm33hubwriter
andauthored
Update installation instructions for Copilot CLI (#58928)
Co-authored-by: hubwriter <[email protected]>
1 parent 0724499 commit 6df9825

File tree

1 file changed

+79
-5
lines changed

1 file changed

+79
-5
lines changed

content/copilot/how-tos/set-up/install-copilot-cli.md

Lines changed: 79 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ redirect_from:
1616
- /copilot/how-tos/personal-settings/installing-github-copilot-in-the-cli
1717
- /copilot/how-tos/set-up/installing-github-copilot-in-the-cli
1818
contentType: how-tos
19-
category:
19+
category:
2020
- Configure Copilot
2121
---
2222

@@ -26,20 +26,94 @@ To find out about {% data variables.copilot.copilot_cli_short %} before you inst
2626

2727
## Prerequisites
2828

29-
* **A {% data variables.product.prodname_copilot %} subscription**. See [Copilot plans](https://github.com/features/copilot/plans?ref_product=copilot&ref_type=engagement&ref_style=text).
30-
* **Node.js** version 22 or later
31-
* **npm** version 10 or later
29+
* **An active {% data variables.product.prodname_copilot %} subscription**. See [{% data variables.product.prodname_copilot_short %} plans](https://github.com/features/copilot/plans?ref_product=copilot&ref_type=engagement&ref_style=text).
30+
* (On Windows) **PowerShell** v6 or higher
3231

3332
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](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/managing-policies-for-copilot-in-your-organization).
3433

3534
## Installing or updating {% data variables.copilot.copilot_cli_short %}
3635

37-
Run the following command to install or update {% data variables.copilot.copilot_cli_short %}.
36+
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).
37+
38+
### Installing with WinGet (Windows)
39+
40+
```powershell copy
41+
winget install GitHub.Copilot
42+
```
43+
44+
To install the prerelease version:
45+
46+
```powershell copy
47+
winget install GitHub.Copilot.Prerelease
48+
```
49+
50+
### Installing with Homebrew (macOS and Linux)
51+
52+
```shell copy
53+
brew install copilot-cli
54+
```
55+
56+
To install the prerelease version:
57+
58+
```shell copy
59+
brew install copilot-cli@prerelease
60+
```
61+
62+
### Installing with npm (all platforms, requires Node.js 22+)
3863

3964
```shell copy
4065
npm install -g @github/copilot
4166
```
4267

68+
To install the prerelease version:
69+
70+
```shell copy
71+
npm install -g @github/copilot@prerelease
72+
```
73+
74+
### Installing with the install script (macOS and Linux)
75+
76+
```shell copy
77+
curl -fsSL https://gh.io/copilot-install | bash
78+
```
79+
80+
Or:
81+
82+
```shell copy
83+
wget -qO- https://gh.io/copilot-install | bash
84+
```
85+
86+
To run as root and install to `/usr/local/bin`, use `| sudo bash`.
87+
88+
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.
89+
90+
To install a specific version, set the `VERSION` environment variable. It defaults to the latest version.
91+
92+
For example, to install version `v0.0.369` to a custom directory:
93+
94+
```shell copy
95+
curl -fsSL https://gh.io/copilot-install | VERSION="v0.0.369" PREFIX="$HOME/custom" bash
96+
```
97+
98+
### Download from {% data variables.product.prodname_dotcom_the_website %}
99+
100+
You can download the executables directly from [the `copilot-cli` repository](https://github.com/github/copilot-cli/releases/).
101+
102+
Download the executable for your platform, unpack it, and run.
103+
104+
## Authenticating with {% data variables.copilot.copilot_cli_short %}
105+
106+
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.
107+
108+
### Authenticating with a {% data variables.product.pat_generic %}
109+
110+
You can also authenticate using a {% data variables.product.pat_v2 %} with the "{% data variables.product.prodname_copilot_short %} Requests" permission enabled.
111+
112+
1. Visit [{% data variables.product.pat_v2_caps_plural %}](https://github.com/settings/personal-access-tokens/new).
113+
1. Under "Permissions," click **Add permissions** and select **{% data variables.product.prodname_copilot_short %} Requests**.
114+
1. Click **Generate token**.
115+
1. Add the token to your environment using the `GH_TOKEN` or `GITHUB_TOKEN` environment variable (in order of precedence).
116+
43117
## Next steps
44118

45119
You can now use {% data variables.product.prodname_copilot_short %} from the command line. See [AUTOTITLE](/copilot/how-tos/use-copilot-agents/use-copilot-cli).

0 commit comments

Comments
 (0)