GitHub Copilot CLI
AI-powered coding assistant in the terminal. Uses the same agentic engine as GitHub's Copilot coding agent.
Install
Install a specific version to a custom path:
Launch & authenticate
On first launch, use /login to authenticate with GitHub. You need an active Copilot subscription.
You can also authenticate via a fine-grained PAT with the "Copilot Requests" permission, exported as GH_TOKEN or GITHUB_TOKEN.
Keyboard shortcuts
| Shortcut | Action |
|---|---|
| Shift+Tab | Cycle modes (interactive β plan) |
| Ctrl+S | Run command while preserving input |
| Ctrl+T | Toggle model reasoning display |
| Ctrl+C | Cancel / clear input / copy selection |
| Ctrl+C Γ2 | Exit the CLI |
| Ctrl+D | Shutdown |
| Ctrl+L | Clear screen |
| Ctrl+G | Edit prompt in external editor |
| Up Down | Navigate command history |
@ | Mention files, include contents in context |
! | Execute command in your local shell (bypass Copilot) |
Slash commands
Session
| Command | Description |
|---|---|
/model | Select AI model |
/diff | Review changes in current directory |
/compact | Summarize history to reduce context usage |
/context | Show token usage |
/rewind | Rewind last turn, revert file changes |
/resume | Switch to a different session |
/share | Export session to markdown or GitHub gist |
/clear | Clear conversation history |
Code & GitHub
| Command | Description |
|---|---|
/pr | Operate on pull requests for current branch |
/review | Run code review agent |
/delegate | Send session to GitHub to create a PR |
/research | Deep research using GitHub search & web |
/plan | Create an implementation plan before coding |
/ide | Connect to an IDE workspace |
Config
| Command | Description |
|---|---|
/init | Initialize Copilot instructions for the repo |
/mcp | Manage MCP server configuration |
/lsp | Manage language server configuration |
/allow-all | Enable all permissions (tools, paths, URLs) |
/add-dir | Add a directory to the allowed list |
/experimental | Toggle experimental features |
Plan mode
Plan mode lets you structure an implementation before writing any code. Models achieve higher success rates when following a concrete plan.
Activate plan mode
- Shift+Tab to toggle between normal mode and plan mode
- Or use
/plandirectly from normal mode:
What happens
- Copilot analyzes the request and the codebase
- Asks clarifying questions to align on requirements
- Creates a structured plan with checkboxes in
plan.md - Waits for your approval before implementing
You can edit the plan with Ctrl+Y before starting implementation.
Recommended workflow
When to use /plan
| Situation | /plan ? |
|---|---|
| Multi-file feature | β |
| Refactoring with many touch points | β |
| Complex new feature | β |
| Quick bug fix | β |
| Single file change | β |
Rule of thumb
The bigger the task, the more useful the plan. For a one-liner, /plan is overkill.
Fleet mode
Fleet mode lets Copilot break a complex task into subtasks executed in parallel by subagents. Each subagent has its own context window.
Usage
Prefix your prompt with /fleet:
How it works
- The main agent analyzes the prompt and identifies independent subtasks
- It orchestrates subagents, each working on its part in parallel
- Results are gathered once all subagents are done
When to use /fleet
| Situation | /fleet ? |
|---|---|
| Refactoring multiple independent files | β |
| Creating test suites for multiple modules | β |
| Multi-component migration | β |
| Sequential task (each step depends on the previous one) | β |
Combining with plan + autopilot
The most powerful workflow for large tasks:
- Shift+Tab β plan mode, create the implementation plan
- Notice the plan has parallelizable elements
- Select Accept plan and build on autopilot + /fleet
Premium request consumption
Each subagent interacts independently with the LLM. /fleet may therefore consume more premium requests than sequential processing. Check your quota with /usage.
Choose model per subtask
By default subagents use a lightweight model. You can specify a model in the prompt:
Custom instructions
Copilot reads instructions from these files (in order):
CLAUDE.md,GEMINI.md,AGENTS.md(in git root & cwd).github/instructions/**/*.instructions.md.github/copilot-instructions.md$HOME/.copilot/copilot-instructions.md
MCP servers
Copilot ships with GitHub's MCP server by default. Add custom MCP servers via /mcp or by editing the config directly.
LSP support
Copilot CLI supports Language Server Protocol for code intelligence (go-to-definition, hover, diagnostics). Servers are not bundled β install them separately.
Config at user level (~/.copilot/lsp-config.json) or repo level (.github/lsp.json):