Install and Configure GitHub Copilot CLI
About GitHub Copilot CLI
Section titled “About GitHub Copilot CLI”GitHub Copilot CLI is GitHub’s terminal-native AI assistant, allowing you to use Copilot directly from the command line.
Note: GitHub Copilot CLI is currently in Public Preview and may change over time.
Scope and Verification Date
Section titled “Scope and Verification Date”- Target: GitHub Copilot CLI (command-line version, not IDE plugin)
- Last Verified: 2026-03-09
- Official install guide: Installing GitHub Copilot CLI
Prerequisites
Section titled “Prerequisites”| Check Item | Minimum Requirement | How to Verify |
|---|---|---|
| Copilot access | Active Copilot subscription or assigned org seat | Sign in to GitHub and confirm Copilot availability |
| Windows environment | PowerShell 6+ (if on Windows) | pwsh --version |
| Node.js (npm method) | Node.js 22+ | node --version |
| npm (npm method) | npm 10+ | npm --version |
| Network access | Reachable GitHub and Copilot services | Open github.com in browser |
If you use Copilot through an organization/enterprise, admins may disable Copilot CLI by policy.
Installation Steps
Section titled “Installation Steps”Use any one method below.
Method A: npm (Cross-platform, recommended)
Section titled “Method A: npm (Cross-platform, recommended)”npm install -g @github/copilotVerify installation:
copilot --versionMethod B: WinGet (Windows)
Section titled “Method B: WinGet (Windows)”winget install GitHub.CopilotMethod C: Homebrew (macOS / Linux)
Section titled “Method C: Homebrew (macOS / Linux)”brew install copilot-cliMethod D: Install script (macOS / Linux)
Section titled “Method D: Install script (macOS / Linux)”curl -fsSL https://gh.io/copilot-install | bashPost-install Configuration
Section titled “Post-install Configuration”1) First-time authentication
Section titled “1) First-time authentication”Start the CLI:
copilotIn your first session, run /login and complete authentication in your browser.
2) Optional token-based authentication
Section titled “2) Optional token-based authentication”You can also use a fine-grained token with Copilot Requests permission via:
GH_TOKENGITHUB_TOKEN
3) First availability check
Section titled “3) First availability check”copilotAsk a simple prompt (for example, “explain this project’s structure”) to verify end-to-end functionality.
Common Troubleshooting
Section titled “Common Troubleshooting”| Symptom | Possible Cause | Resolution |
|---|---|---|
copilot command not found | Global install path missing from PATH | Restart terminal; verify npm global bin is in PATH |
| Login fails or hangs | Browser session issue or restricted network | Run /login again; check proxy/network; retry on stable network |
| Copilot CLI not available | Subscription missing or org policy disabled | Verify plan status; ask org admin to enable Copilot CLI |
| npm install script error | ignore-scripts=true in npm config | Run npm_config_ignore_scripts=false npm install -g @github/copilot |
Quick recovery flow
Section titled “Quick recovery flow”- Run
copilot --version. - Run
copilotand retry/login. - Retry from a network that can reach GitHub services.
- If needed, reinstall using another method (npm vs brew/winget).
See official docs: Installing GitHub Copilot CLI