Skip to content

Commit b80ea43

Browse files
docs: update Learning Hub for Copilot CLI v1.0.15–v1.0.16 changes (#1273)
- Add PermissionRequest hook event to automating-with-hooks.md with practical CI example (new in v1.0.16) - Add Ctrl+Q / Ctrl+Enter queue shortcut note to copilot-configuration-basics.md (Ctrl+D no longer queues as of v1.0.15) - Add extraKnownMarketplaces config setting to installing-and-using-plugins.md (old 'marketplaces' setting removed in v1.0.16) - Update lastUpdated dates on all three files 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 46bef1b commit b80ea43

File tree

3 files changed

+59
-3
lines changed

3 files changed

+59
-3
lines changed

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

Lines changed: 38 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-01
6+
lastUpdated: 2026-04-02
77
estimatedReadingTime: '8 minutes'
88
tags:
99
- hooks
@@ -93,6 +93,7 @@ Hooks can trigger on several lifecycle events:
9393
| `preToolUse` | Before the agent uses any tool (e.g., `bash`, `edit`) | **Approve or deny** tool executions, block dangerous commands, enforce security policies |
9494
| `postToolUse` | After a tool **successfully** completes execution | Log results, track usage, format code after edits |
9595
| `postToolUseFailure` | When a tool call **fails with an error** | Log errors for debugging, send failure alerts, track error patterns |
96+
| `PermissionRequest` | When the CLI shows a **permission prompt** to the user | Programmatically approve or deny permission requests, enable auto-approval in CI/headless environments |
9697
| `agentStop` | Main agent finishes responding to a prompt | Run final linters/formatters, validate complete changes |
9798
| `preCompact` | Before the agent compacts its context window | Save a snapshot, log compaction event, run summary scripts |
9899
| `subagentStart` | A subagent is spawned by the main agent | Inject additional context into the subagent's prompt, log subagent launches |
@@ -207,6 +208,42 @@ automatically before the agent commits changes.
207208

208209
## Practical Examples
209210

211+
### Auto-Approve Permissions in CI with PermissionRequest
212+
213+
The `PermissionRequest` hook fires when the CLI shows a permission prompt to the user — for example, when the agent wants to run a shell command for the first time. Unlike `preToolUse` (which can block specific tool *calls*), `PermissionRequest` intercepts the permission approval UI itself, making it ideal for **headless and CI environments** where no one is available to click "Allow".
214+
215+
When your hook script exits with code `0`, the permission request is **approved**. Exit with a non-zero code to **deny** it (the user will still see the prompt).
216+
217+
```json
218+
{
219+
"version": 1,
220+
"hooks": {
221+
"PermissionRequest": [
222+
{
223+
"type": "command",
224+
"bash": "./scripts/ci-permission-policy.sh",
225+
"cwd": ".",
226+
"timeoutSec": 5
227+
}
228+
]
229+
}
230+
}
231+
```
232+
233+
Example policy script that auto-approves all permissions when running in CI:
234+
235+
```bash
236+
#!/usr/bin/env bash
237+
# scripts/ci-permission-policy.sh
238+
# Auto-approve all permission requests in CI environments
239+
if [ "${CI}" = "true" ]; then
240+
exit 0 # approve
241+
fi
242+
exit 1 # deny (let the user decide interactively)
243+
```
244+
245+
> **Security note**: Use `PermissionRequest` hooks carefully. Blanket auto-approval in non-CI environments removes an important safety check. Scope the auto-approval logic precisely (e.g., only in CI, only for specific tools).
246+
210247
### Handling Tool Failures with postToolUseFailure
211248

212249
The `postToolUseFailure` hook fires when a tool call fails with an error — distinct from `postToolUse`, which only fires on success. Use it to log errors, send failure alerts, or implement retry logic:

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

Lines changed: 3 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-01
6+
lastUpdated: 2026-04-02
77
estimatedReadingTime: '10 minutes'
88
tags:
99
- configuration
@@ -457,6 +457,8 @@ The `/share html` command exports the current session — including conversation
457457

458458
The exported file contains everything needed to view the session without a network connection and can be shared with teammates or stored for later reference. This complements `/share` (which shares via URL) for cases where an offline or attached format is preferred.
459459

460+
**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.
461+
460462
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:
461463

462464
```

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

Lines changed: 18 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-03-30
6+
lastUpdated: 2026-04-02
77
estimatedReadingTime: '8 minutes'
88
tags:
99
- plugins
@@ -142,6 +142,23 @@ Or from a local path:
142142
copilot plugin marketplace add /path/to/local-marketplace
143143
```
144144

145+
### Sharing Marketplace Registrations Across a Team
146+
147+
To automatically register an additional marketplace for everyone working in a repository, add an `extraKnownMarketplaces` entry to your `.github/copilot-settings.json` (or `config.json`):
148+
149+
```json
150+
{
151+
"extraKnownMarketplaces": [
152+
{
153+
"name": "my-org-plugins",
154+
"source": "my-org/internal-plugins"
155+
}
156+
]
157+
}
158+
```
159+
160+
With this in place, team members automatically get the `my-org-plugins` marketplace available without running a separate `marketplace add` command. This replaces the older `marketplaces` setting, which was removed in v1.0.16.
161+
145162
## Installing Plugins
146163

147164
### From Copilot CLI

0 commit comments

Comments
 (0)