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
|`--host HOST`| {% data variables.product.github %} host URL (default: `https://github.com`). Use this to authenticate with a {% data variables.product.prodname_ghe_cloud %} instance that uses data residency (for example, `https://example.ghe.com`). |
36
-
|`--config-dir PATH`| Set the configuration directory (default: `~/.copilot`). |
37
36
38
-
The default authentication mode is a web-based browser flow. After completion, an authentication token is stored securely in the system credential store. If a credential store is not found, the token is stored in a plain text config file under `~/.copilot/`.
37
+
The default authentication mode is a web-based browser flow. After completion, an authentication token is stored securely in the system credential store. If a credential store is not found, the token is stored in a plain text config file under `~/.copilot/` (or the directory specified by `COPILOT_HOME` if set).
39
38
40
39
Alternatively, {% data variables.copilot.copilot_cli_short %} will use an authentication token found in environment variables. The following are checked in order of precedence: `COPILOT_GITHUB_TOKEN`, `GH_TOKEN`, `GITHUB_TOKEN`. This method is most suitable for headless use such as automation.
41
40
@@ -182,7 +181,6 @@ For a complete list of available slash commands enter `/help` in the CLI's inter
182
181
|`--available-tools=TOOL ...`| Only these tools will be available to the model. For multiple tools, use a quoted, comma-separated list. See [AUTOTITLE](/copilot/how-tos/copilot-cli/allowing-tools). |
183
182
|`--banner`, `--no-banner`| Show or hide the startup banner. |
184
183
|`--bash-env`| Enable `BASH_ENV` support for bash shells. |
185
-
|`--config-dir=PATH`| Set the configuration directory (default: `~/.copilot`). |
186
184
|`--connect[=SESSION-ID]`| Connect directly to a remote session (optionally specify a session ID or task ID). Conflicts with `--resume` and `--continue`. |
187
185
|`--continue`| Resume the most recent session in the current working directory, falling back to the globally most recent session. |
188
186
|`--deny-tool=TOOL ...`| Tools the CLI does not have permission to use. Will not prompt for permission. For multiple tools, use a quoted, comma-separated list. |
@@ -944,7 +942,6 @@ Use `copilot mcp` to manage MCP server configurations from the command line with
944
942
|`--timeout <ms>`| Timeout in milliseconds. |
945
943
|`--json`| Output added configuration as JSON. |
946
944
|`--show-secrets`| Show full environment variable and header values. |
947
-
|`--config-dir <path>`| Path to the configuration directory. |
948
945
949
946
> [!CAUTION]
950
947
> `--show-secrets` can print sensitive environment variable and header values to your terminal or logs. Only use this option in trusted environments, and avoid copying, pasting, or otherwise capturing the output in shared logs or history.
Copy file name to clipboardExpand all lines: content/copilot/reference/copilot-cli-reference/cli-config-dir-reference.md
+7-17Lines changed: 7 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,30 +140,20 @@ Contains lock files and state for IDE integrations (for example, when {% data va
140
140
141
141
## Changing the location of the configuration directory
142
142
143
-
You can override the default `~/.copilot` location in two ways:
144
-
145
-
-**Environment variable**: Set `COPILOT_HOME` to the path of the directory you want to use.
143
+
To override the default `~/.copilot` location, set the `COPILOT_HOME` environment variable to the path of the directory you want to use.
146
144
147
145
```bash copy
148
146
export COPILOT_HOME=/path/to/my/copilot-config
149
147
```
150
148
151
-
-**Command-line option**: Use `--config-dir` when launching the CLI.
152
-
153
-
```bash copy
154
-
copilot --config-dir /path/to/my/copilot-config
155
-
```
156
-
157
-
The `--config-dir` option takes precedence over `COPILOT_HOME`, which in turn takes precedence over the default `~/.copilot` location.
158
-
159
149
### Things to be aware of
160
150
161
-
-`COPILOT_HOME` replaces the entire `~/.copilot` path. The value you set should be the complete path to the directory you want to use for the configuration files and subdirectories.
162
-
- Changing the directory means your existing configuration, session history, installed plugins, and saved permissions will not be found in the new location. Copy or move the contents of `~/.copilot` to the new location if you want to preserve them.
163
-
- The **cache directory** (used for marketplace caches, auto-update packages, and other ephemeral data) follows platform conventions and is not affected by `COPILOT_HOME`. It is located at:
164
-
-**macOS**: `~/Library/Caches/copilot`
165
-
-**Linux**: `$XDG_CACHE_HOME/copilot` or `~/.cache/copilot`
166
-
-**Windows**: `%LOCALAPPDATA%/copilot`
151
+
*`COPILOT_HOME` replaces the entire `~/.copilot` path. The value you set should be the complete path to the directory you want to use for the configuration files and subdirectories.
152
+
* Changing the directory means your existing configuration, session history, installed plugins, and saved permissions will not be found in the new location. Copy or move the contents of `~/.copilot` to the new location if you want to preserve them.
153
+
* The **cache directory** (used for marketplace caches, auto-update packages, and other ephemeral data) follows platform conventions and is not affected by `COPILOT_HOME`. It is located at:
154
+
***macOS**: `~/Library/Caches/copilot`
155
+
***Linux**: `$XDG_CACHE_HOME/copilot` or `~/.cache/copilot`
156
+
***Windows**: `%LOCALAPPDATA%/copilot`
167
157
168
158
To override the cache directory separately, set `COPILOT_CACHE_HOME`.
0 commit comments