GitHub Copilot CLI is GitHub’s coding agent for the terminal: you install the copilot command, sign in with your GitHub account, and ask it to edit code, run commands and work with issues and pull requests. It needs an active Copilot subscription, and it asks before running tools that change or execute files unless you approve them up front.
Applies to: GitHub Copilot CLI 1.0.95 (released October 9, 2026) and GitHub Docs as of October 10, 2026. Last checked: October 10, 2026.
On this page
What GitHub Copilot CLI does
GitHub describes the CLI as a way to use Copilot “directly from your terminal” to answer questions, write and debug code, and interact with GitHub.com, for example by making changes to a project and opening a pull request (About GitHub Copilot CLI). It runs on Linux, macOS, and Windows from PowerShell or WSL.
The docs list two kinds of work:
- Local tasks: change code in the current project, explain a file’s history, improve docs, run Git operations, or scaffold a new app.
- GitHub.com tasks: list your open pull requests, start work on an assigned issue in a new branch, open issues and pull requests, review the changes in a pull request, or create a GitHub Actions workflow.
Pull requests the CLI creates are opened on your behalf, with you as the author.
Before you install
GitHub’s install guide lists two prerequisites:
- an active GitHub Copilot subscription (see the plans tracker for current Copilot plans);
- on Windows, PowerShell v6 or higher.
If you get Copilot through an organization or enterprise, the CLI is unavailable when an owner or administrator has disabled it in their settings.
Each interaction in the CLI uses AI credits based on the tokens processed, and the amount varies by model (About GitHub Copilot CLI). How those credits work per plan is covered in GitHub Copilot AI credits.
Install GitHub Copilot CLI
GitHub documents four install routes. The commands below are copied from the install guide.
npm (all platforms, Node.js 22 or later):
npm install -g @github/copilot
If your ~/.npmrc sets ignore-scripts=true, GitHub says to use:
npm_config_ignore_scripts=false npm install -g @github/copilot
WinGet (Windows):
winget install GitHub.Copilot
Homebrew (macOS and Linux):
brew install --cask copilot-cli
Install script (macOS and Linux):
curl -fsSL https://gh.io/copilot-install | bash
The script installs to $HOME/.local for a non-root user and /usr/local as root. Set PREFIX to choose another directory and VERSION to pin a release. Prerelease builds are available as @github/copilot@prerelease on npm, GitHub.Copilot.Prerelease on WinGet and copilot-cli@prerelease on Homebrew. Executables can also be downloaded from the github/copilot-cli releases page.
To update an existing install, the command reference lists:
copilot update
copilot version shows the installed version and checks for updates.
Sign in
On first launch, if you are not signed in, the CLI prompts you to use the /login slash command. From the shell, the command reference documents copilot login:
# Authenticate with github.com
copilot login
# Force the device code flow, for example on a remote terminal
copilot login --device-code
On a local terminal the default is a browser sign-in. Over SSH, in Codespaces, in a dev container or in CI, the CLI defaults to the device code flow. Use --host to sign in to a GitHub Enterprise Cloud instance with data residency.
After sign-in the token goes into the system credential store. If no credential store is found, GitHub says the token is stored in a plain-text configuration file under ~/.copilot/ (or COPILOT_HOME if set).
For headless use, the CLI reads a token from COPILOT_GITHUB_TOKEN, GH_TOKEN or GITHUB_TOKEN, in that order. GitHub supports fine-grained personal access tokens with the Copilot Requests permission (created under your personal account, not an organization) and OAuth tokens from the Copilot CLI or GitHub CLI apps. Classic ghp_ tokens are not supported.
Interactive and programmatic modes
Type copilot in a project directory to start an interactive session. Inside it, Shift+Tab cycles between the default ask/execute mode and plan mode, in which Copilot asks clarifying questions and builds a structured plan before writing code (About GitHub Copilot CLI).
For a single task that exits when done, pass a prompt with -p or --prompt. GitHub’s example limits the run to Git commands:
copilot -p "Show me this week's commits and summarize them" --allow-tool='shell(git)'
Other things the docs describe inside a session:
/compactcompresses the conversation on demand; the CLI also compacts automatically near 95% of the token limit./contextshows a token usage breakdown./model(or--modelon the command line) changes the model.copilot initsets up custom instructions for the repository. File locations are covered in Copilot custom instructions.copilot mcpmanages MCP servers;/mcplists configured servers in a session. Servers with setup snippets are in the MCP directory.- Hooks run shell commands at points in the agent’s work; see Copilot hooks.
Trusted directories and tool approvals
When a session starts, the CLI asks you to confirm that you trust the files in and below the launch directory. GitHub advises launching only from directories you trust and, typically, not from your home directory. It also says the scoping is heuristic and it “does not guarantee that all files outside trusted directories will be protected.”
The first time Copilot wants a tool that can modify or execute files, such as touch, chmod, node or sed, it offers three choices: allow once, allow that tool for the rest of the session, or decline and tell Copilot what to do instead. GitHub’s example of the session-wide option: approving rm ./this-file.txt that way lets Copilot run any rm command, including rm -rf ./*, for the rest of that session.
Three flags set approvals in advance (About GitHub Copilot CLI):
--allow-toolallows a specific tool, such as'shell(git)','write'or an MCP server name.--deny-toolblocks a tool and takes precedence over both allow options.--allow-all-toolsallows every tool without asking.
Warning
GitHub says that with an automatic approval option such as
--allow-all-tools, “Copilot has the same access as you do to files on your computer, and can run any shell commands that you can run, without getting your prior approval.”GitHub also lists in-session slash commands such as
/allow-alland/yolofor granting permissions; treat them with the same care.
Safer alternatives GitHub documents:
- Allow only what the task needs with
--allow-tool, and keep destructive commands blocked with--deny-tool:
copilot --allow-all-tools --deny-tool='shell(rm)' --deny-tool='shell(git push)'
- Turn on local sandboxing inside a session with
/sandbox enable, which restricts filesystem, network and system access (public preview). - Run the whole session in a cloud sandbox with
copilot --cloud(public preview). - Use a virtual machine, container or dedicated system with tightly controlled permissions and network access.
For Copilot Business and Enterprise users, the CLI respects content exclusion policies, so excluded files are not used as context. GitHub notes the CLI cannot yet apply the organization policies that turn MCP servers on or off or restrict the MCP registry URL.
What changed in recent releases
The releases page shows version 1.0.94 on October 8, 2026 adding Claude Haiku 5.5 to model selection and letting managed policy disable Assisted Permissions so sessions stay in Manual Approval mode. Version 1.0.95 on October 9, 2026 added native Microsoft Entra broker sign-in on macOS when available, with a browser fallback, and made --context apply to new and resumed ACP sessions.





