Bringing the power of GitHub Copilot directly to your terminal for agentic workflows.
The GitHub Copilot CLI allows you to use Copilot directly from your terminal. It acts as a powerful AI agent that can answer questions, write and debug code, and interact with GitHub.com.
Supported OS: Linux, macOS, Windows (Powershell/WSL).
Command: copilot
The default mode where you can have a conversation with Copilot, prompt it to answer questions, or perform tasks iteratively.
Activation: Press Shift+Tab in interactive mode.
Copilot analyzes your request, asks clarifying questions, and builds a structured implementation plan before writing code. This is crucial for complex, multi-step tasks to prevent errors.
Command: copilot -p "Your prompt"
Pass a single prompt directly from the command line. Useful for scripting or quick one-off tasks.
copilot -p "Summarize this week's commits" --allow-tool 'shell(git)'
Copilot CLI supports several ways to extend its capabilities:
/mcp to manage.Copilot CLI asks you to trust the specific directory you are working in. Only launch it from safe locations.
When Copilot needs to execute a command (like rm or git), it asks for permission:
Automation Flags: Use --allow-tool 'shell(git)' or --allow-all-tools (Use with caution!) for headless operation.
/compact manually or /context to view usage./model.