Skip to content

Commit d7cf720

Browse files
docs: update Learning Hub with recent Copilot CLI features (v1.0.23-v1.0.30) (#1421)
- copilot-configuration-basics.md: Add /ask, /env, /statusline commands and --mode/--autopilot/--plan startup flags - automating-with-hooks.md: Document preToolUse modifiedArgs/updatedInput and additionalContext fields for modifying tool arguments - understanding-mcp-servers.md: Add /mcp install registry section and note that type field is optional for remote MCP servers - installing-and-using-plugins.md: Add copilot plugin marketplace update command and deprecation notice for repo/URL/path installs - using-copilot-coding-agent.md: Add Remote Control section (replaces steering feature) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b360c76 commit d7cf720

File tree

5 files changed

+130
-5
lines changed

5 files changed

+130
-5
lines changed

website/src/content/docs/learning-hub/automating-with-hooks.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: 'Automating with Hooks'
33
description: 'Learn how to use hooks to automate lifecycle events like formatting, linting, and governance checks during Copilot agent sessions.'
44
authors:
55
- GitHub Copilot Learning Hub Team
6-
lastUpdated: 2026-04-02
6+
lastUpdated: 2026-04-16
77
estimatedReadingTime: '8 minutes'
88
tags:
99
- hooks
@@ -332,6 +332,37 @@ Block dangerous commands before they execute:
332332

333333
The `preToolUse` hook receives JSON input with details about the tool being called. Your script can inspect this input and exit with a non-zero code to **deny** the tool execution, or exit with zero to **approve** it.
334334

335+
### Modifying Tool Arguments with preToolUse
336+
337+
Beyond approve/deny, `preToolUse` hooks can also **modify tool arguments** before they are passed to the tool, and inject **additional context** into the agent's reasoning. To do this, write JSON to stdout from your hook script:
338+
339+
```bash
340+
#!/usr/bin/env bash
341+
# scripts/sanitize-bash-args.sh
342+
#
343+
# Reads the proposed bash command from stdin, strips dangerous flags,
344+
# and writes back the sanitized command as modifiedArgs.
345+
346+
INPUT=$(cat)
347+
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty')
348+
349+
# Strip the --no-sandbox flag if present
350+
SAFE_COMMAND=$(echo "$COMMAND" | sed 's/--no-sandbox//g')
351+
352+
echo "{\"modifiedArgs\": {\"command\": \"$SAFE_COMMAND\"}, \"additionalContext\": \"Command was sanitized by security policy.\"}"
353+
```
354+
355+
The output fields are:
356+
357+
| Field | Description |
358+
|-------|-------------|
359+
| `modifiedArgs` (or `updatedInput`) | Replacement tool arguments. These are used instead of the originals. |
360+
| `additionalContext` | Text injected into the agent's context for this turn — useful for explaining why a change was made. |
361+
362+
This enables sophisticated patterns like normalizing file paths, enforcing naming conventions, adding required flags, or surfacing policy context—without blocking the tool entirely.
363+
364+
> **Note**: Both `modifiedArgs` and `updatedInput` are accepted field names for the replacement arguments (for cross-tool compatibility).
365+
335366
### Governance Audit
336367

337368
Scan user prompts for potential security threats and log session activity:

website/src/content/docs/learning-hub/copilot-configuration-basics.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: 'Copilot Configuration Basics'
33
description: 'Learn how to configure GitHub Copilot at user, workspace, and repository levels to optimize your AI-assisted development experience.'
44
authors:
55
- GitHub Copilot Learning Hub Team
6-
lastUpdated: 2026-04-02
6+
lastUpdated: 2026-04-16
77
estimatedReadingTime: '10 minutes'
88
tags:
99
- configuration
@@ -459,6 +459,24 @@ The exported file contains everything needed to view the session without a netwo
459459

460460
**Keyboard shortcuts for queuing messages**: Use **Ctrl+Q** or **Ctrl+Enter** to queue a message (send it while the agent is still working). **Ctrl+D** no longer queues messages — it now has its default terminal behavior. If you have muscle memory for Ctrl+D queuing, switch to Ctrl+Q.
461461

462+
The `/ask` command lets you ask a quick question without affecting your conversation history. The current session context is preserved, so you can use it for one-off lookups without derailing an ongoing task:
463+
464+
```
465+
/ask What does the `retry` utility in src/utils do?
466+
```
467+
468+
The `/env` command shows all loaded environment details — instructions, MCP servers, skills, agents, and plugins — in a single view. Use it to verify that the right resources are active for the current session:
469+
470+
```
471+
/env
472+
```
473+
474+
The `/statusline` command (with `/footer` as an alias) lets you control which items appear in the terminal status bar. You can show or hide individual indicators like the working directory, current branch, effort level, context window usage, and quota:
475+
476+
```
477+
/statusline # show the statusline configuration menu
478+
```
479+
462480
The `/allow-all` command (also accessible as `/yolo`) enables autopilot mode, where the agent runs all tools without asking for confirmation. It now supports `on`, `off`, and `show` subcommands:
463481

464482
```
@@ -477,6 +495,18 @@ gh copilot --effort high "Refactor the authentication module"
477495

478496
Accepted values are `low`, `medium`, and `high`. You can also set a default via the `effortLevel` config setting.
479497

498+
### CLI Startup Flags
499+
500+
The `--mode` flag (along with its aliases `--autopilot` and `--plan`) lets you launch the CLI directly in a specific agent mode without waiting for the interactive session to start:
501+
502+
```bash
503+
copilot --mode agent # start in agent mode (autonomous tool use)
504+
copilot --autopilot # alias for --mode autopilot (allow-all)
505+
copilot --plan # start in plan mode (propose without executing)
506+
```
507+
508+
This is useful in scripts or CI pipelines where you want the CLI to immediately begin working in a specific mode without an interactive prompt.
509+
480510
## Common Questions
481511

482512
**Q: How do I disable Copilot for specific files?**

website/src/content/docs/learning-hub/installing-and-using-plugins.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: 'Installing and Using Plugins'
33
description: 'Learn how to find, install, and manage plugins that extend GitHub Copilot CLI with reusable agents, skills, hooks, and integrations.'
44
authors:
55
- GitHub Copilot Learning Hub Team
6-
lastUpdated: 2026-04-02
6+
lastUpdated: 2026-04-16
77
estimatedReadingTime: '8 minutes'
88
tags:
99
- plugins
@@ -175,6 +175,8 @@ Or from an interactive session:
175175
/plugin install database-data-management@awesome-copilot
176176
```
177177

178+
> **Deprecation notice**: Installing plugins directly from a GitHub repository URL, raw URL, or local file path (e.g., `copilot plugin install github/awesome-copilot`) is deprecated and will be removed in a future release. Use marketplace-based installation instead.
179+
178180
### From VS Code
179181

180182
Browse to the plugin via `@agentPlugins` in the Extensions search view or via **Chat: Plugins** in the Command Palette, then click **Install**.
@@ -190,6 +192,9 @@ copilot plugin list
190192
# Update a plugin to the latest version
191193
copilot plugin update my-plugin
192194

195+
# Refresh all marketplace catalogs (fetch the latest list of available plugins)
196+
copilot plugin marketplace update
197+
193198
# Remove a plugin
194199
copilot plugin uninstall my-plugin
195200
```

website/src/content/docs/learning-hub/understanding-mcp-servers.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: 'Understanding MCP Servers'
33
description: 'Learn how Model Context Protocol servers extend GitHub Copilot with access to external tools, databases, and APIs.'
44
authors:
55
- GitHub Copilot Learning Hub Team
6-
lastUpdated: 2026-04-01
6+
lastUpdated: 2026-04-16
77
estimatedReadingTime: '8 minutes'
88
tags:
99
- mcp
@@ -91,6 +91,24 @@ Example `.mcp.json` or `.vscode/mcp.json`:
9191
}
9292
```
9393

94+
### Installing MCP Servers from the Registry
95+
96+
GitHub Copilot CLI can install MCP servers directly from the official registry with guided configuration — no manual JSON editing required. During an interactive session, run:
97+
98+
```
99+
/mcp install
100+
```
101+
102+
A picker will list available servers from the registry. After selecting one, the CLI prompts for any required configuration values (connection strings, API keys, etc.) and writes the completed entry to your persistent MCP config automatically.
103+
104+
You can also install a specific server by name without the picker:
105+
106+
```
107+
/mcp install @modelcontextprotocol/server-postgres
108+
```
109+
110+
This guided flow is the recommended way to add new MCP servers, especially for servers that require multiple configuration values.
111+
94112
### Configuration Fields
95113

96114
**command**: The executable to run the MCP server (e.g., `npx`, `python`, `docker`).
@@ -99,6 +117,8 @@ Example `.mcp.json` or `.vscode/mcp.json`:
99117

100118
**env**: Environment variables passed to the server process. Use these for connection strings, API keys, and configuration—never hardcode secrets in the JSON file.
101119

120+
**type** (remote servers): The transport type for remote MCP servers (`http` or `sse`). This field can now be omitted — the CLI defaults to `http` when no type is specified, simplifying remote server configuration.
121+
102122
### Managing Persistent MCP Configuration via Server RPCs
103123

104124
In addition to file-based configuration, GitHub Copilot CLI exposes **server RPCs** that let MCP servers and tooling scripts manage the persistent MCP server registry at runtime. This enables programmatic setup — for example, an installer script that registers a server without requiring you to hand-edit a JSON file.

website/src/content/docs/learning-hub/using-copilot-coding-agent.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: 'Using the Copilot Coding Agent'
33
description: 'Learn how to use GitHub Copilot coding agent to autonomously work on issues, generate pull requests, and automate development tasks.'
44
authors:
55
- GitHub Copilot Learning Hub Team
6-
lastUpdated: 2026-03-25
6+
lastUpdated: 2026-04-16
77
estimatedReadingTime: '12 minutes'
88
tags:
99
- coding-agent
@@ -334,6 +334,45 @@ This repository provides a curated collection of agents, skills, and hooks desig
334334

335335
> **Example workflow**: Combine a `test-specialist` agent with a `database-migrations` skill and a linting hook. Assign an issue to the coding agent using the test-specialist agent — it will automatically pick up the migrations skill when relevant, and the hook ensures all code is formatted before completion.
336336
337+
## Remote Control
338+
339+
You can connect to and steer a running coding agent session from a local Copilot CLI terminal using **remote control**. This lets you observe the agent's progress, send follow-up prompts, and redirect its work in real time — without waiting for it to open a PR first.
340+
341+
### Starting a Remote-Controlled Session
342+
343+
Launch a session that registers with GitHub for remote access:
344+
345+
```bash
346+
copilot --remote
347+
```
348+
349+
Or open a remote control tab from inside an existing session:
350+
351+
```
352+
/remote
353+
```
354+
355+
The **Remote** tab in the CLI shows all active coding agent tasks from the repository. Select a task to connect and begin sending steering messages.
356+
357+
### Resuming from the Session Picker
358+
359+
Remote sessions also appear in the `--resume` picker, so you can reconnect to a coding agent session you were previously controlling without needing to know the session ID:
360+
361+
```bash
362+
copilot --resume
363+
```
364+
365+
### Why Use Remote Control?
366+
367+
| Scenario | Benefit |
368+
|----------|---------|
369+
| Long-running tasks | Monitor progress without waiting for the final PR |
370+
| Mid-course corrections | Redirect the agent if it heads in the wrong direction |
371+
| Interactive refinement | Provide clarification and feedback as the agent works |
372+
| No PR required | You can steer tasks that haven't yet opened a pull request |
373+
374+
> **Note**: Remote control replaces the earlier "steering" feature. If you see references to steering in older documentation, remote control is the updated equivalent.
375+
337376
## Hooks and the Coding Agent
338377

339378
Hooks are especially valuable with the coding agent because they provide deterministic guardrails for autonomous work:

0 commit comments

Comments
 (0)