GitHub Copilot CLI brings the power of AI directly to your command line
Instead of typing complex commands, just describe what you want to do in plain English. Copilot CLI understands your request and helps you build it.
Paste error messages or describe your bug. Copilot CLI analyzes your code and suggests fixes without you having to search Stack Overflow.
Ask questions about how code works, why something might be slow, or how to improve it. Get instant explanations right in your terminal.
Let Copilot CLI help you clean up code, improve structure, or modernize outdated patterns. Always review changes before accepting them.
Directly access your repositories, pull requests, and issues. No context switching needed.
Work entirely in your terminal without leaving your command line environment.
Preview every change before execution. You decide what gets applied to your code.
Choose from Claude Sonnet 4.5, Claude Sonnet 4, or GPT-5 based on your needs.
Works on Linux, macOS, and Windows with full feature parity.
Extend capabilities with custom MCP servers for specialized tasks.
Choose your preferred installation method
Using Homebrew (easiest):
brew install copilot-cli
Or using the install script:
curl -fsSL https://gh.io/copilot-install | bash
Using WinGet (fastest):
winget install GitHub.Copilot
Using the install script:
curl -fsSL https://gh.io/copilot-install | bash
Or with sudo for system-wide installation:
curl -fsSL https://gh.io/copilot-install | sudo bash
Works on macOS, Linux, and Windows:
npm install -g @github/copilot
Open your terminal and type:
copilot
If this is your first time, you'll be asked to login. Type:
/login
Follow the instructions to authenticate with your GitHub account.
You're ready! Try asking something like:
How do I create a React component?
Common commands to get the most out of Copilot CLI
Authenticate with your GitHub account
Choose which AI model to use (Claude, GPT, etc.)
Create a step-by-step implementation plan
Get code review and suggestions for improvements
Start a fresh conversation (clear history)
Change your working directory
See how much of your AI budget you're using
Get help about available commands
Mention files to include in context (@filename)
Execute shell commands directly in terminal
Cancel operation or clear input
Exit Copilot CLI
Good: "Create a React component that displays a list of users with a search filter"
Avoid: "Make a component"
Use @file to include relevant files so Copilot understands your codebase structure.
Always review suggested code changes before applying them. Copilot is powerful but not perfect.
Don't hesitate to ask clarifying questions or request modifications. The conversation is interactive.
Ask Copilot to explain code it generates. Use it as a learning tool, not just a code generator.
Use /context to monitor your premium request quota. Each prompt uses one request.
Yes, you need an active GitHub Copilot subscription. You can get it through GitHub's subscription plans. If your organization provides Copilot, check if your admin has enabled CLI access.
Yes! Copilot CLI works with any programming language. It's trained on code from Python, JavaScript, Java, C++, Go, Rust, and many more languages.
Code you share with Copilot CLI (through @ mentions or pasting) is sent to GitHub's servers to process. Review GitHub's privacy policies for details on how this data is handled.
No, Copilot CLI requires an internet connection to communicate with GitHub's servers where the AI models run.
Type /help in Copilot CLI to see all available commands. You can also use /feedback to report issues or suggest improvements.
Copilot CLI uses your GitHub Copilot subscription. Each prompt counts as one premium request. Check GitHub's pricing page for subscription costs.