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/how-tos/copilot-cli/use-copilot-cli-agents/invoke-custom-agents.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Invoking custom agents
2
+
title: Invoking custom agents
3
3
shortTitle: Invoke custom agents
4
4
intro: Use custom agents, skills, and MCP servers in {% data variables.copilot.copilot_cli_short %} to extend its capabilities.
5
5
product: '{% data reusables.gated-features.copilot-cli %}'
@@ -102,7 +102,7 @@ To extend the functionality available to you in {% data variables.copilot.copilo
102
102
1. Fill in the details for the MCP server you want to add, using the <kbd>Tab</kbd> key to move between fields.
103
103
1. Press <kbd>Ctrl</kbd>+<kbd>S</kbd> to save the details.
104
104
105
-
Details of your configured MCP servers are stored in the `mcp-config.json` file, which is located, by default, in the `~/.copilot` directory. This location can be changed by setting the `XDG_CONFIG_HOME` environment variable. For information about the JSON structure of a server definition, see [AUTOTITLE](/copilot/how-tos/use-copilot-agents/coding-agent/extend-coding-agent-with-mcp#writing-a-json-configuration-for-mcp-servers).
105
+
Details of your configured MCP servers are stored in the `mcp-config.json` file, which is located, by default, in the `~/.copilot` directory. This location can be changed by setting the `COPILOT_HOME` environment variable. For information about the JSON structure of a server definition, see [AUTOTITLE](/copilot/how-tos/use-copilot-agents/coding-agent/extend-coding-agent-with-mcp#writing-a-json-configuration-for-mcp-servers).
106
106
107
107
For more detailed information on adding and managing MCP servers in {% data variables.copilot.copilot_cli_short %}, see [AUTOTITLE](/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers).
Copy file name to clipboardExpand all lines: content/copilot/how-tos/copilot-cli/use-copilot-cli-agents/overview.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -231,7 +231,7 @@ To extend the functionality available to you in {% data variables.copilot.copilo
231
231
1. Fill in the details for the MCP server you want to add, using the <kbd>Tab</kbd> key to move between fields.
232
232
1. Press <kbd>Ctrl</kbd>+<kbd>S</kbd> to save the details.
233
233
234
-
Details of your configured MCP servers are stored in the `mcp-config.json` file, which is located, by default, in the `~/.copilot` directory. This location can be changed by setting the `XDG_CONFIG_HOME` environment variable. For information about the JSON structure of a server definition, see [AUTOTITLE](/copilot/how-tos/use-copilot-agents/coding-agent/extend-coding-agent-with-mcp#writing-a-json-configuration-for-mcp-servers).
234
+
Details of your configured MCP servers are stored in the `mcp-config.json` file, which is located, by default, in the `~/.copilot` directory. This location can be changed by setting the `COPILOT_HOME` environment variable. For information about the JSON structure of a server definition, see [AUTOTITLE](/copilot/how-tos/use-copilot-agents/coding-agent/extend-coding-agent-with-mcp#writing-a-json-configuration-for-mcp-servers).
235
235
236
236
### Context management
237
237
@@ -269,7 +269,7 @@ For additional information use one of the following commands in your terminal:
269
269
270
270
`copilot help config`
271
271
272
-
You can adjust the configuration settings by editing the `config.json` file, which is located, by default, in the `~/.copilot` directory. This location can be changed by setting the `XDG_CONFIG_HOME` environment variable.
272
+
You can adjust the configuration settings by editing the `config.json` file, which is located, by default, in the `~/.copilot` directory. This location can be changed by setting the `COPILOT_HOME` environment variable.
273
273
274
274
***Environment variables** that affect {% data variables.copilot.copilot_cli_short %}:
|`COPILOT_SKILLS_DIRS`| Comma-separated list of additional directories for skills. |
205
206
|`COPILOT_EDITOR`| Editor command for interactive editing (checked after `$VISUAL` and `$EDITOR`). Defaults to `vi` if none are set. |
206
207
|`COPILOT_GITHUB_TOKEN`| Authentication token. Takes precedence over `GH_TOKEN` and `GITHUB_TOKEN`. |
208
+
|`COPILOT_HOME`| Override the configuration and state directory. Default: `$HOME/.copilot`. |
207
209
|`GH_TOKEN`| Authentication token. Takes precedence over `GITHUB_TOKEN`. |
208
210
|`GITHUB_TOKEN`| Authentication token. |
209
-
|`XDG_CONFIG_HOME`| Override the configuration directory. Default: `$HOME/.copilot`. |
210
-
|`XDG_STATE_HOME`| Override the state directory. Default: `$HOME/.copilot`. |
211
211
|`USE_BUILTIN_RIPGREP`| Set to `false` to use the system ripgrep instead of the bundled version. |
212
212
|`PLAIN_DIFF`| Set to `true` to disable rich diff rendering. |
213
213
|`COLORFGBG`| Fallback for dark/light terminal background detection. |
214
214
|`COPILOT_CLI_ENABLED_FEATURE_FLAGS`| Comma-separated list of feature flags to enable (for example, `"SOME_FEATURE,SOME_OTHER_FEATURE"`). |
215
215
216
216
## Configuration file settings
217
217
218
-
User settings are stored in `~/.copilot/config.json`. Project-level settings can be placed in `.copilot/settings.json` (committed to the repository) or `.copilot/settings.local.json` (personal overrides—add to `.gitignore`). Settings cascade from user to project to local, with more specific scopes overriding more general ones. Command-line flags and environment variables always take the highest precedence.
218
+
Settings cascade from user to repository to local, with more specific scopes overriding more general ones. Command-line flags and environment variables always take the highest precedence.
219
+
220
+
| Scope | Location | Purpose |
221
+
|-------|----------|---------|
222
+
| User |`~/.copilot/config.json`| Global defaults for all repositories. Use the `COPILOT_HOME` environment variable to specify an alternative path. |
223
+
| Repository |`.github/copilot/settings.json`| Shared repository configuration (committed to the repository). |
224
+
| Local |`.github/copilot/settings.local.json`| Personal overrides (add this to `.gitignore`). |
225
+
226
+
### User settings (`~/.copilot/config.json`)
219
227
220
228
| Key | Type | Default | Description |
221
229
|-----|------|---------|-------------|
@@ -230,7 +238,7 @@ User settings are stored in `~/.copilot/config.json`. Project-level settings can
230
238
|`denied_urls`|`string[]`|`[]`| URLs or domains blocked (takes precedence over `allowed_urls`). |
|`model`|`string`| varies | AI model to use (see the `/model` command). |
236
244
|`reasoning_effort`|`"low"`\|`"medium"`\|`"high"`\|`"xhigh"`|`"medium"`| Reasoning effort level for extended thinking. Higher levels use more compute. |
@@ -243,13 +251,33 @@ User settings are stored in `~/.copilot/config.json`. Project-level settings can
243
251
|`trusted_folders`|`string[]`|`[]`| Folders with pre-granted file access. |
244
252
|`update_terminal_title`|`boolean`|`true`| Show the current intent in the terminal title. |
Repository settings apply to everyone who works in the repository. Only a subset of settings is supported at the repository level. Unsupported keys are ignored.
|`enabledPlugins`|`Record<string, boolean>`| Merged—repository overrides user for same key | Declarative plugin auto-install. |
262
+
|`marketplaces`|`Record<string, {...}>`| Merged—repository overrides user for same key | Plugin marketplaces available in this repository. |
263
+
264
+
### Local settings (`.github/copilot/settings.local.json`)
265
+
266
+
Create `.github/copilot/settings.local.json` in the repository, for personal overrides that should not be committed. Add this file to `.gitignore`.
267
+
268
+
The local configuration file uses the same schema as the repository configuration file (`.github/copilot/settings.json`) and takes precedence over it.
269
+
246
270
## Hooks reference
247
271
248
272
Hooks are external commands that execute at specific lifecycle points during a session, enabling custom automation, security controls, and integrations. Hook configuration files are loaded automatically from `.github/hooks/*.json` in your repository.
249
273
250
274
### Hook configuration format
251
275
252
-
Hook configuration files use JSON format with version `1`:
276
+
Hook configuration files use JSON format with version `1`.
277
+
278
+
#### Command hooks
279
+
280
+
Command hooks run shell scripts and are supported on all hook types.
253
281
254
282
```json
255
283
{
@@ -278,6 +306,29 @@ Hook configuration files use JSON format with version `1`:
278
306
|`env`| object | No | Environment variables to set (supports variable expansion). |
279
307
|`timeoutSec`| number | No | Timeout in seconds. Default: `30`. |
280
308
309
+
#### Prompt hooks
310
+
311
+
Prompt hooks auto-submit text as if the user typed it. They are only supported on `sessionStart` and run before any initial prompt passed via `--prompt`. The text can be a natural language prompt or a slash command.
312
+
313
+
```json
314
+
{
315
+
"version": 1,
316
+
"hooks": {
317
+
"sessionStart": [
318
+
{
319
+
"type": "prompt",
320
+
"prompt": "Your prompt text or /slash-command"
321
+
}
322
+
]
323
+
}
324
+
}
325
+
```
326
+
327
+
| Field | Type | Required | Description |
328
+
|-------|------|----------|-------------|
329
+
|`type`|`"prompt"`| Yes | Must be `"prompt"`. |
330
+
|`prompt`| string | Yes | Text to submit—can be a natural language message or a slash command. |
0 commit comments