You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/copilot/reference/copilot-cli-reference/cli-command-reference.md
+43-10Lines changed: 43 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -167,6 +167,7 @@ With `--skill`, pass either a skill name or the path to a custom skill directory
167
167
|`@ FILENAME`| Include file contents in the context. |
168
168
|`# NUMBER`| Include a {% data variables.product.github %} issue or pull request in the context. |
169
169
|`! COMMAND`| Execute a command in your local shell, bypassing {% data variables.product.prodname_copilot_short %}. Enter `!` alone on an empty prompt to enter shell mode for running multiple shell commands in sequence. Press <kbd>Esc</kbd> or <kbd>Ctrl</kbd>+<kbd>C</kbd> on an empty prompt to exit shell mode. |
170
+
|`$`| Type a lone `$` at the prompt to hand the terminal over to a real interactive shell (`$SHELL` on Unix, `%COMSPEC%` on Windows) rooted at the session's working directory. Unlike `!` shell mode, this suspends the CLI UI entirely, so job control, full-screen apps, tab completion, and colors all work natively. Exit the shell (`exit`, or <kbd>Ctrl</kbd>+<kbd>D</kbd> on Unix) to return to the CLI. Only activates for a local, trusted, idle session on a real TTY. Can be disabled in enterprise managed settings. Disabled by default. Enable it with the `shellShortcut` setting—see [AUTOTITLE](/copilot/reference/copilot-cli-reference/cli-config-dir-reference#configuration-file-settings). |
170
171
|`?`| Open quick help (on an empty prompt). Press again to dismiss and insert a literal `?`. |
171
172
| <kbd>Esc</kbd> | Cancel the current operation. Press twice to interrupt the running turn, or to stop background agents when the main agent is idle. |
|`/every [INTERVAL PROMPT]`, `/every`| Schedule a recurring prompt, skill, or schedulable slash command for the current session (for example, `/every 1h run tests` or `/every 1d /chronicle standup`). With no arguments the schedule manager is displayed. {% data reusables.copilot.experimental %} |
293
-
|`/exit`, `/quit`|Exit the CLI. |
294
+
|`/exit`, `/quit`|Close the current session. If other sessions are running, this foregrounds the newest remaining one instead of quitting. Quits the CLI only when it is the last open session. `/exit print` always tears down the CLI and offers to dump the transcript. |
|`/experimental [on\|off\|show]`| Toggle, set, or show experimental features. |
296
297
|`/feedback`, `/bug`| Provide feedback about the CLI. |
@@ -308,10 +309,22 @@ These are the slash commands you can use from within an interactive CLI session.
308
309
|`/logout`| Log out of {% data variables.product.prodname_copilot_short %}. |
309
310
|`/lsp [show\|test\|reload\|logs\|help] [SERVER-NAME]`| Manage the language server configuration. The `logs` subcommand opens the live LSP services log panel. |
310
311
|`/mcp [list\|show\|add\|edit\|delete\|disable\|enable\|auth\|reload\|search] [SERVER-NAME]`| Manage the MCP server configuration. `list` (alias `ls`) prints a plain-text list of configured servers with connection status and live state, and is read-only, so it can run while the agent is busy processing a turn; all other subcommands are blocked until the turn finishes. Sandboxed local servers show a `connected (sandboxed)` status. See [AUTOTITLE](/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers#managing-mcp-servers). |
311
-
|`/model [--repo\|--local] [MODEL]`, `/models`| Select the AI model you want to use, or choose **Auto**. `--repo`/`--local` pins the default model in repository settings instead of the current session. Press <kbd>Tab</kbd> on a model with a long-context variant to toggle its Context column between the default and long-context window. See [AUTOTITLE](/copilot/concepts/models/auto-model-selection). |
312
+
|`/model [--repo\|--local\|--session] [MODEL]`, `/models`| Select the AI model you want to use, or choose **Auto**. `--repo`/`--local` pins the default model in repository settings instead of the current session; `--session` (alias `-s`) changes the model, reasoning effort, or context window for the current session only, without touching saved settings. Press <kbd>Tab</kbd> on a model with a long-context variant to toggle its Context column between the default and long-context window. See [AUTOTITLE](/copilot/concepts/models/auto-model-selection). |
312
313
|`/permissions [show\|reset]`| View or clear in-memory tool and path approvals for the current session. |
313
314
|`/plan [PROMPT]`| Create an implementation plan before coding. |
314
-
|`/plugin [marketplace\|install\|uninstall\|update\|list] [ARGS...]`| Manage plugins and plugin marketplaces. `list` (alias `ls`, including bare `/plugin`) is read-only and can run while the agent is busy processing a turn; all other subcommands are blocked until the turn finishes. See [AUTOTITLE](/copilot/concepts/agents/about-plugins). |
315
+
|`/plugins` (alias `/plugin`) | Manage plugins, MCP servers, and skills; opens the plugins dashboard, or run with `--plugin`, `--mcp`, or `--skill` to open it focused on that tab. See [AUTOTITLE](/copilot/concepts/agents/about-plugins). |
316
+
|`/plugins help`| Show full `/plugins` command usage. |
317
+
|`/plugins install SOURCE`| Install a plugin from a marketplace spec, {% data variables.product.github %} repository, git URL, or local path. |
318
+
|`/plugins install --skill [--project] <FILE\|URL\|DIRECTORY>`| Install a skill; `--project` scopes a file or URL install to this repository instead of your user account. |
319
+
|`/plugins update PLUGIN[@MARKETPLACE]`| Update an installed plugin. |
320
+
|`/plugins uninstall PLUGIN[@MARKETPLACE]`| Uninstall a plugin. |
321
+
|`/plugins list` (alias `/plugin ls`) | List installed plugins. |
322
+
|`/plugins enable\|disable\|remove --plugin\|--mcp\|--skill NAME`| Enable, disable, or remove/uninstall a plugin, MCP server, or skill by name; defaults to `--plugin` when no kind is given. |
323
+
|`/plugins marketplace add SOURCE`| Add a marketplace. |
324
+
|`/plugins marketplace remove NAME`| Remove a marketplace. |
325
+
|`/plugins marketplace list`| List registered marketplaces. |
326
+
|`/plugins marketplace browse NAME`| Browse plugins in a marketplace. |
327
+
|`/plugins mcp [SUBCOMMAND]`| Delegates to `/mcp`; manage MCP servers from the plugins dashboard. |
315
328
|`/pr [view\|create\|fix\|auto\|automerge]`| Manage pull requests for the current branch. `auto` drives the pull request to green and stops; `automerge` (alias: `agentmerge`) drives the pull request to green and merges it. See [AUTOTITLE](/copilot/how-tos/copilot-cli/use-copilot-cli/manage-pull-requests). |
316
329
|`/refine TEXT`| Rewrite a roughly composed prompt into a clear one for review. Run with no arguments (via <kbd>Ctrl</kbd>+<kbd>X</kbd> then `/refine`) to clean up the current input box. Can be particularly useful for prompts entered by speaking. |
317
330
|`/remote [on\|off]`| Show the remote control status (if no argument provided), enable remote steering (`on`), or end the remote connection (`off`). See [AUTOTITLE](/copilot/how-tos/copilot-cli/use-copilot-cli/steer-remotely). |
@@ -326,7 +339,7 @@ These are the slash commands you can use from within an interactive CLI session.
326
339
|`/search [QUERY]`, `/find [QUERY]`| Search the conversation timeline. {% data reusables.copilot.experimental %} |
327
340
|`/security-review [PROMPT]`| Run a focused security review of active local code changes and return prioritized vulnerability findings with remediation suggestions. This command is not a full repository security audit. |
328
341
|`/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. The `info` subcommand shows session details including the session link (when available). Subcommands: `info`, `checkpoints`, `files`, `plan`, `rename`, `cleanup`, `prune`, `delete`, `delete-all`. |
329
-
|`/settings [--repo\|--local] [show KEY\|KEY\|KEY VALUE]`,<br>`/config [--repo\|--local] [show KEY\|KEY\|KEY VALUE]`| Open the settings dialog, open it focused on a specific setting (`KEY`), set a setting inline (`KEY VALUE`), or display a setting's current value (`show KEY`). The dialog shows **User**, **Repo**, and **Repo (local)** tabs—switch with <kbd>Tab</kbd>/<kbd>Shift</kbd>+<kbd>Tab</kbd>; a setting overridden in another scope shows a badge naming which scope wins. Add `--repo` or `--local` to target `.github/copilot/settings.json` or `.github/copilot/settings.local.json` instead of the user settings file—for example, `/settings --repo model gpt-5.2`. Only [repo-overridable keys](/copilot/reference/copilot-cli-reference/cli-config-dir-reference#repository-settings-githubcopilotsettingsjson) can be set this way. Rows governed by an active organization or MDM managed policy render read-only with a `(managed)` tag. See [AUTOTITLE](/copilot/how-tos/copilot-cli/customize-copilot/change-settings). |
342
+
| `/settings [--repo\|--local] [show KEY\|KEY\|KEY VALUE]`,<br>`/config [--repo\|--local] [show KEY\|KEY\|KEY VALUE]` | Open the settings dialog, open it focused on a specific setting (`KEY`), set a setting inline (`KEY VALUE`), or display a setting's current value (`show KEY`). `show` masks secret-named values (for example, tokens or API keys nested under a setting) instead of printing them in clear text. The dialog shows **User**, **Repo**, and **Repo (local)** tabs—switch with <kbd>Tab</kbd>/<kbd>Shift</kbd>+<kbd>Tab</kbd>; a setting overridden in another scope shows a badge naming which scope wins. Add `--repo` or `--local` to target `.github/copilot/settings.json` or `.github/copilot/settings.local.json` instead of the user settings file—for example, `/settings --repo model gpt-5.2`. Only [repo-overridable keys](/copilot/reference/copilot-cli-reference/cli-config-dir-reference#repository-settings-githubcopilotsettingsjson) can be set this way. Rows governed by an active organization or MDM managed policy render read-only with a `(managed)` tag. See [AUTOTITLE](/copilot/how-tos/copilot-cli/customize-copilot/change-settings). |
330
343
|`/share [link\|off\|file\|html\|gist\|research] [...]`, `/export [...]`| Share the current session. With no subcommand, generates a shareable {% data variables.product.github %} link when you're logged in and synced (falls back to Markdown file export otherwise). `off` stops sharing. `link` is an explicit alias for the default link flow; `link off` stops link sharing. `file [session\|research] [PATH]` exports to a Markdown file. `html [session\|research] [PATH]` exports to an HTML file. `gist [session\|research]` creates a {% data variables.product.github %} gist. `research [PATH]` exports the research report. |
331
344
|`/skills [list\|info\|add\|remove\|reload] [ARGS...]`| Manage skills for enhanced capabilities. See [AUTOTITLE](/copilot/how-tos/copilot-cli/customize-copilot/add-skills). |
332
345
|`/statusline`, `/footer`| Configure which items appear in the status line. |
@@ -412,7 +425,7 @@ For a complete list of available slash commands enter `/help` in the CLI's inter
412
425
|`--plugin-dir=DIRECTORY`| Load a plugin from a local directory (can be used multiple times). |
413
426
|`--remote`| Enable remote access to this session from {% data variables.product.prodname_dotcom_the_website %} and {% data variables.product.prodname_mobile %}. See [AUTOTITLE](/copilot/how-tos/copilot-cli/use-copilot-cli/steer-remotely). |
414
427
|`--remote-export`| Export your session to {% data variables.product.prodname_dotcom_the_website %} and {% data variables.product.prodname_mobile %} (read-only; does not enable remote control). |
415
-
|`-r`, `--resume[=VALUE]`| Resume a previous interactive session by choosing from a list. Optionally specify a session ID, ID prefix, or session name. Name matching is exact and case-insensitive; falls back to the auto-generated summary when no explicit name matches. Conflicts with `--continue`. |
428
+
|`-r`, `--resume[=VALUE]`| Resume a previous interactive session by choosing from a list. Optionally specify a session ID, ID prefix, or session name. Name matching is exact and case-insensitive; falls back to the auto-generated summary when no explicit name matches. Conflicts with `--continue`. Bare `--resume` (no value) shows an interactive session picker, which requires a TTY. If multiple sessions exist and the picker can't be shown (for example under `-p`, a non-TTY `-i`, or piped stdin), the CLI exits with an error instead of silently starting a new session—pass an explicit `--resume=SESSION-ID` or use `--continue`. |
416
429
|`-s`, `--silent`| Output only the agent response (without usage statistics), useful for scripting with `-p`. |
|`--secret-env-vars=VAR ...`| Redact an environment variable from shell and MCP server environments (can be used multiple times). For multiple variables, use a quoted, comma-separated list. The values in the `GITHUB_TOKEN` and `COPILOT_GITHUB_TOKEN` environment variables are redacted from output by default. |
@@ -626,6 +639,10 @@ MCP servers provide additional tools to the CLI agent. Configure persistent serv
626
639
627
640
Local (stdio) servers that spawn inside the sandbox (see the `/sandbox` slash command) show a `connected (sandboxed)` status in `copilot mcp list` and `/mcp list`, since remote (HTTP/SSE) servers are never sandboxed. {% data reusables.copilot.experimental %}
628
641
642
+
`copilot mcp list` and `/mcp list` mark a disabled server with a `(disabled)` suffix in text output, or `"enabled": false` per server in `--json` output. `copilot mcp get` shows a `Status: Enabled`/`Disabled` line.
643
+
644
+
Toggling `/sandbox` restarts only local (stdio) MCP servers, since they spawn inside the sandbox. Remote (HTTP/SSE) servers stay connected.
645
+
629
646
### `copilot mcp` subcommand
630
647
631
648
Use `copilot mcp` to manage MCP server configurations from the command line without starting an interactive session.
@@ -898,6 +915,20 @@ Remote skills are projected alongside local skills and follow the same name-base
898
915
899
916
When two plugins provide skills with the same name, both coexist using plugin-qualified invocation names such as `/my-plugin/search` and `/other-plugin/search`. The bare name routes to the higher-priority plugin. This applies to skills only; commands keep the standard tier-based deduplication, where the higher-priority source wins.
900
917
918
+
### Installing a skill non-interactively
919
+
920
+
Use `copilot plugins install --skill` to install a skill from a file, URL, or directory without opening an interactive session:
Installing a directory registers it as a custom skill source rather than copying it. Installing a file or URL copies the skill's content into your personal or project skills directory. The equivalent interactive command is `/plugins install --skill [--project] <FILE|URL|DIRECTORY>`. For the full option reference, see [AUTOTITLE](/copilot/reference/copilot-cli-reference/cli-plugin-reference#copilot-plugins-install-options).
931
+
901
932
### Commands (alternative skill format)
902
933
903
934
Commands are an alternative to skills stored as individual `.md` files in `.claude/commands/`. The command name is derived from the filename. Command files use a simplified format (no `name` field required) and support `argument-hint`, `description`, `allowed-tools`, and `disable-model-invocation`. Commands have lower priority than skills with the same name.
@@ -1180,10 +1211,10 @@ The runtime emits a hierarchical span tree for each agent interaction. Each tree
1180
1211
1181
1212
Wraps the entire agent invocation: all LLM calls and tool executions for one user message.
1182
1213
1183
-
***Top-level sessions** use span kind `CLIENT` (remote service invocation) with `server.address` and `server.port`.
1184
-
***Subagent invocations**(for example, explore, task) use span kind `INTERNAL` (in-process) without server attributes.
1214
+
*Both **top-level sessions**and **subagent invocations** (for example, explore, task) use span kind `INTERNAL` (in-process); provider-facing inference is represented by child `CLIENT``chat` spans.
1215
+
***Top-level sessions**additionally carry `server.address` and `server.port`; subagent invocations do not.
1185
1216
1186
-
| Attribute | Description |Span kind|
1217
+
| Attribute | Description |Scope|
1187
1218
|-----------|-------------|-----------|
1188
1219
|`gen_ai.operation.name`|`invoke_agent`| Both |
1189
1220
|`gen_ai.provider.name`| Provider (for example, `github`, `anthropic`) | Both |
@@ -1202,8 +1233,8 @@ Wraps the entire agent invocation: all LLM calls and tool executions for one use
1202
1233
|`github.copilot.turn_count`| Number of LLM round-trips | Both |
1203
1234
|`github.copilot.cost`| Monetary cost | Both |
1204
1235
|`github.copilot.aiu`| AI units consumed | Both |
1205
-
|`server.address`| Server hostname |`CLIENT` only |
1206
-
|`server.port`| Server port |`CLIENT` only |
1236
+
|`server.address`| Server hostname |Top-level only |
1237
+
|`server.port`| Server port |Top-level only |
1207
1238
|`error.type`| Error class name (on error) | Both |
1208
1239
|`gen_ai.input.messages`| Full input messages as JSON (content capture only) | Both |
1209
1240
|`gen_ai.output.messages`| Full output messages as JSON (content capture only) | Both |
@@ -1268,6 +1299,8 @@ One span per tool call. Span kind: `INTERNAL`.
1268
1299
|`gen_ai.client.token.usage`| Histogram | tokens | Token counts by type (`input`/`output`) |
1269
1300
|`gen_ai.client.operation.time_to_first_chunk`| Histogram | s | Time to receive first streaming chunk |
1270
1301
|`gen_ai.client.operation.time_per_output_chunk`| Histogram | s | Inter-chunk latency after first chunk |
1302
+
|`gen_ai.invoke_agent.inference_calls`| Histogram |`{inference_call}`| Number of model calls made during one agent invocation, counted at provider dispatch (failed and partial calls included; requests blocked before dispatch excluded). Dimension: `gen_ai.agent.name`. |
1303
+
|`gen_ai.invoke_agent.tool_calls`| Histogram |`{tool_call}`| Number of client-side tool calls made during one agent invocation (failed and partial calls included; synthetic CLI tool lifecycles and provider-executed server-side tools excluded). Dimension: `gen_ai.agent.name`. |
0 commit comments