Skip to main content

Installing GitHub Copilot in the CLI

Learn how to install Copilot na CLI so that you can get suggestions and explanations for the command line.

Prerequisites

If you have access to GitHub Copilot via your organization or enterprise, you cannot use Copilot na CLI if your organization owner or enterprise administrator has disabled Copilot na CLI. See Managing policies for Copilot in your organization.

Installing Copilot na CLI

  1. If you have not already authenticated to the GitHub CLI, run the following command in your terminal.

    Shell
    gh auth login
    
  2. To install the Copilot na CLI extension, run the following command.

    Shell
    gh extension install github/gh-copilot
    

Updating Copilot na CLI

After installing the Copilot na CLI extension, you can update at any time by running:

Shell
gh extension upgrade gh-copilot

Further reading