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.
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.
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".
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.
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
- Open a terminal in your project folder.
- Type copilot and press Enter.
- Confirm that you trust the files in this directory. Copilot only reads and changes files in trusted directories.
- Type the slash command /login and follow the steps to sign in with GitHub.
- 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.
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.
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.
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.
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.
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.
Frequently asked questions
No. They share your plan and your AI credits, but Copilot CLI runs in the terminal and keeps its own settings and MCP servers. Use VS Code for inline completions and diffs; use the CLI for tasks you want to hand off.
Paid plans can pick any model their admin allows with /model, including Claude Sonnet 5.5, Claude Opus 5.5, GPT-6 Sol and Gemini 4 models. Free plans use auto model selection. With your own provider, any model that supports tool calling and streaming works; GitHub recommends a context window of at least 128,000 tokens.
Yes. Set COPILOT_PROVIDER_BASE_URL to your Ollama or vLLM address and COPILOT_MODEL to the model name. Run copilot help providers for the full list of settings.
Give the agent design rules and a design system it can read. We make Better Design, an MCP server with design rules and design systems for AI coding agents, Copilot CLI included. Pick it if your agent builds interfaces; skip it if you only write backend code.
Add Better Design to Copilot CLI.
Plans, prices, model rates and install steps checked 28 November 2026 on GitHub Docs, the github/copilot-cli repository and npm. GitHub changes model rates and the flex allotment often, so recheck before you rely on a number.
