From 5bc19ae95a677b8ea1de36c2ff8480142140bed2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 9 Oct 2026 03:55:34 +0000 Subject: [PATCH] Sync CLI for Beginners chapter 01 with upstream Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../01-setup-and-first-steps.md | 130 +++++++++++++----- 1 file changed, 97 insertions(+), 33 deletions(-) diff --git a/website/src/content/docs/learning-hub/cli-for-beginners/01-setup-and-first-steps.md b/website/src/content/docs/learning-hub/cli-for-beginners/01-setup-and-first-steps.md index f5f3837a1..1563ce936 100644 --- a/website/src/content/docs/learning-hub/cli-for-beginners/01-setup-and-first-steps.md +++ b/website/src/content/docs/learning-hub/cli-for-beginners/01-setup-and-first-steps.md @@ -3,7 +3,7 @@ title: '01 ยท First Steps' description: 'Experience your first GitHub Copilot CLI demos and learn the three main interaction modes.' authors: - GitHub Copilot Learning Hub Team -lastUpdated: 2026-07-17 +lastUpdated: 2026-10-09 --- ![Chapter 01: First Steps](/images/learning-hub/copilot-cli-for-beginners/01/chapter-header.png) @@ -70,7 +70,7 @@ Now let's see why developers are calling this "having a senior engineer on speed ### Demo 1: Code Review in Seconds -The course includes sample files with intentional code quality issues. Let's review one: +The course includes sample files with intentional code quality issues. If you're working on your local machine and haven't already cloned the repo, please run the `git clone` command below, navigate to the `copilot-cli-for-beginners` folder, and then run the `copilot` command. ```bash # Clone the course repository if you're working locally and haven't already @@ -81,13 +81,13 @@ cd copilot-cli-for-beginners copilot ``` -Once inside the interactive session: +Once inside the interactive Copilot CLI session, run the following: ``` > Review @samples/book-app-project/book_app.py for code quality issues and suggest improvements ``` -> ๐Ÿ’ก **What's the `@`?** The `@` symbol tells Copilot CLI to read a file. You'll learn all about this in Chapter 02. For now, just copy the command exactly as shown. +> ๐Ÿ’ก **What's the `@` symbol used for?** The `@` symbol tells Copilot CLI to read a file. You'll learn all about this in Chapter 02. For now, just copy the command exactly as shown. --- @@ -280,9 +280,7 @@ Notice how each prompt builds on the previous answer. You're having a conversati **Best for**: Complex tasks where you want to review the approach before execution. Similar to planning a route before a trip using GPS. -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: - -> ๐Ÿ’ก **Tip**: **Shift+Tab** cycles between modes: Interactive โ†’ Plan โ†’ Autopilot. Press it anytime during an interactive session to switch modes without typing a command. +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: ```bash copilot @@ -290,6 +288,14 @@ copilot > /plan Add a "mark as read" command to the book app ``` +> ๐Ÿ’ก **Tip**: **Shift+Tab** cycles between modes: Interactive โ†’ Plan โ†’ Autopilot. Press it anytime during an interactive session to switch modes without typing a command. + +You can also launch Copilot CLI directly in plan mode using the `--plan` flag: + +```bash +copilot --plan +``` + **Plan mode output:** (your output may differ) ``` @@ -316,11 +322,11 @@ Step 4: Test the flow Proceed with implementation? [Y/n] ``` -**Key insight**: Plan mode lets you review and modify the approach before any code is written. Once a plan is complete, you can even tell Copilot CLI to save it to a file for later reference. For example, "Save this plan to `mark_as_read_plan.md`" would create a markdown file with the plan details. +**Key insight**: Plan mode lets you review and modify the approach before any code is written. While in plan mode, Copilot CLI is **read-only** and will not edit any files or run commands that change your workspace until you approve and move to implementation. This keeps you safely in the "thinking" stage until you're ready. Once a plan is complete, you can even tell Copilot CLI to save it to a file for later reference. For example, "Save this plan to `mark_as_read_plan.md`" would create a markdown file with the plan details. > ๐Ÿ’ก **Want something more complex?** Try: `/plan Add search and filter capabilities to the book app`. Plan mode scales from simple features to full applications. -> ๐Ÿ“š **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. +> ๐Ÿ“š **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`, or set a goal inline with `/autopilot ` (for example, `/autopilot Add a search command to the book app`). You can also combine planning and autopilot by running `copilot --plan --mode autopilot`. Copilot will create a plan first and then implement it automatically without pausing for approval. 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. --- @@ -371,17 +377,22 @@ These commands are great to learn initially as you're getting started with Copil |---------|--------------|-------------| | `/ask` | Ask a quick question without it affecting your conversation history | When you want a quick answer without derailing your current task | | `/clear` | Clear conversation and start fresh | When switching topics | +| `/config` | View or set persistent defaults (e.g., default model) | When you want a setting to apply to all future sessions | | `/help` | Show all available commands | When you forget a command | -| `/model` | Show or switch AI model | When you want to change the AI model | +| `/model` | Show or switch AI model for the current session | When you want to change the AI model | | `/plan` | Plan your work out before coding | For more complex features | | `/refine` | Rewrite a rough, stream-of-consciousness prompt into a clear, focused one | When your prompt feels messy and you want better results | | `/research` | Deep research using GitHub and web sources | When you need to investigate a topic before coding | | `/exit` | End the session | When you're done | -> ๐Ÿ’ก **`/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. +> ๐Ÿ’ก **`/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. It's perfect for quick one-off questions like `/ask What does YAML mean?` without polluting your session context. > ๐Ÿ’ก **`/refine` for better prompts**: Not sure if your prompt is clear enough? Type it out as it comes to mind, then run `/refine` to let Copilot rewrite it into a precise, well-structured prompt before sending. This is especially useful when you're new to AI tools and still learning how to write effective prompts. +> ๐Ÿ’ก **Tab-completion**: When typing a slash command, press **Tab** to auto-complete the command name or cycle through available subcommands and arguments. This is especially handy when you can't remember the exact name of a command. + +> ๐Ÿ’ก **Queue prompts while Copilot is busy**: If Copilot is in the middle of a task and you think of the next thing you want it to do, just type it and press **Enter**. Copilot will run it automatically when the current task finishes, so you don't have to wait around. + That's it for getting started! As you become comfortable, you can explore additional commands. > ๐Ÿ“š **Official Documentation**: [CLI command reference](https://docs.github.com/copilot/reference/cli-command-reference) for the complete list of commands and flags. @@ -395,13 +406,15 @@ That's it for getting started! As you become comfortable, you can explore additi | Command | What It Does | |---------|--------------| -| `/init` | Initialize Copilot instructions for your repository | | `/agent` | Browse and select from available agents | | `/env` | Show loaded environment details โ€” what instructions, MCP servers, skills, agents, and plugins are active | | `/init` | Initialize Copilot instructions for your repository | -| `/mcp` | Manage MCP server configuration | +| `/instructions` | View and manage all loaded instruction files for the current session | +| `/mcp` | Open the plugins dashboard (focused on MCP servers); use `/mcp config` for the dedicated MCP setup wizard | +| `/plugin` | Open the plugins dashboard to browse, install, enable, and update plugins | | `/settings` | Open an interactive dialog to browse and edit all user settings in one place | -| `/skills` | Manage skills for enhanced capabilities | +| `/skills` | Open the plugins dashboard (focused on skills) to discover and manage skills | +| `/subagents` | View and manage subagents running in the current session | > ๐Ÿ’ก Agents are covered in [Chapter 04](https://github.com/github/copilot-cli-for-beginners/blob/main/04-agents-custom-instructions/README.md), skills are covered in [Chapter 05](https://github.com/github/copilot-cli-for-beginners/blob/main/05-skills/README.md), and MCP servers are covered in [Chapter 06](https://github.com/github/copilot-cli-for-beginners/blob/main/06-mcp-servers/README.md). @@ -409,9 +422,10 @@ That's it for getting started! As you become comfortable, you can explore additi | Command | What It Does | |---------|--------------| -| `/model` | Show or switch AI model | -| `/delegate` | Hand off task to Copilot coding agent on GitHub (agent in the cloud) | +| `/config` | View or set persistent defaults (e.g., `/config model` to set your default model for all future sessions) | +| `/delegate` | Hand off task to GitHub Copilot cloud agent | | `/fleet` | Split a complex task into parallel subtasks for faster completion | +| `/model` | Show or switch AI model for the current session only | | `/tasks` | View background subagents and detached shell sessions | ### Code @@ -420,42 +434,61 @@ That's it for getting started! As you become comfortable, you can explore additi |---------|--------------| | `/diff` | Review the changes made in the current directory | | `/pr` | Operate on pull requests for the current branch | -| `/review` | Run the code-review agent to analyze changes | | `/research` | Run deep research investigation using GitHub and web sources | +| `/review` | Run the code-review agent to analyze changes | | `/terminal-setup` | Enable multiline input support (shift+enter and ctrl+enter) | ### Permissions | Command | What It Does | |---------|--------------| -| `/allow-all` | Auto-approve all permission prompts for this session | | `/add-dir ` | Add a directory to allowed list | -| `/list-dirs` | Show all allowed directories | +| `/allow-all [on\|off\|show]` | Auto-approve all permission prompts; use `on` to enable, `off` to disable, `show` to check current status | +| `/permissions` | Switch between approval modes (interactive, plan, autopilot) for controlling how much Copilot can do without asking | +| `/yolo` | Quick alias for `/allow-all on` โ€” auto-approves all permission prompts. | | `/cwd`, `/cd [directory]` | View or change working directory | +| `/list-dirs` | Show all allowed directories | -> โš ๏ธ **Use with caution**: `/allow-all` skips confirmation prompts. Great for trusted projects, but be careful with untrusted code. +> โš ๏ธ **Use with caution**: `/allow-all` and `/yolo` skip confirmation prompts. Great for trusted projects, but be careful with untrusted code. ### Session | Command | What It Does | |---------|--------------| -| `/resume` | Switch to a different session (optionally specify session ID) | -| `/rename` | Rename the current session | +| `/clear` | Abandons the current session (no history saved) and starts a fresh conversation | +| `/compact` | Summarize conversation to reduce context usage (optionally add focus instructions, e.g. `/compact focus on the bug list`) | | `/context` | Show context window token usage and visualization | -| `/usage` | Display session usage metrics and statistics | -| `/session` | Show session info and workspace summary | -| `/compact` | Summarize conversation to reduce context usage | -| `/share` | Export session as markdown file or GitHub gist | +| `/keep-alive` | Prevent your system from sleeping while Copilot CLI is active โ€” handy for long-running tasks on a laptop | +| `/memory [on\|off\|show]` | Enable, disable, or view persistent memory โ€” facts and preferences remembered across all sessions | +| `/new` | Ends the current session (saving it to history for search/resume) and starts a fresh conversation. | +| `/resume` | Switch to a different session (optionally specify session ID or name) | +| `/rename` | Rename the current session (omit the name to auto-generate one) | +| `/rewind` | Open a timeline picker to roll back to any earlier point in the conversation; optionally restores the files Copilot changed (works without git) | +| `/usage` | Display session usage metrics and statistics, including quota progress bars | +| `/session` | Show session info and workspace summary; use `/session delete`, `/session delete `, or `/session delete-all` to remove sessions | +| `/share` | Export session as a markdown file, GitHub gist, or self-contained HTML file | +| `/every ` | Schedule a prompt to run on a recurring interval (e.g., `/every 1h summarize new commits`). Use natural language for the interval. `/loop` is an alias for `/every`. | +| `/after