Copilot CLI
GitHub Copilot CLI puts an agentic coding assistant in the terminal: interactive sessions, one-shot -p prompts, and Issue / PR workflows. Official pages:
- Getting started with GitHub Copilot CLI
- Installing GitHub Copilot CLI
- Product: github.com/features/copilot/cli
You need a valid Copilot entitlement. If an org disabled the CLI, sign-in alone will not help. Commands, slash verbs, and package names follow copilot help / /help on the day you install.
Requirements
In PowerShell 7:
macOS:
Install
npm (all platforms, Node 22+):
If ~/.npmrc has ignore-scripts=true, GitHub requires:
Windows (WinGet):
macOS / Linux (Homebrew):
macOS / Linux (script):
Use | sudo bash to install into /usr/local/bin. Custom prefix: PREFIX. Pin a version: VERSION. You can also download binaries from github/copilot-cli releases.
Verify:
If Windows cannot find the command, open a new terminal and confirm WinGet’s shim directory is on PATH.
First interactive session
Start inside the project directory so the CLI can see the repo:
- If you are not logged in, run
/loginand finish device / browser GitHub auth. - Confirm you trust the current directory for an AI tool. GitHub notes Copilot will not change files without explicit approval.
- Try:
Give me an overview of this project.
You may instead export a fine-grained PAT with Copilot Requests, using COPILOT_GITHUB_TOKEN, GH_TOKEN, or GITHUB_TOKEN (that precedence). Never commit the token.
Shortcuts and slash commands
From the getting-started guide:
Full list: /help in a session, or copilot help in the shell. Docs also mention /plan, /pr, /fleet, /research—trust help for your CLI version, not a memorized list.
Non-interactive: -p and scripts
Skip the TUI (good for scripts):
Response only, without extra usage chrome:
More flags: copilot help. For GitHub Actions, follow Running GitHub Copilot CLI programmatically and Using Copilot CLI in GitHub Actions with GITHUB_TOKEN. Do not print a personal PAT in workflow logs.
How it splits with the IDE / Cursor
- CLI: SSH, CI, keyboard-only, or terminal GitHub flows such as
/pr - VS Code Chat: watching diffs and clicking files
- Cursor: AI-native editor—see comparison
You can install Copilot CLI and Cursor’s agent on the same machine; do not let two agents write the same workspace without commits—the merge pain is yours. On Windows, set the default terminal to PowerShell 7 so the CLI does not land in Windows PowerShell 5.1.