Skip to content

Commit d658868

Browse files
committed
Refine README.md for GitHub Copilot CLI: update terminology, enhance clarity, and improve model selection details
1 parent f502250 commit d658868

File tree

1 file changed

+45
-27
lines changed

1 file changed

+45
-27
lines changed

Using-GitHub-Copilot-CLI/README.md

Lines changed: 45 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@
44

55
Welcome to a hands-on, multi-module course that takes GitHub Copilot beyond the editor and directly into your terminal as a fully autonomous coding agent. The GitHub Copilot CLI is a standalone AI-powered tool — separate from the `gh` extension — that opens an interactive chat session in your terminal, understands your local codebase, and can plan and execute complex multi-step coding tasks on your behalf.
66

7-
Prepare for a practical, end-to-end experience! You will install the new `copilot` CLI, master its interactive and programmatic interfaces (including plan mode and autopilot mode), control tool permissions, manage conversation context, integrate with GitHub.com, select models, configure custom agents, and combine everything into a real-world development workflow.
7+
Prepare for a practical, end-to-end experience! You will install the new `copilot` CLI, master its interactive and programmatic interfaces (including plan mode and auto model selection), control tool permissions, manage conversation context, integrate with GitHub.com, select models, configure custom agents, and combine everything into a real-world development workflow.
88

99
</header>
1010

1111

