GuidesHosting choices

GitHub Copilot CLI: install, plans, SSH sign-in and config

GitHub Copilot CLI in November 2026: install it, which Copilot plans include it, sign in over SSH with a device code or token, config, MCP and -p mode.

November 28, 2026The Everpod team
The short answer

GitHub Copilot CLI is GitHub’s coding agent for the terminal: you run copilot in a project and it reads, edits and runs code with your approval, using models from Anthropic, OpenAI, Google and others. It replaced the old gh copilot extension, which stopped working on October 25, 2025. Install it with npm install -g @github/copilot (Node.js 22 or later) or GitHub’s install script. Every Copilot plan includes it, the free one too. Over SSH it signs in with a device code at github.com/login/device, and for scripts it takes a fine-grained token with the Copilot Requests permission in COPILOT_GITHUB_TOKEN. Version 1.0.117 was current on November 28, 2026.

Copilot CLI is not the old gh copilot

Older guides describe gh copilot suggest and gh copilot explain, an extension to GitHub’s own gh command that proposed one shell command at a time. GitHub announced in September 2025 that it “will stop working on October 25, 2025” and that its capabilities “are being replaced by the new GitHub Copilot CLI.” The new tool is a full agent in a separate program, copilot, which works through a task over many steps, asking before it runs a command or changes a file.

Since January 21, 2026, typing gh copilot offers to install the new CLI and then launches it, passing your arguments through. So the command name survives, but what answers it is the agent, not the extension.

It is not open source. The github/copilot-cli repository holds the README, the changelog, the install script and the licence. The licence lets you install and run it, and ship unmodified copies only inside an application of your own that adds substantial functionality, never on their own; you may not modify it.

Install Copilot CLI

It runs on Linux, macOS and Windows. Any one of these, from GitHub’s install docs:

npm install -g @github/copilot                   # any OS, Node.js 22 or later
curl -fsSL https://gh.io/copilot-install | bash  # macOS and Linux, no Node needed
brew install --cask copilot-cli                  # Homebrew, macOS and Linux
winget install GitHub.Copilot                    # Windows
Copied

On a server, the install script is the simplest route. Run as your normal user, it installs under $HOME/.local; run with | sudo bash it goes to /usr/local/bin for everyone. PREFIX picks another directory and VERSION pins a release. If you use npm and your ~/.npmrc sets ignore-scripts=true, GitHub says to install with npm_config_ignore_scripts=false npm install -g @github/copilot. Prereleases are published under @github/copilot@prerelease: three of them, 1.0.118-0 to 1.0.118-2, followed the stable 1.0.117 within a day.

Then start it inside a project, not your home directory. The first time in a folder it asks whether you trust it, and the docs say trusted directories “control where Copilot CLI can read, modify, and execute files.”

cd ~/projects/my-app
copilot
Copied

Which Copilot plans include it

GitHub’s plans page says “All plans include Copilot CLI and the Copilot app.” What differs is how much you can use it. Usage is now counted in GitHub AI Credits, spent by the tokens each request processes, at “1 AI credit = $0.01 USD”. As of November 28, 2026:

PlanPriceAI Credits a month
Copilot Free
$0“An allowance”, amount not stated; models by automatic selection only
Copilot Student
Free for verified studentsAn allowance, amount not stated; models by automatic selection only
Copilot Pro
$10 a month1,500 (1,000 base, 500 flex)
Copilot Pro+
$39 a month7,000 (3,900 base, 3,100 flex)
Copilot Max
$100 a month20,000 (10,000 base, 10,000 flex)
Copilot Business
$19 a seat a month1,900 a user
Copilot Enterprise
$39 a seat a month3,900 a user

GitHub notes that “Flex allotments may change over time.” The README still speaks of one “premium request” per prompt, which is the older billing. On Business and Enterprise, an organisation admin can switch the CLI off by policy, and then it will not start for you whatever your seat includes. You can also run it without a subscription on your own model provider, billed by that provider.

Inside a session, /model switches model, and --model auto lets Copilot choose. GitHub’s model list for the CLI includes Claude Opus 5.5 and Sonnet 5.5 and OpenAI’s GPT-6 models, and which ones you see depends on your plan.

Sign in on a headless server over SSH

On first launch Copilot CLI asks you to run /login. On a desktop that opens a browser; in what GitHub calls “known remote or headless environments (including SSH, GitHub Codespaces, dev containers, and CI)”, it uses the device code flow instead. You can also sign in before starting a session, and force the flow:

copilot login --device-code
Copied

The authentication docs show the prompt in this shape, with your own code in place of the example:

Enter one-time code: 1234-5678 at https://github.com/login/device
Copied

Open that address on your laptop or phone, enter the code, and approve it with the GitHub account that has the Copilot plan. Nothing has to reach the server from your browser, so no port forwarding is needed.

Where the token goes matters on a server. Copilot CLI stores it in the system keychain under the service name copilot-cli, which on Linux means libsecret, and a server reached over SSH usually has no keyring running. Then it offers to “store the token in a plaintext configuration file, by default at ~/.copilot/config.json”. If you accept, treat that file as a password: anyone who can read it can use your Copilot plan, so check with ls -l ~/.copilot/config.json that only your user can, and run chmod 600 ~/.copilot/config.json if not. /logout deletes the local copy but, in the docs’ words, “does not revoke it on GitHub”; revoke it there too if the machine is going away.

A token for scripts and CI

