Agentcode

Checked against GitHub's own docs, August 2026

GitHub Copilot CLI: Install, Pricing, Commands and Usage Limits, and What Copilot CLI Costs per Terminal Session

Every Copilot plan includes the CLI, including the free one, so the question is never which plan unlocks it. The question is how many terminal sessions your credit balance actually buys, and the answer swings by roughly 47 times depending on one dropdown.

See what one session costs

No card to start · Flat $29/mo billed yearly, no credit balance to watch

Agent Run

Pick a task

Plan

  • planning

Files changed

Test run

0 failed

Pull request

Open

You review and merge. Agentcode never merges on its own.

The short answer

GitHub Copilot CLI is the terminal version of Copilot, and it is included in every Copilot plan including the free one, so there is nothing extra to buy. You install it with npm install -g @github/copilot on Node 22 or later, then sign in with /login. What the plan actually buys is the credit balance the CLI spends: every interaction consumes GitHub AI credits at 1 credit = $0.01, priced off the model you picked. At GitHub's own published rates a single session costs roughly 10 credits on a cheap model and roughly 450 on the most expensive one, so a $10 Copilot Pro plan is either about 156 terminal sessions a month or about 3, decided entirely by the model dropdown.

How to install GitHub Copilot CLI

Four routes, all official, all from GitHub's install documentation. Pick the one that matches how the rest of your tooling is managed rather than the one at the top of the page. The npm route is the most common and also the one that fails most often, for a reason worth reading in the third column.

Swipe to see more

Route Command What to know
npm (any platform) npm install -g @github/copilot Needs Node.js 22 or later. If your ~/.npmrc sets ignore-scripts=true, GitHub says you must run npm_config_ignore_scripts=false npm install -g @github/copilot instead, which is the single most common failed first install.
Homebrew (macOS, Linux) brew install --cask copilot-cli The cask, not a formula. Easiest route if you already manage developer tooling with Homebrew and do not want a global npm package on the machine.
WinGet (Windows) winget install GitHub.Copilot Windows needs PowerShell v6 or higher. The CLI also runs under Windows Subsystem for Linux if you would rather keep it on the Linux side.
Install script (macOS, Linux) curl -fsSL https://gh.io/copilot-install | bash One line, no Node install of your own. Read the script before you pipe it to a shell on a work machine, the same as any curl-to-bash install.
Prerelease channel npm install -g @github/copilot@prerelease Append @prerelease on npm, use GitHub.Copilot.Prerelease on WinGet, or copilot-cli@prerelease on Homebrew. Useful for testing new agent behavior before it reaches your team.
Authentication /login or export COPILOT_GITHUB_TOKEN=... On first launch you are prompted for the /login slash command. For CI or a headless box, use a fine-grained personal access token carrying the Copilot Requests permission, exported as COPILOT_GITHUB_TOKEN, GH_TOKEN or GITHUB_TOKEN.

Supported platforms are Linux, macOS, and Windows from inside PowerShell v6 or higher, plus Windows Subsystem for Linux. Once it starts, the CLI answers questions, writes code, debugs and talks to GitHub.com from the same prompt. When your conversation reaches 95% of the token limit it compresses the history in the background rather than stopping, which keeps you working and quietly costs you a request.

Which Copilot plan do you need for the CLI?

None in particular, which is the part most comparison articles get wrong. GitHub's plans page states that all plans include Copilot CLI and the Copilot app. There is no CLI tier, no add-on, and no upgrade that unlocks the terminal. What a bigger plan buys is a bigger credit balance and a wider model menu, and since the CLI is billed on tokens, those two things are the whole cost story.

Swipe to see more

Plan Price Monthly AI credits CLI included What it means for terminal work
Copilot Free $0 Included allowance Yes GitHub states all plans include Copilot CLI. Free also caps inline suggestions at 2,000 completions a month and restricts model choice to auto selection, so the CLI is usable but you cannot steer cost by picking a cheaper model.
Copilot Pro $10 / month 1,500 (1,000 base + 500 flex) Yes The cheapest plan that gives you the model picker, which is the only real cost lever the CLI has. This is the plan most solo developers should price the CLI on.
Copilot Pro+ $39 / month 7,000 (3,900 base + 3,100 flex) Yes Adds access to premium models. The 3,100 credit flex allotment is why this seat carries more included usage than a Copilot Enterprise seat at the same price.
Copilot Max $100 / month 20,000 (10,000 base + 10,000 flex) Yes Priority model access and the largest balance. Only worth it if your CLI habit is a daily one on an expensive model; see the per-session table below before signing.
Copilot Business $19 / seat / month 1,900 per user, pooled Yes Seats contribute to a shared enterprise pool rather than a personal balance, and no flex allotment is published for organization plans. Org policy can switch off local bring-your-own-key.
Copilot Enterprise $39 / seat / month 3,900 per user, pooled Yes Same CLI, larger pooled balance, plus the enterprise governance. Enterprise owners can also push custom BYOK models down to every user, which the individual plans cannot do.

