← Back to Dashboard
Setup Guide

Installing GitHub Copilot CLI

Get the agent running in your terminal.

Note: GitHub Copilot CLI is in public preview and subject to change.

Prerequisites


Installation Methods

🪟 Windows (via WinGet)

The easiest way for Windows users.

winget install GitHub.Copilot

For the prerelease version:

winget install GitHub.Copilot.Prerelease

🍎 macOS & 🐧 Linux (via Homebrew)

brew install copilot-cli

For the prerelease version:

brew install copilot-cli@prerelease

📦 All Platforms (via npm)

Requires Node.js 22+.

npm install -g @github/copilot

Manual Installation (Script)

For macOS and Linux users who prefer a direct script:

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

To install to a specific location (e.g., custom directory):

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

Authentication

Once installed, you need to link it to your GitHub account.

Interactive Login

Run the copilot command in your terminal. If not logged in, it will prompt you:

copilot /login

Follow the on-screen browser flow to authorize the CLI.

Token Login

You can also use a Fine-grained Personal Access Token:

  1. Go to GitHub Settings > Developer Settings > Fine-grained tokens.
  2. Generate a token with "Copilot Requests" permission.
  3. Set it as an environment variable: GH_TOKEN or GITHUB_TOKEN.