Skip to content

Commit 2f383aa

Browse files
docs-botgithub-actions[bot]hubwriterCopilot
authored
docs: update copilot-cli content from source docs (#62476)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: hubwriter <hubwriter@github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 4fcab90 commit 2f383aa

5 files changed

Lines changed: 31 additions & 3 deletions

File tree

content/copilot/reference/copilot-cli-reference/acp-server.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ The Agent Client Protocol (ACP) is a protocol that standardizes communication be
3232

3333
Use the `--acp` option of the `copilot` command to start the CLI's ACP server. You can specify the transport mode with either the `--stdio` or `--port` options. If no transport mode is specified, the server defaults to stdio mode.
3434

35+
ACP mode allows sessions with a configured bring-your-own-key (BYOK) provider (`COPILOT_PROVIDER_*` environment variables) to run without {% data variables.product.github %} login, matching the behavior of `-p`/interactive mode.
36+
3537
### Options applied to every session
3638

3739
The ACP `session/new` request only lets a client set a few session parameters, such as the working directory and the MCP servers to use. It does not carry tool-filtering or reasoning settings. To configure those, pass the corresponding options when you **start the server**. The server stores the values and applies them as the initial configuration for every session it creates or loads, for any client that connects. A connecting client does not choose these values—whoever launches the server does.
@@ -91,7 +93,7 @@ There is a growing ecosystem of libraries for interacting with ACP servers progr
9193
To run this example, you need the following dependencies:
9294

9395
* [Node.js](https://nodejs.org) version 18 or later.
94-
* {% data variables.copilot.copilot_cli %}, installed and authenticated.
96+
* {% data variables.copilot.copilot_cli %}, installed and either authenticated with {% data variables.product.github %} or configured with a BYOK provider (see [Starting the ACP server](#starting-the-acp-server)).
9597
* The `@agentclientprotocol/sdk` package, which provides the ACP TypeScript library. Install it by running `npm install @agentclientprotocol/sdk`.
9698

9799
```typescript copy

content/copilot/reference/copilot-cli-reference/cli-command-reference.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ docsTeamMetrics:
2020
|------------------------|----------------------------------------------------|
2121
| `copilot` | Launch the interactive user interface. |
2222
| `copilot completion SHELL` | Print a shell script for the chosen shell that can be used to enable tab completion for {% data variables.copilot.copilot_cli_short %}. Supported shells: `bash`, `zsh`, `fish`. See [Using `copilot completion`](#using-copilot-completion). |
23-
| `copilot help [TOPIC]` | Display help information. Help topics include: `billing`, `config`, `commands`, `environment`, `logging`, `monitoring`, `permissions`, and `providers`. |
23+
| `copilot help [TOPIC]` | Display help information. Help topics include: `billing`, `config`, `commands`, `environment`, `logging`, `monitoring`, `permissions`, `providers`, and `sandbox`. |
2424
| `copilot init` | Initialize {% data variables.product.prodname_copilot_short %} custom instructions for this repository. |
2525
| `copilot login` | Authenticate with {% data variables.product.prodname_copilot_short %} via the OAuth device flow. Accepts `--host HOST` to specify the {% data variables.product.github %} host URL (default: `https://github.com`). |
2626
| `copilot login [OPTION]` | Authenticate with {% data variables.product.prodname_copilot_short %} via the OAuth device flow. See [`copilot login` options](#copilot-login-options). |
@@ -565,6 +565,7 @@ copilot --deny-tool='write(secret.txt)'
565565
| `COPILOT_GITHUB_TOKEN` | Authentication token. Takes precedence over `GH_TOKEN` and `GITHUB_TOKEN`. |
566566
| `COPILOT_HOME` | Override the configuration and state directory. Default: `$HOME/.copilot`. |
567567
| `COPILOT_LARGE_OUTPUT_THRESHOLD_BYTES` | Maximum UTF-8 byte size for tool output returned directly to the model. Default: `20480` (20 KiB). See [AUTOTITLE](/copilot/concepts/agents/copilot-cli/context-management#managing-large-tool-output). |
568+
| `COPILOT_MCP_TOOL_CACHE` | Set to `false` to disable loading and persisting local MCP server tool snapshots for the entire process. See [Tool snapshot caching](#tool-snapshot-caching). |
568569
| `COPILOT_MODEL` | Set the AI model. |
569570
| `COPILOT_PROMPT_FRAME` | Set to `1` to enable the decorative UI frame around the input prompt, or `0` to disable it. Overrides the `PROMPT_FRAME` experimental feature flag for the current session. |
570571
| `COPILOT_SKILLS_DIRS` | Comma-separated list of additional directories for skills. |
@@ -691,6 +692,13 @@ Use `copilot mcp` to manage MCP server configurations from the command line with
691692
| `timeout` | No | Tool call timeout in milliseconds. |
692693
| `type` | No | `"local"` or `"stdio"`. Default: `"local"`. |
693694
| `deferTools` | No | `"auto"` (default) or `"never"`. Set to `"never"` to keep this server's tools always visible even when tool search is active. |
695+
| `disableToolCache` | No | Set to `true` to skip loading and persisting the tool snapshot for this server. |
696+
697+
### Tool snapshot caching
698+
699+
{% data variables.copilot.copilot_cli_short %} persists a snapshot of each local server's tool list so tools are available immediately on startup while live discovery completes in the background. Live discovery always runs and replaces the snapshot once it finishes.
700+
701+
Set `disableToolCache: true` on a server to force live discovery for that server only, or set the `COPILOT_MCP_TOOL_CACHE=false` environment variable to disable snapshot loading and persistence for the entire process. Both opt-outs leave existing cache files untouched.
694702

695703
### Private npm registry
696704

content/copilot/reference/copilot-cli-reference/cli-config-dir-reference.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,9 @@ These settings apply across all your sessions and repositories. You can use the
509509
| `toolSearch` | `boolean` | model- and feature-dependent | Controls tool search (deferred tool loading). Set `toolSearch: false` to opt out of tool search. |
510510
| `updateTerminalTitle` | `boolean` | `true` | Show the current intent in the terminal tab or window title. |
511511

512+
> [!TIP]
513+
> Run `copilot help sandbox` for the full sandbox reference, including supported hosts (macOS Seatbelt, Linux bubblewrap, and Windows) and all `sandbox` settings keys.
514+
512515
### Repository settings (`.github/copilot/settings.json`)
513516

514517
Repository settings apply to everyone who works in the repository. They are committed to the repository and shared with collaborators.

content/copilot/reference/hooks-reference.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,8 @@ Tools with no Claude equivalent keep their runtime names.
510510

511511
### `subagentStop` / `SubagentStop`
512512

513+
Fires when a subagent completes normally, before returning results to the parent. `stopReason` is currently always `"end_turn"`. This hook fires before large-response spill handling, so `response` (or `last_assistant_message` in the {% data variables.product.prodname_vscode_shortname %} compatible format) carries the full final subagent response text.
514+
513515
**camelCase input:**
514516

515517
```typescript
@@ -518,8 +520,11 @@ Tools with no Claude equivalent keep their runtime names.
518520
timestamp: number;
519521
cwd: string;
520522
transcriptPath: string;
523+
agentId: string;
524+
agentType: string;
521525
agentName: string;
522526
agentDisplayName?: string;
527+
response: string; // Full final subagent response text
523528
stopReason: "end_turn";
524529
}
525530
```
@@ -533,8 +538,11 @@ Tools with no Claude equivalent keep their runtime names.
533538
timestamp: string; // ISO 8601 timestamp
534539
cwd: string;
535540
transcript_path: string;
541+
agent_id: string;
542+
agent_type: string;
536543
agent_name: string;
537544
agent_display_name?: string;
545+
last_assistant_message: string; // The `response` text
538546
stop_reason: "end_turn";
539547
}
540548
```
@@ -621,6 +629,13 @@ The `preToolUse` hook can control tool execution by writing a JSON object to std
621629
|-------|--------|-------------|
622630
| `decision` | `"block"`, `"allow"` | `"block"` forces another agent turn using `reason` as the prompt. |
623631
| `reason` | string | Prompt for the next turn when `decision` is `"block"`. |
632+
| `modifiedResponse` | string | **`subagentStop` only.** Replaces the response returned to the parent when the subagent is allowed to complete—useful for redacting or reformatting subagent output. Not applicable to `agentStop`. |
633+
634+
`decision` and `reason` behave the same for both `agentStop` and `subagentStop`. `modifiedResponse` applies only to `subagentStop`:
635+
636+
* A valid `block` decision wins over `modifiedResponse`: if a hook returns both, the subagent continues and the rewrite is discarded.
637+
* Rewrites do not compose across multiple matching hooks. Every hook receives the same original `response`, and the last hook to return `modifiedResponse` wins—chaining a redactor and a formatter does not feed the redacted text into the formatter.
638+
* The output field names (`decision`, `reason`, `modifiedResponse`) are the same for both the camelCase and {% data variables.product.prodname_vscode_shortname %} compatible configs.
624639

625640
> [!NOTE]
626641
> **Runaway guard.** After 8 consecutive `block` continuations, the CLI overrides the hook and ends the turn anyway, to prevent an unbounded loop. Use the `stop_hook_active` input field on `agentStop` to detect that this turn was already forced to continue, and self-limit before hitting the cap.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7a9cc333248da994abe48d847f18a313db0d56f6
1+
54687252873adafb61a52d1f3685b8ebd051ec2f

0 commit comments

Comments
 (0)