← All postsHow Do You Install the GitHub Copilot CLI?

How Do You Install the GitHub Copilot CLI?

Carlos GarciaCarlos GarciaPublished

How Do You Install the GitHub Copilot CLI?

GitHub Copilot CLI is the terminal version of Copilot: an agent you run in a project directory that reads your files, runs commands, and edits code, without an editor in the loop. It installs in one command, and which command depends entirely on which operating system you are on.

The part that catches people is not the install. It is that the CLI is a different product from the thing people usually mean by "Copilot in the terminal". For a long time, terminal Copilot meant a gh extension that suggested shell commands. The current CLI is a standalone binary called copilot that runs an agent, and it is what GitHub documents today.

This guide covers every install route GitHub publishes, the sign-in step, what it costs against your plan, and the mistakes worth avoiding on a first run.

How do you install the GitHub Copilot CLI?

Pick the route for your platform. All four are from GitHub's own installation instructions.

  • macOS and Linux, Homebrew: brew install copilot-cli
  • Windows, WinGet: winget install GitHub.Copilot
  • macOS and Linux, install script: curl -fsSL https://gh.io/copilot-install | bash
  • Any platform, npm: npm install -g @github/copilot

Then start it by changing into a folder that contains your code and running:

copilot

If you are not signed in, type /login at the prompt and follow the on-screen steps. That is the complete happy path.

Automating the work is only half of it — the other half is knowing what to automate. Get a free SEO audit and see where your time is going.

Homebrew and WinGet are the routes to prefer if you have them, because installations through a package manager or the install script update themselves. The npm route does not, and has to be refreshed by hand.

Free audit

Where do you stand in AI search?

A manual SEO + AI search audit of your site: how ChatGPT, Gemini, Perplexity and Claude read and cite it today, and what to fix first. Report within 48 hours, no credit card.

Get my free audit

Or have it all done: AI SEO services, $999 once

Which install route should you actually choose?

They all end up with the same binary, so the question is really about how you want to maintain it.

Homebrew, on macOS or Linux

brew install copilot-cli is the least friction on a Mac, and it slots into whatever upgrade habit you already have. There is a prerelease channel if you want features earlier: brew install copilot-cli@prerelease. Treat that as genuinely prerelease rather than as a slightly newer stable.

WinGet, on Windows

winget install GitHub.Copilot is the documented Windows route, with winget install GitHub.Copilot.Prerelease for the early channel. One prerequisite is easy to miss: GitHub's instructions call for PowerShell v6 or higher. The PowerShell 5.1 that ships with Windows is not it, so if the CLI behaves oddly on a fresh Windows machine, check your shell version before anything else.

The install script

curl -fsSL https://gh.io/copilot-install | bash installs to a per-user location by default. GitHub's instructions note that installing to /usr/local/bin means piping to sudo bash instead, which is worth being deliberate about rather than doing reflexively. The script also accepts environment variables to pin a version and a prefix, which is the route to use in a provisioning script where you do not want whatever happens to be latest:

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

The wget equivalent is wget -qO- https://gh.io/copilot-install | bash.

npm

npm install -g @github/copilot works on macOS, Linux and Windows, and is the obvious choice if your team already standardises tooling through npm. The tradeoff is manual updates — npm install -g @github/copilot@latest when you want a newer build.

Codespaces and dev containers

If you work in Codespaces there is nothing to install: the CLI is in the default Codespaces image. There is also a Dev Container Feature for it, which is the clean way to give a whole repository's contributors the CLI without each of them installing anything. Standalone executables are published as release artifacts for every platform if you need to vendor a specific build.

How does signing in work?

There are two paths, and which one you want depends on whether a human is present.

For interactive use, run copilot and then /login. The CLI walks you through authorising, and from then on it remembers you.

For anything unattended — CI, a container, a scripted task — use a token instead. Create a fine-grained personal access token with the Copilot Requests permission, then set it in the environment as GH_TOKEN or GITHUB_TOKEN. If both are present, GH_TOKEN wins.

That precedence matters more than it sounds. If you have a GITHUB_TOKEN set for some other tool and add GH_TOKEN for Copilot, Copilot uses the one you just set and other tools keep using theirs, which is usually what you want. Reverse it and you get confusing failures.

Tooling decisions compound. Get a free SEO audit and start with the numbers rather than the tools.

One organisational caveat: on Business and Enterprise plans an administrator has to enable Copilot CLI. If your install succeeded and sign-in fails or usage is blocked, that is the first thing to check — it is a policy setting, not a broken install.

What does it cost, and which plans include it?

GitHub's Copilot CLI page states that the CLI is "included as a core feature of all GitHub Copilot plans", and lists Free, Pro, Pro+, Max, Business and Enterprise. So there is no separate CLI purchase, and Copilot Free is on the list.

Usage draws on your plan's allowance. GitHub's current framing is AI Credits: each interaction with the agent "draws on your respective plan's AI Credits allowance". The plans page shows Free at $0 with limited chat and agent usage, Pro at $10 a month, Pro+ at $39 and Max at $100, with flex allowances on top of the paid tiers.

