Skip to content

GitHub Copilot CLI: What It Does, What It Costs and How to Start

GitHub Copilot CLI is GitHub's terminal coding agent.

The words "Copilot CLI" in large black type above the github/copilot-cli repository page, which shows the README and the Copilot welcome screen in a terminal.

GitHub Copilot CLI in 2026

From install to your first task.

  1. Install: npm, Homebrew, WinGet or script
  2. Sign in: /login with GitHub
  3. Work: plan mode, approvals, MCP
  4. Pay: AI credits from your Copilot plan
  5. Pro: 1,500 credits for $10 a month

Better Design

Direct answer

GitHub Copilot CLI is GitHub's AI coding agent for the terminal. You type copilot in a project folder, describe a task, and it edits files, runs commands and opens pull requests after you approve each step. It comes with every Copilot plan, including Free, and each prompt uses AI credits from your plan.

Published 28 November 2026 by the Better Design team. Features, plans and prices come from GitHub Docs, the github/copilot-cli repository and the @github/copilot package on npm, all read that day.

Summary

What it is
A terminal agent that edits files, runs shell commands and works with GitHub issues and pull requests.
Price
Included in Copilot Free, Pro ($10 a month), Pro+ ($39), Max ($100), Business ($19 a seat) and Enterprise ($39 a seat).
How usage is billed
Tokens, converted to GitHub AI Credits at 1 credit = $0.01. Pro includes 1,500 credits a month.
Install
npm install -g @github/copilot (Node.js 22 or later), Homebrew, WinGet or an install script.
Systems
Linux, macOS and Windows through PowerShell or WSL.
Latest version
1.0.117 on npm on 28 November 2026.
The old gh copilot extension
Retired on 25 October 2025 in favor of Copilot CLI.

What is GitHub Copilot CLI?

The command-line interface runs Copilot as an agent directly in your terminal. GitHub says it uses the same agent harness as the Copilot coding agent that works on issues in the cloud. You start it in a project folder and talk to it in plain language.

GitHub's own examples show four kinds of work:

Change code
Ask it to change the color of H1 headings and it finds the CSS file and edits it.
Explain a project
Ask who changed a file, what a function does or why a build fails.
Run Git
Commit, revert the last commit or create a branch for an issue.
Work on GitHub.com
List your open pull requests, open an issue, review a pull request or create one. You show as the pull request author.

The GitHub MCP server comes set up out of the box, so GitHub work needs no extra setup. You can add other MCP servers for more tools.

Read GitHub's overview of Copilot CLI.

Is GitHub Copilot CLI free?

Yes, in a limited way. GitHub's plans page says every plan includes Copilot CLI, and that includes Copilot Free and Copilot Student. The free plans come with an allowance of AI credits, and GitHub does not print its size. Free plans also pick the model for you through auto model selection.

There is a second free route: bring your own model. Copilot CLI can run against an OpenAI-compatible endpoint, Azure OpenAI, Anthropic or a local model in Ollama, with no GitHub account at all. You then pay your model provider, or nothing for a local model. Without GitHub sign-in you lose GitHub-hosted features such as code search and delegating tasks to the cloud.

See GitHub's plans for Copilot.

Copilot CLI pricing: how much does it cost?

Copilot CLI has no price of its own. It uses the AI credits in your Copilot plan, the same pool as Copilot Chat and the cloud agent. Each prompt costs the tokens it reads and writes at the model's per-token rate, and 1 AI credit is $0.01.

Copilot Pro
$10 a month, 1,000 base credits plus a 500 flex allotment, 1,500 in total.
Copilot Pro+
$39 a month, 3,900 plus 3,100, 7,000 in total.
Copilot Max
$100 a month, 10,000 plus 10,000, 20,000 in total.
Copilot Business
$19 a seat a month, 1,900 credits per user, pooled across the organization.
Copilot Enterprise
$39 a seat a month, 3,900 credits per user, pooled.

Unused credits do not carry over. The allowance resets at 00:00 UTC on the first day of each month, whatever your billing date. When you run out, extra usage is billed at the same per-token rates unless you set a budget. To block all extra charges, create a Bundled AI credits budget of $0 and turn on "Stop usage when budget limit is reached".

Read GitHub's page on usage-based billing for individuals.

How many credits does one Copilot CLI session use?

It depends on the model and how much of your code the agent reads. An agent resends the conversation on every step, so most tokens are cached input. Here is one session worked out at GitHub's published rates.

  • Assumption: a bug fix that reads 1.8 million cached tokens, 100,000 new input tokens, writes 100,000 tokens to the cache and produces 60,000 output tokens.
  • On Claude Sonnet 5.5 ($2 input, $0.10 cached, $2.50 cache write and $10 output per million tokens): $0.18 + $0.20 + $0.25 + $0.60 = $1.23, or 123 credits.
  • On GPT-6 Luna ($0.10, $0.01, $0.125 and $0.50): about $0.07, or 7 credits.
  • Result: Copilot Pro's 1,500 credits cover about 12 such sessions on Sonnet 5.5, or about 200 on GPT-6 Luna.