Two details from that table decide more purchases than the prices do. Base credits match the subscription price to the cent, so a Copilot seat is prepaid model spend with a product around it, and only the individual plans carry a flex allotment on top. The full arithmetic, including why a $39 Pro+ seat carries more included usage than a $39 Enterprise seat, is on our GitHub Copilot agent pricing page, and the seat-by-seat comparison lives in Copilot Business against Copilot Enterprise.

What one Copilot CLI session actually costs

Nobody publishes this, so here it is. GitHub bills the CLI in AI credits at 1 credit = $0.01, drawn against published per-million-token rates for whichever model you selected. Multiply the rates by a session and you get a price. We assume one session is 300,000 input tokens and 30,000 output tokens, which is a realistic multi-turn agent run where the whole conversation is resent with every tool result. That token assumption is ours, not GitHub's. The rates and the credit balances are GitHub's.

Swipe to see more

Model Rate in / out per 1M Credits per session Sessions on Pro ($10) Sessions on Business seat ($19) Sessions on Max ($100)
GPT-5.6 Luna $0.20 / $1.20 9.6 156 197 2,083
MAI-Code-1.1-Flash (Microsoft) $0.20 / $1.20 9.6 156 197 2,083
GPT-5 mini $0.25 / $2.00 13.5 111 140 1,481
GPT-5.4 mini $0.75 / $4.50 36 41 52 555
Kimi K2.7 Code (Moonshot) $0.95 / $4.00 40.5 37 46 493
Claude Haiku 4.5 $1.00 / $5.00 45 33 42 444
Grok 4.6 (xAI) $2.00 / $6.00 78 19 24 256
Claude Sonnet 5 $2.00 / $10.00 90 16 21 222
GPT-5.3-Codex $1.75 / $14.00 94.5 15 20 211
Gemini 3.1 Pro $2.00 / $12.00 96 15 19 208
GPT-5.4 (default) $2.50 / $15.00 120 12 15 166
Claude Sonnet 4.6 $3.00 / $15.00 135 11 14 148
Claude Opus 5 $5.00 / $25.00 225 6 8 88
GPT-5.5 $5.00 / $30.00 240 6 7 83
Claude Fable 5 $10.00 / $50.00 450 3 4 44

Read the top row against the bottom one. On the same $10 Copilot Pro plan, doing the same work, the model dropdown decides whether you get about 156 terminal sessions a month or about 3. That is a 47 times difference in the cost of one session, and it is the single largest lever anyone has over a Copilot bill. A team that standardizes on a cheap model for routine work and reaches for an expensive one deliberately will spend a fraction of a team that leaves the default alone and then complains the allowance is small.

The other thing this table shows is where the ceiling is. Even Copilot Max at $100 a month is 88 sessions on Claude Opus 5. If your team genuinely runs an agent all day on a frontier model, no seat price makes that cheap, and you are choosing between paying the meter and changing the shape of the work.

Copilot CLI vs Claude Code vs Codex CLI

These are the three terminal agents a US engineering team actually shortlists in August 2026. Every figure below comes from that vendor's own documentation, including the ones that make Copilot look worse. We sell a competing product, so read the last row with that in mind.

Swipe to see more