For unattended runs, use a fine-grained personal access token. Create it at github.com/settings/personal-access-tokens/new with your personal account as the resource owner (“The Copilot Requests permission is only available on user-owned fine-grained personal access tokens”), and under Account permissions add Copilot Requests. A classic token, the kind starting ghp_, is not supported. Copilot CLI reads tokens in this order: COPILOT_GITHUB_TOKEN, GH_TOKEN, GITHUB_TOKEN, the stored sign-in, then the GitHub CLI’s own login. To set it without the token landing in your shell history:

read -rsp 'Copilot token: ' COPILOT_GITHUB_TOKEN; echo
export COPILOT_GITHUB_TOKEN
Copied

Watch for one trap: “An environment variable silently overrides a stored OAuth token.” A GH_TOKEN or GITHUB_TOKEN already exported for other tools, often one without Copilot Requests, is the one Copilot CLI uses, and requests fail although your device-code sign-in is fine. Run env | grep -E '^(COPILOT_GITHUB|GH|GITHUB)_TOKEN=' | cut -d= -f1 to see which are set without printing them. Giving the agent its own access to your repositories is a separate question, covered in GitHub access for a coding agent on a server.

Where its config and MCP servers live

Everything per user sits in ~/.copilot/; set COPILOT_HOME to move the whole folder (the older --config-dir flag is deprecated).

PathWhat it holds
~/.copilot/settings.json
Your settings
~/.copilot/config.json
Internal state: trusted folders, installed plugins, the plaintext token if you chose it. Settings put here are ignored
~/.copilot/mcp-config.json
Your MCP servers
~/.copilot/copilot-instructions.md
Instructions for every session
~/.copilot/agents/, skills/, hooks/
Your custom agents, skills and hooks
~/.copilot/session-state/, logs/
Saved sessions for resuming, and logs
.github/copilot/settings.json
A repository’s shared settings (settings.local.json beside it for yours alone)
.mcp.json, .github/mcp.json
A project’s MCP servers, loaded only once you trust the folder

For project instructions it reads AGENTS.md, CLAUDE.md, GEMINI.md and .github/copilot-instructions.md from the repository root and the current directory, so a repository already set up for another agent works as it is (the AGENTS.md guide covers the format).

GitHub’s own MCP server is built in. To add another, use /mcp add in a session, which opens a form, or the command line:

copilot mcp add playwright -- npx @playwright/mcp@latest           # a local server
copilot mcp add --transport http my-server https://example.com/mcp  # a remote one
Copied

Both write to ~/.copilot/mcp-config.json, under a top-level mcpServers object with a type of local or http and a tools list that defaults to ["*"], all of the server’s tools.

Run it non-interactively

-p runs one prompt and exits, and -s prints only the agent’s answer, without the usage summary:

copilot -p "Summarise what changed on this branch" -s
copilot -p "Summarise what changed on this branch" --output-format json   # JSONL, one object per line
Copied

With no one there to answer an approval prompt, a script grants its permissions on the command line: --allow-tool for named tools, --deny-tool to rule some out (deny wins), and --allow-all-tools, which the reference describes as “blanket tool permissions without a model safety review or individual approval prompts.” With it, GitHub warns, Copilot “can run any shell commands that you can run” and reach every file you can, without asking. --allow-all and --yolo go further and also lift the checks on paths and URLs. Use any of the three only on a machine and a checkout you would be content to lose. --no-ask-user stops it pausing to ask you a question.

A -p run exits non-zero if it is interrupted or the model returns an empty final answer, and its summary prints a copilot --resume=SESSION-ID line for picking the session up later; --continue resumes the latest one in the current directory, or the latest anywhere if there is none. An interactive session on a server ends when your SSH connection drops, so start it inside tmux.

One thing that sounds like a server mode is not: the container image ghcr.io/github/copilot-cli runs Copilot CLI as a server for apps built on the Copilot SDK, and GitHub says it is not meant for interactive terminal use.

Copilot CLI, Claude Code and Codex

The three do the same job in the same place, and the main difference is whose plan and whose models you work through. As of November 28, 2026:

Copilot CLIClaude CodeCodex CLI
Made by
GitHubAnthropicOpenAI
Models
Several labs’, Claude and GPT among themClaudeOpenAI’s
Plan that includes it
Any Copilot plan, Free includedPro, Max, Ultra, Team, Enterprise or a Console account; not the free planChatGPT Plus, Pro, Business, Edu or Enterprise, or an API key
Source
ClosedClosedOpen, Apache-2.0
Install
npm install -g @github/copilotcurl -fsSL https://claude.ai/install.sh | bashnpm install -g @openai/codex
Headless sign-in
Device code, or a fine-grained tokenSee the install guideSee the install guide

If you already pay for Copilot, the CLI costs nothing more and gives you Claude and GPT models under one bill, measured in GitHub’s credits. If you pay Anthropic or OpenAI, their own agent uses that plan directly: the Claude Code install guide and the Codex CLI install guide cover each, sign-in on a server included, and Claude Code alternatives sets Copilot CLI beside OpenCode, Gemini CLI, Aider and the rest. How the rest of Copilot (its cloud agent and code review) compares with Claude Code is in Claude Code vs GitHub Copilot.

Run Claude Code, Codex, OpenCode, Pi, Hermes or OpenClaw on an always-on developer pod.

A developer pod is a permanent cloud computer (VPS), set up and secured for you, with your pick of Claude Code, Codex, OpenCode, Pi, Hermes and OpenClaw installed. Run more agents at once than your laptop can hold, and keep them working when it’s closed. From $24 a month, built in about ten minutes.