Two notes on that. First, GitHub's own repository documentation still describes usage in terms of premium requests, one per prompt — the terminology is mid-migration, so expect to see both words in the wild referring to the same underlying budget. Second, prices and allowances on AI tooling move faster than any article can track, so confirm the current figure on GitHub's plans page before making a purchasing decision on it.

For Business and Enterprise there is no additional billing or setup for the CLI beyond the admin enabling it.

How do you get a useful first session?

Installation is the easy part. A first session that produces something is a slightly different skill.

  1. Change into the root of the project you want to work on before running copilot. The agent's context is the directory you start it in, and starting it in your home folder gives it nothing useful to read.
  2. Run copilot and sign in with /login if prompted.
  3. Give it a task rather than a question. "Find where the retry logic lives and add a maximum backoff" works better than "how does retry work here", because the CLI is an agent rather than a chat window.
  4. Watch what it proposes to run. It will suggest commands; read them before approving.
  5. Use /context when a session feels like it has lost the thread — it shows a breakdown of token usage so you can see what is filling the window.
  6. Use /compact to compress the history manually. Auto-compaction kicks in near 95% of the token limit on its own, but doing it deliberately before a long task helps.
  7. Use --resume to pick up earlier work. Pressing TAB cycles through local sessions and remote Copilot coding agent sessions.

The built-in agents

The CLI ships with four named agents — Explore for codebase analysis, Task for running tests and builds, Plan for implementation plans, and Code-review for reviewing changes. GitHub's changelog says Copilot delegates to these automatically when appropriate, and that several can run in parallel.

In practice this means you often do not need to invoke them by name. Asking for a plan tends to get you the Plan agent. It is still worth knowing they exist, because it explains why a single prompt sometimes produces several streams of work at once.

What goes wrong, and what the CLI will not do?

A short list of the things that actually bite.

  • Language servers are not bundled. The CLI does not ship them, so language-aware behaviour needs them installed separately — npm install -g typescript-language-server, for example. Without that, expect less precision on symbol-level questions.
  • PowerShell 5.1 on Windows. The documented prerequisite is v6 or higher. A default Windows shell will not meet it.
  • It consumes your allowance per prompt. Exploratory back-and-forth is not free; on a limited plan a long session can eat through more than you expect.
  • An admin can switch it off. On Business and Enterprise plans, organisation policy can disable the CLI entirely, and no local fix works around that.
  • Experimental features are opt-in. Autopilot and other experimental behaviour need copilot --experimental or the /experimental command. If a feature you read about is missing, that is usually why.
  • It is early. GitHub's own repository describes the project as still early in its journey. Expect the command surface to move between versions, which is an argument for the self-updating install routes.

If you were looking for the old gh copilot extension

Plenty of existing tutorials describe installing Copilot in the terminal as a gh CLI extension that explains and suggests shell commands. That is a different, older thing. If what you want is an agent that reads and edits your project, install the standalone copilot binary with one of the commands above. Mixing instructions from both eras is the most common reason an install appears to half-work.

Half-finished setups quietly cost you. Get a free SEO audit and find what is not pulling its weight.

How does it compare to the alternatives?

Terminal-based coding agents are now a crowded category, and the honest summary is that they differ more on integration than on capability.

Copilot CLI's advantage is that it is already part of a subscription most teams have, and it shares an account, a policy surface and a usage budget with Copilot in the editor and Copilot code review. For an organisation that has already standardised on GitHub, that is the whole argument: one approval, one bill, one admin control.

Dedicated terminal-first agents from other vendors tend to go deeper on long multi-file work and cost more for the privilege. If your work is mostly large refactors driven entirely from a shell, that depth may be worth a second subscription. If the terminal is one of several places you work, the integrated option is usually the better value.

The practical test is cheap: the CLI is included on Copilot Free, so you can install it and find out on your own codebase before paying anyone anything.

Before you buy another tool, find out what you already have. Get a free SEO audit and see the gaps clearly.

Final Thoughts

Installing GitHub Copilot CLI is a single command: brew install copilot-cli on macOS or Linux, winget install GitHub.Copilot on Windows, the gh.io/copilot-install script, or npm install -g @github/copilot anywhere. Then run copilot inside a project and sign in with /login.

Prefer a package manager or the install script over npm so updates handle themselves, check you are on PowerShell 6 or later if you are on Windows, and remember that on a Business or Enterprise plan an admin has to enable the CLI before it will work at all.

If you are weighing the CLI against a dedicated terminal agent rather than just getting it running, our comparison of Claude Code versus GitHub Copilot goes use case by use case on which one actually wins.

Install it on the free tier first and let your own repository settle the question.

Want this done for you?

SEO Stuff gets businesses cited by ChatGPT, Gemini, Perplexity and Claude, and ranking in Google. Start with the free audit, a call, or the package.

See where you stand

A free, manual SEO + AI search audit of your site, with a report within 48 hours. No credit card, no sales call.

Get my free audit

Talk it through

A free 15-minute call with the founder about whether AI search is a meaningful opportunity for your business.

Free strategy call

Have it done

The Done-For-You Package: audit, 10 pages of content, 3 DR50+ placements, dashboard. $999 once, delivered in 21 business days.

See the package