GitHub Copilot CLI Codex CLI Claude Code
What you pay Nothing extra. Included on every Copilot plan from Free up, so the CLI rides on the seat you already bought. Included on the ChatGPT plan. Free $0, Go $8, Plus $20, Pro from $100 (5x limits) or $200 (20x limits), Business $20 per user billed annually or $25 monthly. Included on a Claude plan, or metered per token on the API and on Bedrock, Google Cloud and Microsoft Foundry.
How usage is metered GitHub AI credits at 1 credit = $0.01, charged on tokens processed and priced per model. Pro carries 1,500 a month, Business 1,900 a seat, Max 20,000. Credits per message, plus a rolling message cap. OpenAI states GPT-5.6 usage averages 5 to 30 credits per message and that image work burns limits 3 to 5 times faster. A per-seat allowance on Team and Enterprise that resets on a rolling five hour window and a weekly window, shared with Claude chat. Anthropic writes that the seat allowance is the default ceiling.
The published cost per developer Fully predictable if you stay inside the balance, and $0.01 a credit after that, which is the same rate as the included one. No penalty for overage and no discount for prepaying. Fixed by plan. Plus gives 25 to 200 local GPT-5.6 Terra messages per five hour window; Pro 20x gives 500 to 4,000 of the same. Anthropic publishes real numbers: around $13 per developer per active day and $150 to $250 per developer per month across enterprise deployments, staying under $30 per active day for 90% of users.
Bring your own model Yes. Point it at Ollama, OpenAI, Azure OpenAI or Anthropic with four environment variables. Business and Enterprise admins can disable local BYOK by policy, or push approved custom models to everyone. Yes, with an API key, billed pay as you go at standard API rates. OpenAI notes model availability then follows whatever your key can reach, with no included monthly limits. Yes, through an API key, Amazon Bedrock, Google Cloud or Microsoft Foundry, billed to that account rather than to a seat.
Where the cost surprise hides The model dropdown. Same plan, same work, up to a 47 times difference in what one session costs. The five hour window. You can be productive all morning and locked out at 2pm on the same plan you were fine on yesterday. Long sessions. Anthropic warns that the full conversation is resent on every request, so a one-line question in a session left open all day still draws usage for the whole thread.
Best for Teams already paying for Copilot seats who want a terminal agent without a second vendor, a second invoice or a second security review. Developers already on a ChatGPT plan who work in bursts and would rather hit a window than watch a balance. Teams that want the strongest long-running agent sessions and can absorb a genuinely variable per-developer bill.

The honest summary is that Copilot CLI wins on price predictability and on not needing a second vendor, Codex CLI wins if you already pay for ChatGPT and prefer a hard window to a balance, and Claude Code wins on capability in long sessions while costing the most in published terms. If you want that last pair taken apart properly, we do it on Codex vs Claude Code, and the Copilot side gets the same treatment in GitHub Copilot vs Claude Code pricing.

GitHub Copilot CLI BYOK: pointing it at your own models

The CLI can talk to a model that is not GitHub's. That matters for two very different buyers: the one who wants cheaper tokens, and the one whose code is not allowed to leave a specific network. Configuration is four environment variables, and any model you point it at has to support tool calling and streaming, with a context window of at least 128k tokens recommended.

Swipe to see more

Provider Environment variables Why a team picks it
Ollama, or any OpenAI-compatible local server COPILOT_PROVIDER_BASE_URL=http://localhost:11434, COPILOT_MODEL=YOUR-MODEL-NAME No API key needed for a local server. This is the configuration to reach for when the blocker is that source code cannot leave the machine.
OpenAI COPILOT_PROVIDER_BASE_URL=https://api.openai.com/v1, COPILOT_PROVIDER_API_KEY, COPILOT_MODEL Your OpenAI account meters those tokens at its own rates.
Azure OpenAI COPILOT_PROVIDER_TYPE=azure, COPILOT_PROVIDER_BASE_URL=https://YOUR-RESOURCE.openai.azure.com/openai/deployments/YOUR-DEPLOYMENT, COPILOT_PROVIDER_API_KEY, COPILOT_MODEL=YOUR-DEPLOYMENT-NAME The one most regulated US buyers end up on, because the traffic stays inside an Azure tenancy they already have a signed agreement for.
Anthropic COPILOT_PROVIDER_TYPE=anthropic, COPILOT_PROVIDER_BASE_URL=https://api.anthropic.com, COPILOT_PROVIDER_API_KEY, COPILOT_MODEL Lets you run Claude models through the Copilot CLI interface rather than through Claude Code, if the CLI is what your team standardized on.

One caution, because getting this wrong costs real money. GitHub documents how to configure BYOK and which plans it applies to, but its BYOK pages do not publish a statement about whether AI credits are still consumed when you are running on your own provider. Do not build a budget on the assumption that BYOK zeroes your credit usage until GitHub confirms it for your account. And on Copilot Business or Copilot Enterprise, check the policy first: an organization or enterprise owner can disable local BYOK outright, and separately can push approved custom models down to everyone, which is the path most regulated US teams end up taking.

