Skip to main content

Installing GitHub Copilot CLI

Learn how to install 부조종사 CLI so that you can use Copilot directly from the command line.

참고 항목

GitHub Copilot 명령 줄 인터페이스 (CLI)는 데이터 보호를 사용하여 공개 미리 보기 단계에 있으며 변경될 수 있습니다.

To find out about 부조종사 CLI before you install it, see GitHub Copilot CLI 정보.

Prerequisites

  • 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 부조종사 CLI if your organization owner or enterprise administrator has disabled it in the organization or enterprise settings. See 조직에서 GitHub Copilot의 정책과 기능 관리하기.

Installing or updating 부조종사 CLI

You can install 부조종사 CLI using WinGet (Windows), Homebrew (macOS and Linux), npm (all platforms), or an install script (macOS and Linux).

Installing with WinGet (Windows)

PowerShell
winget install GitHub.Copilot

To install the prerelease version:

PowerShell
winget install GitHub.Copilot.Prerelease

Installing with Homebrew (macOS and Linux)

Shell
brew install copilot-cli

To install the prerelease version:

Shell
brew install copilot-cli@prerelease

Installing with npm (all platforms, requires Node.js 22+)

Shell
npm install -g @github/copilot

To install the prerelease version:

Shell
npm install -g @github/copilot@prerelease

Installing with the install script (macOS and Linux)

Shell
curl -fsSL https://gh.io/copilot-install | bash

Or:

Shell
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:

Shell
curl -fsSL https://gh.io/copilot-install | VERSION="v0.0.369" PREFIX="$HOME/custom" bash

Download from GitHub.com

You can download the executables directly from the copilot-cli repository.

Download the executable for your platform, unpack it, and run.

Authenticating with 부조종사 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.

Authenticating with a personal access token

You can also authenticate using a fine-grained personal access token with the "Copilot Requests" permission enabled.

  1. Visit Fine-grained personal access tokens.
  2. Under "Permissions," click Add permissions and select Copilot Requests.
  3. Click Generate token.
  4. Add the token to your environment using the GH_TOKEN or GITHUB_TOKEN environment variable (in order of precedence).

Next steps

You can now use Copilot from the command line. See Using GitHub Copilot CLI.