1212
- **Who this is for**: Developers, DevOps Engineers, Platform Engineers, Software Development Managers, Testers.
13-
- **What you'll learn**: How to install and use the standalone GitHub Copilot CLI, leverage its interactive/plan/autopilot modes, control tool approval, manage context, interact with GitHub.com, select AI models, configure custom agents, and use `gh agent-task` for remote agent tasks.
13+
- **What you'll learn**: How to install and use the standalone GitHub Copilot CLI, leverage its interactive and plan modes, use Auto model selection, control tool approval, manage context, interact with GitHub.com, select AI models, configure custom agents, and use `gh agent-task` for remote agent tasks.
1414
- **What you'll build**: A real-world CLI-driven workflow covering project analysis, debugging, refactoring, test generation, and agent-assisted automation using MCP integrations.
1515
- **Prerequisites**: GitHub Copilot is available to use for free, sign up for [GitHub Copilot](https://gh.io/copilot). Basic familiarity with a terminal and Git is recommended.
1616
- **Timing**: This module can be completed in under 90 minutes.
1717

1818
By the end of this module, you'll acquire the skills to be able to:
1919

2020
- Install, authenticate, and launch the standalone GitHub Copilot CLI.
21-
- Use interactive mode, plan mode, and autopilot mode.
21+
- Use interactive mode and plan mode; let Auto model selection choose the optimal model.
2222
- Control tool approval with `--allow-tool`, `--deny-tool`, and `--allow-all-tools`.
2323
- Manage conversation context with `/compact`, `/context`, and auto-compaction.
2424
- Interact with GitHub.com natively — list PRs, work on issues, and create pull requests from the terminal.
@@ -56,11 +56,32 @@ This workshop uses a sample project that contains a backend API and a frontend w
5656
- Authenticate and launch your first session
5757
- Understand the difference between the new `copilot` CLI and the deprecated `gh copilot` extension
5858

59-
The **GitHub Copilot CLI** (`copilot`) is a standalone terminal application — distinct from the old `gh copilot` extension — that opens a full interactive AI chat session in your terminal. It ships with the GitHub MCP server built in, supports plan and autopilot modes, and can autonomously read files, run commands, and interact with GitHub.com on your behalf.
59+
The **GitHub Copilot CLI** (`copilot`) is a standalone terminal application — distinct from the old `gh copilot` extension — that opens a full interactive AI chat session in your terminal. It ships with the GitHub MCP server built in, supports plan mode and auto model selection, and can autonomously read files, run commands, and interact with GitHub.com on your behalf.
6060

6161
> **Note**: The `gh extension install github/gh-copilot` extension was deprecated in September 2025 and archived at v1.2.0. This workshop uses the new standalone `copilot` CLI.
6262
63-
#### Installing the CLI
63+
#### Prerequisites
64+
65+
This workshop uses two separate CLI tools:
66+
67+
- **`copilot`** — the standalone GitHub Copilot CLI (installed below)
68+
- **`gh`** — the GitHub CLI, required for `gh agent-task` commands in Sections 4 and 6
69+
70+
Install `gh` first if you don't already have it:
71+
72+
**Windows:**
73+
```powershell
74+
winget install GitHub.CLI
75+
```
76+
**macOS / Linux:**
77+
```bash
78+
brew install gh
79+
```
80+
Then authenticate: `gh auth login`
81+
82+
---
83+
84+
#### Installing the Copilot CLI
6485

6586
1. Choose the installation method for your platform:
6687

@@ -133,7 +154,7 @@ In the above exercises we achieved the following:
133154
🎯 **Learning Goals**
134155
- Use the default ask/execute mode for general coding tasks
135156
- Switch to plan mode to build a structured implementation plan before writing code
136-
- Enable experimental autopilot mode for fully autonomous task completion
157+
- Enable Auto model selection to reduce rate limiting and simplify model management
137158
- Navigate the interactive interface using slash commands
138159

139160
The GitHub Copilot CLI interactive session (launched with `copilot`) offers three modes. You cycle between them with `Shift+Tab`.
@@ -194,42 +215,40 @@ Plan mode is ideal for larger or less well-defined tasks. Instead of immediately
194215

195216
Once you are satisfied, confirm the plan and Copilot will execute each step sequentially, requesting tool approval as needed.
196217

197-
#### Autopilot Mode (Experimental)
218+
#### Auto Model Selection
198219

199-
Autopilot mode encourages Copilot to continue working until the task is fully complete, with minimal interruption. It is available after enabling experimental mode.
220+
Instead of manually picking a model every session, you can let Copilot automatically choose the best available model on your behalf. This reduces rate limiting and removes the mental overhead of model selection. Auto model selection is available on all Copilot plans.
200221

201-
7. Enable experimental mode. You can do this at any time from within an active session:
222+
7. Open the model picker and choose **Auto**:
202223

203224
```
204-
/experimental
225+
/model
205226
```
206227

207-
This setting is persisted in your config, so you only need to do this once. Alternatively, launch with the flag:
228+
Select **Auto** from the list. With Auto enabled, Copilot picks from a pool of 1× multiplier models — currently GPT-4.1, GPT-5 mini, GPT-5.2-Codex, GPT-5.3-Codex, Claude Haiku 4.5, and Claude Sonnet 4.5 — subject to your organisation's policies and your subscription. The pool changes over time as new models become available.
208229

209-
```bash
210-
copilot --experimental
211-
```
230+
> **Note**: Auto will never select models excluded by administrator policy, models with a premium multiplier greater than 1×, or models unavailable on your plan.
212231
213-
8. Press `Shift+Tab` to cycle to **Autopilot** mode.
232+
<div align="left">
233+
<img src="./images/005-auto-model.jpg" alt="/model picker with Auto selected in the Copilot CLI">
234+
</div>
214235

215-
9. Give Copilot a self-contained task and let it run to completion:
236+
8. To see which model handled a response, check the CLI output — the model used is reported alongside each reply.
216237

217-
```
218-
Add pagination (page and pageSize query parameters) to the /weatherforecast endpoint, update the OpenAPI spec, and add xUnit tests covering edge cases.
219-
```
238+
9. Override Auto at any time by picking a specific model from `/model`, or set one at launch:
220239

221-
Copilot will work through the task, running tests and self-correcting until all tests pass — similar to Agent Mode in VS Code.
240+
```bash
241+
copilot --model claude-sonnet-4.6
242+
```
222243

223-
<div align="left">
224-
<img src="./images/005-autopilot-mode.jpg" alt="Copilot CLI autopilot mode running autonomously and self-correcting test failures">
225-
</div>
244+
> **Paid plan tip**: When using Auto on a paid plan (Pro, Pro+, Business, Enterprise), qualifying models receive a **10% multiplier discount** compared to selecting the same model manually.
226245
227-
> **Caution**: Each prompt in Autopilot mode reduces your monthly premium request quota. Use well-scoped prompts to avoid excessive consumption.
246+
> **Coding agent note**: Auto model selection for `gh agent-task` (Copilot coding agent) is generally available for **Pro and Pro+ plans only** and currently selects from Claude Sonnet 4.5.
228247
229248
In the above exercises we achieved the following:
230249
- ✅ Used default mode for interactive ask/execute tasks
231250
- ✅ Used plan mode to design a multi-step implementation before writing code
232-
- ✅ Enabled and used autopilot mode for autonomous task completion
251+
- ✅ Enabled Auto model selection to reduce rate limiting and simplify model management
233252

234253
---
235254

@@ -750,7 +769,7 @@ The complete workflow you just executed maps to a repeatable pattern for any fea
750769
|---|---|---|
751770
| Explore | Copilot CLI (default mode) | Map affected files with natural language |
752771
| Design | Copilot CLI (plan mode) | Build and review a structured implementation plan |
753-
| Build & test | Copilot CLI (default/autopilot mode) | Implement, run tests, self-correct |
772+
| Build & test | Copilot CLI (default/plan mode) | Implement, run tests, self-correct |
754773
| Context | `/context` + `/compact` | Monitor and manage token usage |
755774
| Ship | GitHub.com integration | Commit and open PR from the terminal |
756775
| Polish | `gh agent-task` | Async documentation via remote agent |
@@ -774,7 +793,6 @@ In the above exercises we achieved the following:
774793
- [Using GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/use-copilot-cli)
775794
- [Responsible use of GitHub Copilot CLI](https://docs.github.com/en/copilot/responsible-use/copilot-cli)
776795
- [GitHub Copilot CLI changelog](https://github.com/github/copilot-cli/blob/main/changelog.md)
777-
- [GitHub Copilot Coding Agent](https://docs.github.com/en/copilot/using-github-copilot/using-copilot-coding-agent-to-work-on-tasks/about-assigning-tasks-to-copilot)
778796
- [gh agent-task command reference](https://cli.github.com/manual/gh_agent-task)
779797
- [Model Context Protocol (MCP) overview](https://modelcontextprotocol.io/introduction)
780798
- [GitHub MCP Server](https://github.com/github/github-mcp-server)

0 commit comments

Comments
 (0)