Skip to content

Commit 716d940

Browse files
docs-botgithub-actions[bot]hubwriter
authored
docs: update copilot-cli content from source docs (#61016)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: hubwriter <hubwriter@github.com>
1 parent bb26012 commit 716d940

3 files changed

Lines changed: 88 additions & 14 deletions

File tree

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

Lines changed: 86 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ copilot completion fish > ~/.config/fish/completions/copilot.fish
104104
| <kbd>Ctrl</kbd>+<kbd>V</kbd> | Paste from clipboard as an attachment. |
105105
| <kbd>Ctrl</kbd>+<kbd>X</kbd> then `/` | After you have started typing a prompt, this allows you to run a slash command—for example, if you want to change the model without having to retype your prompt. |
106106
| <kbd>Ctrl</kbd>+<kbd>X</kbd> then `e` | Edit the prompt in an external editor (`$EDITOR`). |
107+
| <kbd>Ctrl</kbd>+<kbd>X</kbd> then `b` | Promote the running task or shell command to the background. |
107108
| <kbd>Ctrl</kbd>+<kbd>X</kbd> then `o` | Open the most recent link from the timeline. |
108109
| <kbd>Ctrl</kbd>+<kbd>Z</kbd> | Suspend the process to the background (Unix). |
109110
| <kbd>Shift</kbd>+<kbd>Enter</kbd> or <kbd>Option</kbd>+<kbd>Enter</kbd> (Mac) / <kbd>Alt</kbd>+<kbd>Enter</kbd> (Windows/Linux) | Insert a newline in the input. |
@@ -113,11 +114,36 @@ copilot completion fish > ~/.config/fish/completions/copilot.fish
113114

114115
| Shortcut | Purpose |
115116
|------------------------------|---------------------------------------|
117+
| <kbd>Ctrl</kbd>+<kbd>F</kbd> | Open timeline search. |
116118
| <kbd>Ctrl</kbd>+<kbd>O</kbd> | While there is nothing in the prompt input, this expands recent items in {% data variables.product.prodname_copilot_short %}'s response timeline to show more details. |
117119
| <kbd>Ctrl</kbd>+<kbd>E</kbd> | While there is nothing in the prompt input, this expands all items in {% data variables.product.prodname_copilot_short %}'s response timeline. |
118120
| <kbd>Ctrl</kbd>+<kbd>T</kbd> | Expand/collapse display of reasoning in responses. |
119121
| <kbd>Page Up</kbd>/<kbd>Page Down</kbd> | Scroll the timeline up or down by one page. |
120122

123+
## Session picker shortcuts
124+
125+
When the session picker is open (opened via `/resume` or `--continue`):
126+
127+
| Shortcut | Purpose |
128+
|----------|---------|
129+
| <kbd>↑</kbd>/<kbd>↓</kbd> | Move selection up or down. |
130+
| <kbd>Enter</kbd> | Open the selected session. |
131+
| `s` | Cycle the sort order: relevance → created → name → last used. |
132+
| <kbd>Tab</kbd> | Switch between the local and remote tabs. |
133+
| `d` | Delete the selected session. |
134+
| <kbd>Esc</kbd> | Close the picker. |
135+
136+
Sessions sort by the following modes:
137+
138+
| Mode | Description |
139+
|------|-------------|
140+
| `relevance` | Scores sessions by match to the current working directory (default). |
141+
| `last used` | Most recently modified sessions first. |
142+
| `created` | Most recently created sessions first. |
143+
| `name` | Alphabetical by session name; unnamed sessions sort to the end. |
144+
145+
Sessions already open in another window float to the top in all non-relevance sort modes. When no working-directory context is available, the `relevance` mode is skipped.
146+
121147
## Navigation shortcuts in the interactive interface
122148

123149
| Shortcut | Purpose |
@@ -147,6 +173,7 @@ copilot completion fish > ~/.config/fish/completions/copilot.fish
147173
| `/changelog [summarize] [VERSION\|last N\|since VERSION]`, `/release-notes [summarize] [VERSION\|last N\|since VERSION]` | Display the CLI changelog. Optionally specify a version, a count of recent releases, or a starting version. Add the keyword `summarize` for an AI-generated summary. |
148174
| `/chronicle <standup\|tips\|improve\|reindex>` | Session history tools and insights. {% data reusables.copilot.experimental %} |
149175
| `/clear [PROMPT]`, `/new [PROMPT]`, `/reset [PROMPT]` | Start a new conversation. |
176+
| `/clikit [COMPONENT]` | Preview CLI business components (for example, quota info). |
150177
| `/compact` | Summarize the conversation history to reduce context window usage. See [AUTOTITLE](/copilot/concepts/agents/copilot-cli/context-management#compaction). |
151178
| `/context` | Show the context window token usage and visualization. See [AUTOTITLE](/copilot/concepts/agents/copilot-cli/context-management#checking-your-context-usage). |
152179
| `/copy` | Copy the last response to the clipboard. |
@@ -163,7 +190,7 @@ copilot completion fish > ~/.config/fish/completions/copilot.fish
163190
| `/ide` | Connect to an IDE workspace. See [AUTOTITLE](/copilot/how-tos/copilot-cli/use-copilot-cli/connecting-vs-code#managing-the-connection-with-the-ide-slash-command). |
164191
| `/init` | Initialize {% data variables.product.prodname_copilot_short %} custom instructions and agentic features for this repository. See [Project initialization for {% data variables.product.prodname_copilot_short %}](#project-initialization-for-copilot). |
165192
| `/instructions` | View and toggle custom instruction files. |
166-
| `/keep-alive [on\|busy\|NUMBERm\|NUMBERh]` | Prevent the machine from going to sleep: while a CLI session is active, while the agent is busy, or for a defined length of time. |
193+
| `/keep-alive [on\|off\|busy\|DURATION]`, `/caffeinate [on\|off\|busy\|DURATION]` | Prevent the machine from going to sleep: while a CLI session is active, while the agent is busy, or for a defined length of time. Accepts durations like `30`, `30m`, `2h`, `1d` (bare numbers default to minutes). |
167194
| `/list-dirs` | Display all of the directories for which file access has been allowed. |
168195
| `/login` | Log in to {% data variables.product.prodname_copilot_short %}. |
169196
| `/logout` | Log out of {% data variables.product.prodname_copilot_short %}. |
@@ -180,11 +207,12 @@ copilot completion fish > ~/.config/fish/completions/copilot.fish
180207
| `/restart` | Restart the CLI, preserving the current session. |
181208
| `/resume [SESSION-ID]`, `/continue [SESSION-ID]` | Switch to a different session by choosing from a list (optionally specify a session ID). |
182209
| `/review [PROMPT]` | Run the code review agent to analyze changes. See [AUTOTITLE](/copilot/how-tos/copilot-cli/use-copilot-cli/agentic-code-review). |
210+
| `/search [QUERY]`, `/find [QUERY]` | Search the conversation timeline. {% data reusables.copilot.experimental %} |
183211
| `/session [info\|checkpoints [n]\|files\|plan\|rename [NAME]\|cleanup\|prune\|delete [ID]\|delete-all]`, `/sessions [info\|checkpoints [n]\|files\|plan\|rename [NAME]\|cleanup\|prune\|delete [ID]\|delete-all]` | Show session information and manage sessions. Subcommands: `info`, `checkpoints`, `files`, `plan`, `rename`, `cleanup`, `prune`, `delete`, `delete-all`. |
184212
| `/share [file\|html\|gist] [session\|research] [PATH]`, `/export [file\|html\|gist] [session\|research] [PATH]` | Share the session to a Markdown file, interactive HTML file, or {% data variables.product.github %} gist. |
185213
| `/skills [list\|info\|add\|remove\|reload] [ARGS...]` | Manage skills for enhanced capabilities. See [AUTOTITLE](/copilot/how-tos/copilot-cli/customize-copilot/create-skills). |
186214
| `/statusline`, `/footer` | Configure which items appear in the status line. |
187-
| `/tasks` | View and manage background tasks (subagents and shell sessions). |
215+
| `/tasks` | View and manage tasks (subagents and shell commands). |
188216
| `/terminal-setup` | Configure the terminal for multiline input support (<kbd>Shift</kbd>+<kbd>Enter</kbd> and <kbd>Ctrl</kbd>+<kbd>Enter</kbd>). |
189217
| `/theme [default\|dim\|high-contrast\|colorblind]` | View or set the color mode. |
190218
| `/undo`, `/rewind` | Rewind the last turn and revert file changes. |
@@ -302,7 +330,6 @@ The `--available-tools` and `--excluded-tools` options support these values:
302330
| `ask_user` | Ask the user a question |
303331
| `glob` | Find files matching patterns |
304332
| `grep` (or `rg`) | Search for text in files |
305-
| `show_file` | Present code snippets inline in the timeline. {% data reusables.copilot.experimental %} |
306333
| `skill` | Invoke custom skills |
307334
| `web_fetch` | Fetch and parse web content |
308335

@@ -354,6 +381,9 @@ copilot --allow-tool='MyMCP'
354381
| `COPILOT_SUBAGENT_MAX_DEPTH` | Maximum subagent nesting depth. Default: `6`. Range: `1``256`. |
355382
| `GH_HOST` | {% data variables.product.github %} hostname for both {% data variables.product.prodname_cli %} and {% data variables.copilot.copilot_cli_short %} (default: `github.com`). Set to your {% data variables.product.prodname_ghe_cloud %} with data residency hostname. Override with `COPILOT_GH_HOST` for {% data variables.copilot.copilot_cli_short %} only. |
356383
| `GH_TOKEN` | Authentication token. Takes precedence over `GITHUB_TOKEN`. |
384+
| `GITHUB_COPILOT_PROMPT_MODE_EXTENSIONS` | Set to `true` to load project extensions and allow extension management tools in prompt mode (`-p`). Disabled by default to prevent running repository-controlled extension code without interactive trust. |
385+
| `GITHUB_COPILOT_PROMPT_MODE_REPO_HOOKS` | Set to `true` to load repository hooks in prompt mode (`-p`). Disabled by default to prevent running repository-provided hook commands without interactive trust confirmation. |
386+
| `GITHUB_COPILOT_PROMPT_MODE_WORKSPACE_MCP` | Set to `true` to load workspace MCP sources in prompt mode (`-p`). Disabled by default to prevent starting repository-controlled MCP servers without interactive trust. |
357387
| `GITHUB_TOKEN` | Authentication token. |
358388
| `PLAIN_DIFF` | Set to `true` to disable rich diff rendering. |
359389
| `USE_BUILTIN_RIPGREP` | Set to `false` to use the system ripgrep instead of the bundled version. |
@@ -452,14 +482,40 @@ Use `copilot mcp` to manage MCP server configurations from the command line with
452482
| `tools` | Yes | Tools to enable. |
453483
| `headers` | No | HTTP headers. Supports variable expansion. |
454484
| `oauthClientId` | No | Static OAuth client ID (skips dynamic registration). |
455-
| `oauthPublicClient` | No | Whether the OAuth client is public. Default: `true`. |
456-
| `oidc` | No | Enable OIDC token injection. When `true`, injects a `GITHUB_COPILOT_OIDC_MCP_TOKEN` environment variable (local servers) or a `Bearer` `Authorization` header (remote servers). |
485+
| `oauthPublicClient` | No | Whether the OAuth client is public. Default: `true`. Set to `false` for confidential clients with a stored secret. |
486+
| `oauthGrantType` | No | OAuth grant type: `"authorization_code"` (default, browser-based flow) or `"client_credentials"` (fully headless, no browser or callback). |
487+
| `oidc` | No | Enable OIDC token injection. When `true`, the CLI injects OIDC tokens for any `GITHUB_COPILOT_OIDC_MCP_TOKEN` or `GITHUB_COPILOT_OIDC_MCP_TOKEN_<SUFFIX>` variable referenced in the server's `env` block (local servers), or sends the token as a `Bearer` `Authorization` header (remote servers). For local servers, prefer suffixed variants (for example, `${GITHUB_COPILOT_OIDC_MCP_TOKEN_MY_SVC}`) to assign a unique variable name per server. |
457488
| `timeout` | No | Tool call timeout in milliseconds. |
458489

459490
### OAuth re-authentication
460491

461492
Remote MCP servers that use OAuth may show a `needs-auth` status when a token expires or when a different account is required. Use `/mcp auth <server-name>` to trigger a fresh OAuth flow. This opens a browser authentication prompt, allowing you to sign in or switch accounts. After completing the flow, the server reconnects automatically.
462493

494+
### Headless OAuth (`client_credentials` grant)
495+
496+
For CI or cron use cases where no browser is available, set `oauthGrantType: "client_credentials"`. This requires:
497+
498+
* `oauthClientId`—the static client ID issued by the MCP provider.
499+
* `oauthPublicClient: false`—the client is confidential.
500+
* A `client_secret` stored in the system keychain (configured once via the `/mcp` UI or by writing to the OAuth credential store).
501+
502+
When configured, the CLI skips the browser, callback server, PKCE, and dynamic client registration entirely. On every 401, it posts `grant_type=client_credentials` directly to the server's discovered token endpoint.
503+
504+
```json
505+
{
506+
"mcpServers": {
507+
"headless-api": {
508+
"type": "http",
509+
"url": "https://api.example.com/mcp",
510+
"tools": ["*"],
511+
"oauthClientId": "YOUR-CLIENT-ID",
512+
"oauthPublicClient": false,
513+
"oauthGrantType": "client_credentials"
514+
}
515+
}
516+
}
517+
```
518+
463519
### Filter mapping
464520

465521
Control how MCP tool output is processed using the `filterMapping` field in a server's configuration.
@@ -487,6 +543,12 @@ Use `--disable-builtin-mcps` to disable all built-in servers, or `--disable-mcp-
487543

488544
Server names can contain any printable characters, including spaces, Unicode characters, and punctuation. Control characters (U+0000–U+001F, U+007F) and the closing brace (`}`) are not allowed. Server names are used as prefixes for tool names—for example, a server named `my-server` produces tool names like `my-server-fetch`, and a server named `My Server` produces `My Server-fetch`.
489545

546+
### MCP tool name sanitization
547+
548+
MCP server names and tool names are sanitized before being sent to the model. Characters that are invalid in tool names (anything other than `a-z`, `A-Z`, `0-9`, `-`, `_`) are replaced with `-`. Unicode characters are Punycode-encoded. The `@` symbol is also replaced with `-` to avoid conflicts with Punycode encoding.
549+
550+
The combined name (`serverName-toolName`) is capped at 64 characters. When truncation would create a name collision, a numeric suffix is appended (for example, `my-server-tool2`, `my-server-tool3`) to ensure uniqueness.
551+
490552
### MCP server trust levels
491553

492554
MCP servers are loaded from multiple sources, each with a different trust level.
@@ -585,7 +647,6 @@ Custom agents are specialized AI agents defined in Markdown files. The filename
585647
| Agent | Default model | Description |
586648
|-------|--------------|-------------|
587649
| `code-review` | claude-sonnet-4.5 | High signal-to-noise code review. Analyzes diffs for bugs, security issues, and logic errors. |
588-
| `configure-copilot` | varies | Built-in sub-agent for managing {% data variables.copilot.copilot_cli_short %} configuration through natural language—adding MCP servers, installing agents, and managing skills. {% data reusables.copilot.experimental %} |
589650
| `explore` | claude-haiku-4.5 | Fast codebase exploration. Searches files, reads code, and answers questions. Returns focused answers under 300 words. Safe to run in parallel. |
590651
| `general-purpose` | claude-sonnet-4.5 | Full-capability agent for complex multi-step tasks. Runs in a separate context window. |
591652
| `research` | claude-sonnet-4.6 | Deep research agent. Generates a report based on information in your codebase, in relevant repositories, and on the web. |
@@ -636,7 +697,17 @@ When the CLI prompts for permission to execute an operation, you can respond wit
636697
| `#` | Deny all similar requests for the rest of the session. |
637698
| `?` | Show detailed information about the request. |
638699

639-
Session approvals reset when you run `/clear` or start a new session.
700+
When the full dialog is shown, you can also choose from these options:
701+
702+
| Option | Scope | Persistence |
703+
|--------|-------|-------------|
704+
| Once | Single use | None |
705+
| This location | Until manually cleared | Saved to disk per location |
706+
| Always | Permanent | Config file |
707+
708+
The **This location** option appears when the CLI can determine a location key (git root or current directory). It persists the approval to disk so the same permission is automatically granted the next time you work in that directory without prompting again.
709+
710+
Use `/permissions reset` to clear in-memory approvals for the current session.
640711

641712
## OpenTelemetry monitoring
642713

@@ -678,11 +749,12 @@ Wraps the entire agent invocation: all LLM calls and tool executions for one use
678749
|-----------|-------------|-----------|
679750
| `gen_ai.operation.name` | `invoke_agent` | Both |
680751
| `gen_ai.provider.name` | Provider (for example, `github`, `anthropic`) | Both |
681-
| `gen_ai.agent.id` | Session identifier | Both |
752+
| `gen_ai.agent.id` | Stable agent-definition identifier when known; top-level default uses `github.copilot.default` | Both |
682753
| `gen_ai.agent.name` | Agent name (when available) | Both |
683754
| `gen_ai.agent.description` | Agent description (when available) | Both |
684-
| `gen_ai.agent.version` | Runtime version | Both |
755+
| `gen_ai.agent.version` | Agent definition version when known; otherwise runtime version | Both |
685756
| `gen_ai.conversation.id` | Session identifier | Both |
757+
| `enduser.pseudo.id` | Pseudonymous Copilot user identifier from `analytics_tracking_id` when available | Both |
686758
| `gen_ai.request.model` | Requested model | Both |
687759
| `gen_ai.response.finish_reasons` | `["stop"]` or `["error"]` | Both |
688760
| `gen_ai.usage.input_tokens` | Total input tokens (all turns) | Both |
@@ -709,21 +781,22 @@ One span per LLM request. Span kind: `CLIENT`.
709781
| `gen_ai.operation.name` | `chat` |
710782
| `gen_ai.provider.name` | Provider name |
711783
| `gen_ai.request.model` | Requested model |
784+
| `gen_ai.request.stream` | Whether streaming mode was used (streaming only) |
712785
| `gen_ai.conversation.id` | Session identifier |
786+
| `gen_ai.response.finish_reasons` | Stop reasons |
713787
| `gen_ai.response.id` | Response ID |
714788
| `gen_ai.response.model` | Resolved model |
715-
| `gen_ai.response.finish_reasons` | Stop reasons |
789+
| `gen_ai.response.time_to_first_chunk` | Time to first streaming chunk, in seconds (streaming only) |
790+
| `gen_ai.usage.cache_creation.input_tokens` | Cached tokens created |
791+
| `gen_ai.usage.cache_read.input_tokens` | Cached tokens read |
716792
| `gen_ai.usage.input_tokens` | Input tokens this turn |
717793
| `gen_ai.usage.output_tokens` | Output tokens this turn |
718-
| `gen_ai.usage.cache_read.input_tokens` | Cached tokens read |
719-
| `gen_ai.usage.cache_creation.input_tokens` | Cached tokens created |
720794
| `github.copilot.cost` | Turn cost |
721795
| `github.copilot.aiu` | AI units consumed this turn |
722796
| `github.copilot.server_duration` | Server-side duration |
723797
| `github.copilot.initiator` | Request initiator |
724798
| `github.copilot.turn_id` | Turn identifier |
725799
| `github.copilot.interaction_id` | Interaction identifier |
726-
| `github.copilot.time_to_first_chunk` | Time to first streaming chunk, in seconds (streaming only) |
727800
| `server.address` | Server hostname |
728801
| `server.port` | Server port |
729802
| `error.type` | Error class name (on error) |

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ These settings apply across all your sessions and repositories. You can edit thi
225225
| `ide.autoConnect` | `boolean` | `true` | Automatically connect to an IDE workspace on startup. When `false`, you can still connect manually using the `/ide` command. |
226226
| `ide.openDiffOnEdit` | `boolean` | `true` | Open file edit diffs in the connected IDE for approval. When `false`, file edit approvals are shown only in the terminal. |
227227
| `includeCoAuthoredBy` | `boolean` | `true` | Add a `Co-authored-by` trailer to git commits made by the agent. |
228+
| `keepAlive` | `"on"` \| `"off"` \| `"busy"` | `"off"` | Keep-alive mode applied at CLI startup. `"on"` always prevents the system from sleeping, `"busy"` prevents sleeping only while the agent is running, and `"off"` disables keep-alive. Also configurable with the `/keep-alive` slash command. |
228229
| `logLevel` | `"none"` \| `"error"` \| `"warning"` \| `"info"` \| `"debug"` \| `"all"` \| `"default"` | `"default"` | Logging verbosity. |
229230
| `mergeStrategy` | `"rebase"` \| `"merge"` || Conflict resolution strategy for `/pr fix conflicts`. When set to `"rebase"`, conflicts are resolved by rebasing onto the base branch. When set to `"merge"`, the base branch is merged into the feature branch. If not configured, a picker dialog is shown. |
230231
| `model` | `string` | varies | AI model to use. Set to `"auto"` to let {% data variables.product.prodname_copilot_short %} pick the best available model automatically. Managed by the `/model` slash command. |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1a74df9f2a81e052650047d18b97fcf82300ba79
1+
391259f70310fc987767077c68d29b5e38b28263

0 commit comments

Comments
 (0)