You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/src/content/docs/learning-hub/cli-for-beginners/01-setup-and-first-steps.md
+42-9Lines changed: 42 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: '01 · First Steps'
3
3
description: 'Experience your first GitHub Copilot CLI demos and learn the three main interaction modes.'
4
4
authors:
5
5
- GitHub Copilot Learning Hub Team
6
-
lastUpdated: 2026-03-20
6
+
lastUpdated: 2026-04-17
7
7
---
8
8
9
9

@@ -280,16 +280,22 @@ Notice how each prompt builds on the previous answer. You're having a conversati
280
280
281
281
**Best for**: Complex tasks where you want to review the approach before execution. Similar to planning a route before a trip using GPS.
282
282
283
-
Plan mode helps you create a step-by-step plan before writing any code. Use the `/plan` command or press **Shift+Tab** to cycle into Plan Mode:
284
-
285
-
> 💡 **Tip**: **Shift+Tab** cycles between modes: Interactive → Plan → Autopilot. Press it anytime during an interactive session to switch modes without typing a command.
283
+
Plan mode helps you create a step-by-step plan before writing any code. Use the `/plan` command, press **Shift+Tab** to cycle into Plan Mode:
286
284
287
285
```bash
288
286
copilot
289
287
290
288
> /plan Add a "mark as read"command to the book app
291
289
```
292
290
291
+
> 💡 **Tip**: **Shift+Tab** cycles between modes: Interactive → Plan → Autopilot. Press it anytime during an interactive session to switch modes without typing a command.
292
+
293
+
You can also launch Copilot CLI directly in plan mode using the `--plan` flag:
294
+
295
+
```bash
296
+
copilot --plan
297
+
```
298
+
293
299
**Plan mode output:** (your output may differ)
294
300
295
301
```
@@ -320,7 +326,7 @@ Proceed with implementation? [Y/n]
320
326
321
327
> 💡 **Want something more complex?** Try: `/plan Add search and filter capabilities to the book app`. Plan mode scales from simple features to full applications.
322
328
323
-
> 📚 **Autopilot mode**: You may have noticed Shift+Tab cycles through a third mode called **Autopilot**. In autopilot mode, Copilot works through an entire plan without waiting for your input after each step — like handing a task to a colleague and saying "let me know when you're finished." The typical workflow is plan → accept → autopilot, which means you need to be good at writing plans first. Get comfortable with Interactive and Plan modes, then see the [official docs](https://docs.github.com/copilot/concepts/agents/copilot-cli/autopilot) when you're ready.
329
+
> 📚 **Autopilot mode**: You may have noticed Shift+Tab cycles through a third mode called **Autopilot**. In autopilot mode, Copilot works through an entire plan without waiting for your input after each step — like handing a task to a colleague and saying "let me know when you're finished." The typical workflow is plan → accept → autopilot, which means you need to be good at writing plans first. You can also launch directly into autopilot with `copilot --autopilot`. Get comfortable with Interactive and Plan modes first, then see the [official docs](https://docs.github.com/copilot/concepts/agents/copilot-cli/autopilot) when you're ready.
These commands work in interactive mode. **Start with just these six** - they cover 90% of daily use:
374
+
These commands are great to learn initially as you're getting started with Copilot CLI:
369
375
370
376
| Command | What It Does | When to Use |
371
377
|---------|--------------|-------------|
372
378
|`/help`| Show all available commands | When you forget a command |
379
+
|`/ask`| Ask a quick question without it affecting your conversation history | When you want a quick answer without derailing your current task |
373
380
|`/clear`| Clear conversation and start fresh | When switching topics |
374
381
|`/plan`| Plan your work out before coding | For more complex features |
375
382
|`/research`| Deep research using GitHub and web sources | When you need to investigate a topic before coding |
@@ -378,6 +385,8 @@ These commands work in interactive mode. **Start with just these six** - they co
378
385
379
386
That's it for getting started! As you become comfortable, you can explore additional commands.
380
387
388
+
> 💡 **`/ask` vs regular chat**: Normally every message you send becomes part of the ongoing conversation and affects future responses. `/ask` is an "off the record" shortcut — perfect for quick one-off questions like `/ask What does YAML mean?` without polluting your session context.
389
+
381
390
> 📚 **Official Documentation**: [CLI command reference](https://docs.github.com/copilot/reference/cli-command-reference) for the complete list of commands and flags.
382
391
383
392
<details>
@@ -391,6 +400,7 @@ That's it for getting started! As you become comfortable, you can explore additi
391
400
|---------|--------------|
392
401
|`/init`| Initialize Copilot instructions for your repository |
393
402
|`/agent`| Browse and select from available agents |
403
+
|`/env`| Show loaded environment details — what instructions, MCP servers, skills, agents, and plugins are active |
394
404
|`/skills`| Manage skills for enhanced capabilities |
395
405
|`/mcp`| Manage MCP server configuration |
396
406
@@ -419,12 +429,13 @@ That's it for getting started! As you become comfortable, you can explore additi
419
429
420
430
| Command | What It Does |
421
431
|---------|--------------|
422
-
|`/allow-all`| Auto-approve all permission prompts for this session |
432
+
| `/allow-all [on|off|show]` | Auto-approve all permission prompts; use `on` to enable, `off` to disable, `show` to check current status |
433
+
|`/yolo`| Quick alias for `/allow-all on` — auto-approves all permission prompts. |
423
434
|`/add-dir <directory>`| Add a directory to allowed list |
424
435
|`/list-dirs`| Show all allowed directories |
425
436
|`/cwd`, `/cd [directory]`| View or change working directory |
426
437
427
-
> ⚠️ **Use with caution**: `/allow-all`skips confirmation prompts. Great for trusted projects, but be careful with untrusted code.
438
+
> ⚠️ **Use with caution**: `/allow-all`and `/yolo` skip confirmation prompts. Great for trusted projects, but be careful with untrusted code.
428
439
429
440
### Session
430
441
@@ -553,6 +564,28 @@ After completing the demos, try these variations:
553
564
554
565
---
555
566
567
+
## 💡 Tip: Control Your CLI Session from Web or Mobile
568
+
569
+
GitHub Copilot CLI supports **remote sessions**, letting you monitor and interact with a running CLI session from a web browser (on desktop or mobile) or the GitHub Mobile app without being physically at your terminal.
570
+
571
+
Start a remote session with the `--remote` flag:
572
+
573
+
```bash
574
+
copilot --remote
575
+
```
576
+
577
+
Copilot CLI will display a link and provide access to a QR code. Open the link on your phone or in a desktop browser tab to watch the session in real time, send follow-up prompts, review plans, and steer the agent remotely. Sessions are user-specific so you can only access your own Copilot CLI sessions.
578
+
579
+
You can also enable remote access from inside an active session at any time:
580
+
581
+
```
582
+
> /remote
583
+
```
584
+
585
+
Additional details about remote sessions can be found in the [Copilot CLI docs](https://docs.github.com/copilot/how-tos/copilot-cli/steer-remotely).
586
+
587
+
---
588
+
556
589
## 📝 Assignment
557
590
558
591
### Main Challenge: Improve the Book App Utilities
@@ -629,7 +662,7 @@ The examples used `/plan` for a search feature and `-p` for batch reviews. Now t
629
662
1. **Interactive mode** is for exploration and iteration - context carries forward. It's like having a conversation with someone who remembers what you've said up to that point.
630
663
2. **Plan mode** is normally for more involved tasks. Review before implementation.
631
664
3. **Programmatic mode** is for automation. No interaction needed.
> 📋 **Quick Reference**: See the [GitHub Copilot CLI command reference](https://docs.github.com/en/copilot/reference/cli-command-reference) for a complete list of commands and shortcuts.
@@ -62,7 +62,9 @@ Learn what skills are, why they matter, and how they differ from agents and MCP.
62
62
copilot
63
63
> /skills list
64
64
```
65
-
This shows all skills Copilot can find in your project and personal folders.
65
+
This shows all skills Copilot can find, including any **built-in skills** that ship with the CLI itself, plus skills from your project and personal folders.
66
+
67
+
> 💡 **Built-in skills**: The Copilot CLI comes with skills pre-installed out of the box. For example, the `customizing-copilot-cloud-agents-environment` skill provides a guide for customizing the Copilot cloud agent's environment. You don't need to create or install anything to use these. Run `/skills list` to see what's available.
66
68
67
69
2.**Look at a real skill file:** Check out our provided [code-checklist SKILL.md](https://github.com/github/copilot-cli-for-beginners/blob/main/.github/skills/code-checklist/SKILL.md) to see the pattern. It's just YAML frontmatter plus markdown instructions.
68
70
@@ -552,6 +554,12 @@ copilot
552
554
# Install a plugin from the marketplace
553
555
```
554
556
557
+
To keep your local plugin catalog current, refresh it with:
558
+
559
+
```bash
560
+
copilot plugin marketplace update
561
+
```
562
+
555
563
Plugins can bundle multiple capabilities together - a single plugin might include related skills, agents, and MCP server configurations that work together.
> 💡 **Only seeing the GitHub server?** That's expected! If you haven't added any additional MCP servers yet, GitHub is the only one listed. You'll add more in the next section.
85
85
86
-
> 📚 **Want to see all `/mcp`commands?**There are additional commands for adding, editing, enabling, and deleting servers. See the [full command reference](#-additional-mcp-commands) at the end of this chapter.
86
+
> 📚 **Want to see all MCP management commands?**You can manage servers with `/mcp` slash commands inside chat, or with `copilot mcp` directly from your terminal. See the [full command reference](#-additional-mcp-commands) at the end of this chapter.
87
87
88
88
<details>
89
89
<summary>🎬 See it in action!</summary>
@@ -127,13 +127,31 @@ MCP makes Copilot aware of your actual development environment.
127
127
128
128
<imgsrc="/images/learning-hub/copilot-cli-for-beginners/06/configuring-mcp-servers.png"alt="Hands adjusting knobs and sliders on a professional audio mixing board representing MCP server configuration"width="800"/>
129
129
130
-
Now that you've seen MCP in action, let's set up additional servers. This section covers the configuration file format and how to add new servers.
130
+
Now that you've seen MCP in action, let's set up additional servers. You can add servers in two ways: **from the built-in registry** (easiest — guided setup right in the CLI) or by **editing the config file** manually (more flexible). Start with the registry option if you're not sure which to choose.
131
+
132
+
---
133
+
134
+
## Installing MCP Servers from the Registry
135
+
136
+
The CLI has a built-in MCP server registry that lets you discover and install popular servers with a guided setup — no JSON editing required.
137
+
138
+
```bash
139
+
copilot
140
+
141
+
> /mcp search
142
+
```
143
+
144
+
Copilot opens an interactive picker showing available servers. Select one, and the CLI walks you through any required configuration (API keys, paths, etc.) and adds it to your config automatically.
145
+
146
+
> 💡 **Why use the registry?** It's the easiest way to get started — you don't need to know the npm package name, command arguments, or JSON structure. The CLI handles all of that for you.
131
147
132
148
---
133
149
134
150
## MCP Configuration File
135
151
136
-
MCP servers are configured in `~/.copilot/mcp-config.json` (user-level, applies to all projects) or `.vscode/mcp.json` (project-level, applies to just the current workspace).
152
+
MCP servers are configured in `~/.copilot/mcp-config.json` (user-level, applies to all projects) or `.mcp.json` (project-level, placed in the root of your project). If you used `/mcp search` above, the CLI already created or updated this file for you, but it's useful to understand the format for customization.
153
+
154
+
> ⚠️ **Note**: `.vscode/mcp.json` is no longer supported as an MCP config source. If you have an existing `.vscode/mcp.json`, migrate it to `.mcp.json` in your project root. The CLI will show a migration hint if it detects an old config file.
137
155
138
156
```json
139
157
{
@@ -341,7 +359,7 @@ Here's a full `mcp-config.json` with filesystem and Context7 servers:
341
359
}
342
360
```
343
361
344
-
Save this as `~/.copilot/mcp-config.json` for global access or `.vscode/mcp.json` for project-specific configuration.
362
+
Save this as `~/.copilot/mcp-config.json` for global access or `.mcp.json` in the project root for project-specific configuration.
345
363
346
364
---
347
365
@@ -848,7 +866,7 @@ Ready to go deeper? Follow the [Custom MCP Server Guide](https://github.com/gith
848
866
| Mistake | What Happens | Fix |
849
867
|---------|--------------|-----|
850
868
| Not knowing GitHub MCP is built-in | Trying to install/configure it manually | GitHub MCP is included by default. Just try: "List the recent commits in this repo" |
851
-
| Looking for config in wrong location | Can't find or edit MCP settings | User-level config is in`~/.copilot/mcp-config.json`, project-level is `.vscode/mcp.json`|
869
+
| Looking for config in wrong location | Can't find or edit MCP settings | User-level config is in`~/.copilot/mcp-config.json`, project-level is `.mcp.json`in the project root|
852
870
| Invalid JSON in config file | MCP servers fail to load | Use `/mcp show` to check configuration; validate JSON syntax |
853
871
| Forgetting to authenticate MCP servers |"Authentication failed" errors | Some MCPs need separate auth. Check each server's requirements |
854
872
@@ -891,19 +909,41 @@ If a server is disabled, see the [additional `/mcp` commands](#-additional-mcp-c
891
909
---
892
910
893
911
<details>
894
-
<summary>📚 <strong>Additional <code>/mcp</code> Commands</strong> (click to expand)</summary>
912
+
<summary>📚 <strong>Additional MCP Commands</strong> (click to expand)</summary>
895
913
<a id="-additional-mcp-commands"></a>
896
914
897
-
Beyond `/mcp show`, there are several other commands for managing your MCP servers:
915
+
You can manage MCP servers in two ways: using **slash commands inside a chat session**, or using the **`copilot mcp`command directly in your terminal** (no chat session needed).
916
+
917
+
### Option 1: Slash commands (inside a chat session)
918
+
919
+
These work when you're already inside `copilot`:
898
920
899
921
| Command | What It Does |
900
922
|---------|--------------|
901
923
| `/mcp show` | Show all configured MCP servers and their status |
902
924
| `/mcp add` | Interactive setup for adding a new server |
903
925
| `/mcp edit <server-name>` | Edit an existing server configuration |
904
-
|`/mcp enable<server-name>`| Enable a disabled server |
905
-
|`/mcp disable <server-name>`|Temporarily disable a server |
926
+
| `/mcp enable <server-name>` | Enable a disabled server (persists across sessions) |
927
+
| `/mcp disable <server-name>` | Disable a server (persists across sessions) |
906
928
| `/mcp delete <server-name>` | Remove a server permanently |
929
+
| `/mcp auth <server-name>` | Re-authenticate with an MCP server that uses OAuth (e.g., after switching accounts) |
930
+
931
+
### Option 2: `copilot mcp` command (from your terminal)
932
+
933
+
You can also manage MCP servers directly from your terminal without starting a chat session first:
934
+
935
+
```bash
936
+
# List all configured MCP servers
937
+
copilot mcp list
938
+
939
+
# Enable a server
940
+
copilot mcp enable filesystem
941
+
942
+
# Disable a server
943
+
copilot mcp disable context7
944
+
```
945
+
946
+
> 💡 **When to use which?** Use `/mcp` slash commands when you're already in a chat session. Use `copilot mcp` from the terminal when you want to quickly check or change your server settings before starting a session.
907
947
908
948
For most of this course, `/mcp show` is all you need. The other commands become useful as you manage more servers over time.
909
949
@@ -919,7 +959,7 @@ For most of this course, `/mcp show` is all you need. The other commands become
919
959
2. **GitHub MCP is built-in** - no configuration needed, just `/login`
920
960
3. **Filesystem and Context7** are configured via `~/.copilot/mcp-config.json`
921
961
4. **Multi-server workflows** combine data from multiple sources in a single session
922
-
5. **Check server status** with`/mcp show` (additional commands available for managing servers)
962
+
5. **Manage servers two ways**: use`/mcp` slash commands inside chat, or `copilot mcp` from the terminal
923
963
6. **Custom servers**let you connect any API (optional, covered in the appendix guide)
924
964
925
965
> 📋 **Quick Reference**: See the [GitHub Copilot CLI command reference](https://docs.github.com/en/copilot/reference/cli-command-reference) for a complete list of commands and shortcuts.
0 commit comments