Skip to content

Commit 027d11d

Browse files
authored
Copilot CLI: Correct the documentation for config.json (#60962)
1 parent 8470cf6 commit 027d11d

4 files changed

Lines changed: 33 additions & 24 deletions

File tree

content/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ By default, the CLI stores your OAuth token in your operating system's keychain
6767
| Windows | Credential Manager |
6868
| Linux | libsecret (GNOME Keyring, KWallet) |
6969

70-
If the system keychain is unavailable—for example, on a headless Linux server without `libsecret` installed—the CLI prompts you to store the token in a plaintext configuration file at `~/.copilot/settings.json`.
70+
If the system keychain is unavailable—for example, on a headless Linux server without `libsecret` installed—the CLI prompts you to store the token in a plaintext configuration file at `~/.copilot/config.json`.
7171

7272
When you run a command, {% data variables.copilot.copilot_cli_short %} checks for credentials in the following order:
7373

@@ -176,8 +176,8 @@ If you have {% data variables.product.prodname_cli %} installed and authenticate
176176

177177
## Switching between accounts
178178

179-
{% data variables.copilot.copilot_cli_short %} supports multiple accounts. You can list available accounts and switch between them from within the CLI.
180-
To list available accounts, run `/user list` from the {% data variables.copilot.copilot_cli_short %} prompt.
179+
{% data variables.copilot.copilot_cli_short %} supports multiple accounts. You can list available accounts and switch between them from within the CLI.
180+
To list available accounts, run `/user list` from the {% data variables.copilot.copilot_cli_short %} prompt.
181181
To switch to a different account, type `/user switch` on the prompt.
182182

183183
To add another account, run `copilot login` from a new terminal session, or run the login command from within the CLI and authorize with the other account.
@@ -190,7 +190,7 @@ To revoke the OAuth app authorization on {% data variables.product.github %} and
190190

191191
1. Navigate to **Settings** > **Applications** > **Authorized OAuth Apps**.
192192
1. Navigate to your settings page:
193-
1. In the upper-right corner of any page on {% data variables.product.prodname_dotcom %}, click your profile picture.
193+
1. In the upper-right corner of any page on {% data variables.product.prodname_dotcom %}, click your profile picture.
194194
1. Click **Settings**.
195195
1. In the left sidebar, click **Applications**.
196196
1. Under **Authorized OAuth Apps**, click {% octicon "kebab-horizontal" aria-label="The horizontal kebab icon" %} next to **GitHub CLI** to expand the menu and select **Revoke**.

content/copilot/how-tos/copilot-cli/set-up-copilot-cli/configure-copilot-cli.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ If you choose to trust the directory for future sessions, the trusted directory
3939

4040
### Editing trusted directories
4141

42-
You can edit the list of permanently trusted directories.
42+
You can edit the list of permanently trusted directories. Trusted directories are stored in the automatically managed `config.json` file.
4343

44-
1. Open the CLIs `settings.json` file. By default, its stored in a `.copilot` folder under your home directory:
44+
1. Open the CLI's `config.json` file. By default, it's stored in a `.copilot` folder under your home directory:
4545

46-
* **macOS/Linux**: `~/.copilot/settings.json`
47-
* **Windows**: `$HOME\.copilot\settings.json`
46+
* **macOS/Linux**: `~/.copilot/config.json`
47+
* **Windows**: `$HOME\.copilot\config.json`
4848

49-
You can change the config location by setting the `COPILOT_HOME` environment variable.
49+
You can change the config location by setting the `COPILOT_HOME` environment variable. This would change `~/.copilot/` and `$HOME\.copilot\` in the above paths.
5050

51-
1. Edit the contents of the `trusted_folders` array.
51+
1. Edit the contents of the `trustedFolders` array.
5252

5353
## Setting allowed tools
5454

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ copilot --allow-tool='MyMCP'
363363
For detailed information about configuration file settings—including the full list of user settings, repository settings, local settings, and how they cascade—see [AUTOTITLE](/copilot/reference/copilot-cli-reference/cli-config-dir-reference#configuration-file-settings).
364364

365365
> [!NOTE]
366-
> User settings were previously stored in `~/.copilot/config.json`. Existing settings in that location are automatically migrated to `~/.copilot/settings.json` on startup.
366+
> User settings were previously stored in `~/.copilot/config.json`. Existing user-editable settings in that location are automatically migrated to `~/.copilot/settings.json` on startup.
367367
368368
## Project initialization for {% data variables.product.prodname_copilot_short %}
369369

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

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,22 @@ The `~/.copilot` directory contains the following top-level items.
2323

2424
| Path | Type | Description |
2525
|------|------|-------------|
26-
| `settings.json` | File | Your personal configuration settings |
26+
| `agents/` | Directory | Personal custom agent definitions |
27+
| `config.json` | File | Automatically managed application state (authentication, installed plugins, and other internal data) |
2728
| `copilot-instructions.md` | File | Personal custom instructions (applied to all sessions) |
29+
| `hooks/` | Directory | User-level hook scripts |
30+
| `ide/` | Directory | IDE integration state |
31+
| `installed-plugins/` | Directory | Installed plugin files |
2832
| `instructions/` | Directory | Additional personal `*.instructions.md` files |
29-
| `mcp-config.json` | File | User-level MCP server definitions |
33+
| `logs/` | Directory | Session log files |
3034
| `lsp-config.json` | File | User-level LSP server definitions |
35+
| `mcp-config.json` | File | User-level MCP server definitions |
3136
| `permissions-config.json` | File | Saved tool and directory permissions per project |
32-
| `agents/` | Directory | Personal custom agent definitions |
33-
| `skills/` | Directory | Personal custom skill definitions |
34-
| `hooks/` | Directory | User-level hook scripts |
35-
| `logs/` | Directory | Session log files |
37+
| `plugin-data/` | Directory | Persistent data for installed plugins |
3638
| `session-state/` | Directory | Session history and workspace data |
3739
| `session-store.db` | File | SQLite database for cross-session data |
38-
| `installed-plugins/` | Directory | Installed plugin files |
39-
| `plugin-data/` | Directory | Persistent data for installed plugins |
40-
| `ide/` | Directory | IDE integration state |
40+
| `settings.json` | File | Your personal configuration settings |
41+
| `skills/` | Directory | Personal custom skill definitions |
4142

4243
> [!NOTE]
4344
> Not all of these items appear immediately. Some are created on demand the first time you use a particular feature—for example, `installed-plugins/` appears only after you install your first plugin.
@@ -51,7 +52,7 @@ The following files are designed to be edited by you directly, or managed throug
5152
This is the primary configuration file for {% data variables.copilot.copilot_cli_short %}. You can edit it directly in a text editor, or use interactive commands like `/model` and `/theme` to change specific values from within a session. The file supports JSON with comments (JSONC).
5253

5354
> [!NOTE]
54-
> The configuration file was renamed from `config.json` to `settings.json`. Existing settings are automatically migrated from `~/.copilot/config.json` on startup.
55+
> User-editable settings were originally stored in `config.json`. They have been moved to `settings.json`. Any user settings present in `config.json` on startup are automatically migrated to `settings.json`.
5556
5657
For the full list of settings and how they interact with repository-level configuration, see [Configuration file settings](#configuration-file-settings) later in this article.
5758

@@ -102,6 +103,13 @@ For more information, see [AUTOTITLE](/copilot/how-tos/copilot-cli/customize-cop
102103

103104
The following items are managed by the CLI. You generally should not edit them manually.
104105

106+
### `config.json`
107+
108+
Stores internal application state that is managed automatically by the CLI, including authentication data, installed plugin metadata, and other runtime information. You should not normally need to edit this file.
109+
110+
> [!NOTE]
111+
> Earlier versions of {% data variables.copilot.copilot_cli_short %} stored both user settings and application state in `config.json`. User-editable settings are now located in `settings.json`. Any user settings in `config.json` at startup are automatically migrated to `settings.json`. Application state fields—such as `loggedInUsers`, `installedPlugins`, `firstLaunchAt`, and `staff`—remain in `config.json` and are not migrated.
112+
105113
### `permissions-config.json`
106114

107115
Stores your saved tool and directory permission decisions, organized by project location. When you approve a tool or grant access to a directory, the CLI records the decision here so you aren't prompted again in the same project.
@@ -162,16 +170,17 @@ To override the default `~/.copilot` location, set the `COPILOT_HOME` environmen
162170
| Item | Safe to delete? | Effect |
163171
|------|-----------------|--------|
164172
| `agents/`, `skills/`, `hooks/` | Not recommended | You will lose your personal customizations. Back up first. |
173+
| `config.json` | With caution | Resets application state including authentication. You will need to re-authenticate and the CLI will re-detect internal state on next launch. |
165174
| `copilot-instructions.md`, `instructions/` | Not recommended | You will lose your personal custom instructions. Back up first. |
166-
| `installed-plugins/` | Not recommended | Use `copilot plugin uninstall` instead, to ensure plugin metadata in `settings.json` stays consistent. |
175+
| `installed-plugins/` | Not recommended | Use `copilot plugin uninstall` instead, to ensure plugin metadata in `config.json` remains accurate. |
167176
| `logs/` | Yes | Log files are re-created each session. Deleting them has no functional impact. |
168177
| `lsp-config.json` | Not recommended | You will lose your user-level LSP server definitions. Back up first. |
169178
| `mcp-config.json` | Not recommended | You will lose your user-level MCP server definitions. Back up first. |
170179
| `permissions-config.json` | With caution | Resets all saved permissions. The CLI will prompt you again for tool and directory approvals. |
171180
| `plugin-data/` | Yes | Plugin persistent data is re-created as needed. |
172181
| `session-state/` | With caution | Deleting removes session history. You will no longer be able to resume past sessions. |
173182
| `session-store.db` | With caution | Deleting removes cross-session data. The file is re-created automatically. |
174-
| `settings.json` | With caution | Resets all configuration to defaults. You will need to reconfigure your preferences and re-authenticate. |
183+
| `settings.json` | With caution | Resets all user preferences to defaults. You will need to reconfigure your settings. |
175184

176185
## Configuration file settings
177186

@@ -226,7 +235,7 @@ These settings apply across all your sessions and repositories. You can edit thi
226235
| `screenReader` | `boolean` | `false` | Enable screen reader optimizations. |
227236
| `skillDirectories` | `string[]` | `[]` | Additional directories to search for custom skill definitions (in addition to `~/.copilot/skills/`). |
228237
| `statusLine` | `object` || Custom status line display. `type`: must be `"command"`. `command`: path to an executable script that receives session JSON on stdin and prints status content to stdout. `padding`: optional number of left-padding spaces. |
229-
| `storeTokenPlaintext` | `boolean` | `false` | Store authentication tokens in plain text in the configuration file when no system keychain is available. |
238+
| `storeTokenPlaintext` | `boolean` | `false` | Allow authentication tokens to be stored in plain text in `config.json` when no system keychain is available. |
230239
| `stream` | `boolean` | `true` | Enable streaming responses. |
231240
| `streamerMode` | `boolean` | `false` | Hide preview model names and quota details. Useful when demonstrating {% data variables.copilot.copilot_cli_short %} or screen sharing. |
232241
| `theme` | `"auto"` \| `"dark"` \| `"light"` | `"auto"` | Terminal color theme. `"auto"` detects the terminal background and chooses accordingly. |

0 commit comments

Comments
 (0)