Real sessions vary a lot. One published test measured 15.9 credits per Copilot CLI run on Claude Haiku 4.5. On Reddit, a team reported that one bug fix session at work used about 1,000 credits. Type /usage in a session to see the credits it has used so far.

See GitHub's per-token rates for every Copilot model.

Read the published Copilot CLI and Claude Code test.

How do you install GitHub Copilot CLI?

You need a Copilot plan or your own model provider. On Windows you also need PowerShell. Then pick one install method:

npm, any system
npm install -g @github/copilot (needs Node.js 22 or later).
Homebrew, macOS and Linux
brew install --cask copilot-cli
WinGet, Windows
Winget install GitHub.Copilot
Install script, macOS and Linux
curl -fsSL https://gh.io/copilot-install | bash
  1. Open a terminal in your project folder.
  2. Type copilot and press Enter.
  3. Confirm that you trust the files in this directory. Copilot only reads and changes files in trusted directories.
  4. Type the slash command /login and follow the steps to sign in with GitHub.
  5. Type your first task in plain language.

On a company plan, your organization owner can turn Copilot CLI off. If copilot refuses to start after sign-in, ask your admin to check the Copilot policies. For servers and CI, create a fine-grained personal access token with the Copilot Requests permission. Set it in the COPILOT_GITHUB_TOKEN environment variable.

Follow GitHub's install guide for Copilot CLI.

How do you use Copilot CLI?

Copilot CLI has an interactive mode and a programmatic mode. Type copilot for an interactive session, where you can steer the work and give feedback while it runs. Pass a single prompt with -p to run one task and exit, which suits scripts and CI.

Plan mode
Press Shift+Tab to switch. Copilot asks questions and writes a plan before it touches any code.
Choose a model
Type /model, or start with --model. Some models offer a 1 million token context and a higher reasoning level, which use more credits.
Slash commands
/usage, /context, /compact, /mcp, /model and /resume work inside any interactive session.
Resume work
Copilot --continue picks up the last session, and /resume lists older ones.
Manage context
/context shows token use, and /compact shrinks the history. Copilot compacts it on its own at 95% of the limit.
Run in the cloud
Copilot --cloud starts the session in a GitHub-hosted sandbox you can follow from GitHub Mobile.
Customize
Add custom instructions, custom agents, hooks, skills and MCP servers.

Read GitHub's guide to using Copilot CLI.

Is Copilot CLI safe to run?

It is as safe as the permissions you give it. By default, Copilot asks before it runs a tool that changes or runs files. Each approval prompt gives three choices: yes once, yes for that tool for the rest of the session, or no with feedback on what to do instead.

The --allow-all-tools flag and the /yolo command skip every prompt. GitHub warns that Copilot then has the same access as you and can run any shell command. A safer middle ground is to allow all tools and deny specific ones. For example, copilot --allow-all-tools --deny-tool='shell(rm)' blocks every rm command. For unattended runs, use GitHub's local or cloud sandbox, or a container.

Read GitHub's security notes for Copilot CLI.

Copilot CLI MCP: how do you add a server?

Run copilot mcp add --transport http with a name and the server URL, or type /mcp add in a session and fill in the form. Copilot CLI saves servers in ~/.copilot/mcp-config.json. It does not read the .vscode/mcp.json file that Copilot in VS Code uses, so set servers up for each one.

See the tested steps to add an MCP server to Copilot CLI.

What happened to gh copilot suggest and explain?

GitHub retired the gh copilot extension for GitHub CLI on 25 October 2025 and archived its repository. Its two commands, gh copilot suggest and gh copilot explain, only suggested and explained shell commands. Copilot CLI replaces both: ask it "what command lists files over 1 GB?" or "explain this command" and it answers in the same session.

Read the retirement notice in the gh-copilot repository.

Copilot CLI vs Claude Code, Codex CLI and Gemini CLI

All four are terminal coding agents with MCP support. They differ in how you pay and which models you get.

GitHub Copilot CLI
Billed in AI credits from a Copilot plan, with models from OpenAI, Anthropic and Google in one place. Best when your work lives in GitHub issues and pull requests.
Claude Code
Comes with a Claude plan, limited by 5-hour and weekly usage windows, and runs Anthropic models only.
Codex CLI
Comes with a ChatGPT plan and runs OpenAI models.
Gemini CLI
Signs in with a Google account and runs Google models.

On Reddit, people who use both Copilot and Claude Code often say Claude Code gets more done per session, and they like Copilot for its granular diff view and for value per dollar. If you already pay for Copilot, try Copilot CLI first, because it costs you nothing extra to start.

Read our Claude Code install guide.

Read our Codex CLI guide.

Read our Gemini CLI guide.

See GitHub Copilot pricing in detail.

Frequently asked questions