Skip to main content

Installing GitHub Copilot CLI

Learn how to install Copilot(CLI 版) so that you can use Copilot directly from the command line.

注意

GitHub Copilot(CLI 版) is in public preview and subject to change.

To find out about Copilot(CLI 版) before you install it, see About GitHub Copilot CLI.

Prerequisites

  • A GitHub Copilot subscription. See Copilot plans.
  • Node.js version 22 or later
  • npm version 10 or later

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 管理组织中的 GitHub Copilot 策略和功能.

Installing or updating Copilot(CLI 版)

Run the following command to install or update Copilot(CLI 版).

Shell
npm install -g @github/copilot

Next steps

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