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
@@ -26,20 +26,94 @@ To find out about {% data variables.copilot.copilot_cli_short %} before you inst
26
26
27
27
## Prerequisites
28
28
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
32
31
33
32
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).
34
33
35
34
## Installing or updating {% data variables.copilot.copilot_cli_short %}
36
35
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+)
38
63
39
64
```shell copy
40
65
npm install -g @github/copilot
41
66
```
42
67
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:
### 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
+
43
117
## Next steps
44
118
45
119
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