The fine print CLI buyers find out later

All ten of these are in GitHub's own documentation. Most of them are in none of the comparison articles, and three of them will change which plan you sign.

  • Copilot CLI is on every plan. GitHub writes that "All plans include Copilot CLI and Copilot app", so there is no CLI tier, no add-on and no upgrade that unlocks it. What you are buying with a higher plan is credits and model access.
  • Code completions and next edit suggestions are not billed in AI credits and stay unlimited on all paid plans. That means the CLI and the other agent surfaces are the entire variable part of your Copilot bill.
  • Credits do not roll over. The balance resets to the full monthly amount at 00:00:00 UTC on the first day of each calendar month, so a migration you want the CLI to grind through should be scheduled inside one calendar month.
  • Organization overage is $0.01 per credit, exactly the same rate as the included credits. There is no penalty for going over and no discount for buying ahead, which makes this a cash flow question rather than a unit economics one.
  • The CLI compresses your history automatically at 95% of the token limit rather than stopping. That is good for continuity and quietly expensive, because the compression pass is itself a paid request.
  • BYOK models must support tool calling and streaming, and GitHub recommends at least a 128k token context window. A small local model that cannot call tools will connect and then fail to do agent work.
  • On Copilot Business and Copilot Enterprise, an organization or enterprise policy can disable local BYOK in IDEs and the CLI. If you are planning to route around credits with your own key, check the policy before you plan the budget.
  • GitHub documents how to configure BYOK and which plans it covers, but does not publish a statement about whether AI credits are still consumed on a custom provider. Confirm that with GitHub before you build a budget on it. We are not going to guess at a number.
  • Copilot Free restricts you to automatic model selection. Since the model choice is the whole cost lever, the free tier is the one plan where you cannot manage the cost of the CLI at all.
  • A fine-grained personal access token carrying the Copilot Requests permission is what makes the CLI work in CI or on a headless server. Plan for how those tokens are issued and rotated before you script anything against it.

Which plan should you actually buy for terminal work?

Solo developer, occasional CLI use

Copilot Pro at $10. It is the cheapest plan with a model picker, and on a cheap model 1,500 credits is roughly 156 sessions a month at our assumed session size. If you leave it on an expensive default you will get about 6 and conclude the plan is bad, when the dropdown was the problem.

Daily CLI habit on a strong model

Copilot Pro+ at $39, or Max at $100 if you are running the agent most of the working day. Pro+ carries 7,000 credits, which is roughly 51 sessions a month on Claude Sonnet 4.6 or 58 on GPT-5.4. Do the division against the model you actually use, not the one in the marketing.

Team of 5 to 50 on GitHub

Copilot Business at $19 a seat. Credits pool across the organization, which matters more than the per-seat number, because your one heavy CLI user is subsidized by the six people who mostly take completions. Budget in dollars, since that is the unit GitHub caps in.

Regulated or source-restricted team

Copilot Enterprise at $39 a seat, and use enterprise custom models to point the CLI at an Azure OpenAI deployment inside your own tenancy. This is the configuration that gets a terminal agent past a security review at a US bank or healthcare payer.

You want finished pull requests, not a terminal session

A CLI agent is a great pair of hands and still needs you sitting in front of it. If what you actually want is to hand off a task and read a pull request afterwards, that is a different product shape, and it is the one we build.

You just want to try it before paying

Copilot Free includes the CLI. It is genuinely usable for evaluation, with the caveat that automatic model selection means you learn nothing about what it will cost you at volume. Run your evaluation on Pro if the number you need is a budget.

Where we fit, and where Copilot CLI beats us

Take the losses first. Copilot CLI is free on a seat most teams already own, it installs in one command, it reaches GitHub.com natively, and it can be pointed at a model inside your own Azure tenancy. Nothing we sell replaces having an agent in the terminal you are already typing in. If your team wants one vendor and one invoice, buy Copilot and stop reading.

What we do differently is where the work lands. A CLI agent needs you sitting in front of it, watching output and approving steps, and it bills you for every minute of that attention. Agentcode takes a task against a connected GitHub or GitLab repository, plans it, edits the code, runs your test suite and opens a pull request for a human to read. It never merges on its own, so your branch protection and reviewers stay exactly as they are.

It also costs $29 a month, flat, billed yearly. No credit balance, no model dropdown that changes your invoice by 47 times, no monthly forfeiture of what you did not spend. That is a narrower product than Copilot and we are happy to say so. If you are still building a shortlist, the GitHub Copilot alternatives worth considering covers the field honestly, including where we lose.

GitHub Copilot CLI: the questions people actually search

Is GitHub Copilot CLI free?

Copilot CLI is included on every Copilot plan, including Copilot Free, so there is no separate purchase. GitHub states that all plans include Copilot CLI. It is not unlimited though: every interaction spends GitHub AI credits from your plan allowance, and Copilot Free restricts you to automatic model selection, which removes the only real lever you have over what a session costs.

How much does Copilot CLI cost?

The CLI itself costs nothing beyond your Copilot plan, but each session spends AI credits at 1 credit = $0.01. At GitHub's published model rates, a session we assume at 300,000 input and 30,000 output tokens costs about 9.6 credits on GPT-5.6 Luna and about 225 on Claude Opus 5. So the same $10 Pro plan buys roughly 156 sessions or roughly 6.

How to install GitHub Copilot CLI

Run npm install -g @github/copilot on Node.js 22 or later. Homebrew users can run brew install --cask copilot-cli, Windows users winget install GitHub.Copilot with PowerShell 6 or higher, and there is a one-line script at curl -fsSL https://gh.io/copilot-install | bash. On first launch, sign in with the /login slash command.

Copilot CLI vs Claude Code: which is cheaper?

Copilot CLI is cheaper to start and more predictable, because it rides on a seat you probably already pay for and meters in credits you can see. Claude Code is the more expensive of the two in published terms: Anthropic reports around $13 per developer per active day and $150 to $250 per developer per month across enterprise deployments. Copilot Business at $19 a seat includes 1,900 credits, which is $19 of model usage.

What are the Copilot CLI usage limits?

There is no message cap on the CLI. The limit is your credit balance: 1,500 a month on Pro, 7,000 on Pro+, 20,000 on Max, 1,900 per seat on Business and 3,900 per seat on Enterprise, all pooled at the organization level on the two team plans. Balances reset at 00:00:00 UTC on the first of each month and unused credits are forfeited.

Copilot CLI vs Copilot Chat: what is the difference?

Copilot Chat answers questions inside your editor and generally leaves the edits to you. Copilot CLI is an agent in your terminal: it reads files, runs commands, makes changes and can interact with GitHub.com directly. Both draw on the same credit balance, but the CLI usually spends far more per task because an agent loop sends the whole conversation back with each tool result.

Can Copilot CLI use my own model?

Yes. Copilot CLI supports bring-your-own-key against Ollama and other OpenAI-compatible local servers, OpenAI, Azure OpenAI and Anthropic, configured with COPILOT_PROVIDER_BASE_URL, COPILOT_PROVIDER_API_KEY, COPILOT_PROVIDER_TYPE and COPILOT_MODEL. Models must support tool calling and streaming. On Business and Enterprise, an admin policy can turn local BYOK off.

Is GitHub Copilot CLI better than the VS Code extension?

They solve different problems rather than one beating the other. The extension is better for writing code you are watching, and its completions are free and unlimited on paid plans. The CLI is better for work you want done in a loop across many files, running commands and checking its own output, and unlike completions it costs credits every time.

Does Copilot CLI work on Windows?

Yes. GitHub supports Linux, macOS, and Windows from within PowerShell v6 or higher, plus Windows Subsystem for Linux. Install on Windows with winget install GitHub.Copilot, or use the npm package if you already run Node.js 22 or later. If you would rather keep your tooling on the Linux side, running it inside WSL is fully supported.

How do I use Copilot CLI in CI or on a headless server?

Authenticate with a token rather than the interactive /login. Create a fine-grained personal access token carrying the Copilot Requests permission and export it as COPILOT_GITHUB_TOKEN, GH_TOKEN or GITHUB_TOKEN. Budget for it separately, because an agent running unattended in CI can spend a monthly credit balance considerably faster than a person can.

Last updated: August 2026

A terminal is not the only place an agent can work

Connect a GitHub or GitLab repository, describe a task, and read the pull request it opens. Flat $29/mo billed yearly, no credit balance, no model dropdown deciding your invoice, and nothing merges without you.