Skip to content

Commit 4902a54

Browse files
authored
Merge pull request #44016 from github/repo-sync
Repo sync
2 parents af20860 + 027d11d commit 4902a54

8 files changed

Lines changed: 217 additions & 54 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/how-tos/copilot-cli/use-copilot-cli-agents/delegate-tasks-to-cca.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: Delegating tasks to {% data variables.copilot.copilot_cli %}
3-
shortTitle: Delegate tasks to Copilot
4-
intro: Use {% data variables.copilot.copilot_cli_short %}''s autopilot mode to hand off tasks and have {% data variables.product.prodname_copilot_short %} work autonomously on your behalf.
2+
title: Delegating tasks to {% data variables.product.prodname_copilot_short %}
3+
shortTitle: Delegate tasks to {% data variables.product.prodname_copilot_short %}
4+
intro: Use autopilot mode, or the `/delegate` slash command, to get {% data variables.product.prodname_copilot_short %} to work autonomously on your behalf.
55
allowTitleToDifferFromFilename: true
66
product: '{% data reusables.gated-features.copilot-cli %}'
77
versions:
@@ -13,9 +13,13 @@ docsTeamMetrics:
1313
- copilot-cli
1414
---
1515

16-
## Get {% data variables.product.prodname_copilot_short %} to work autonomously
16+
{% data variables.copilot.copilot_cli_short %} offers two ways to have {% data variables.product.prodname_copilot_short %} work autonomously: **autopilot mode** and the **`/delegate` command**. Both let you hand off tasks, but they differ in where the work happens:
1717

18-
You can tell {% data variables.product.prodname_copilot_short %} to use its best judgment to complete a task autonomously, rather than the CLI prompting you for input at each decision point within a task. You do this by using the CLI's autopilot mode.
18+
* **Autopilot mode** runs locally in your CLI session. You give autopilot full permissions and {% data variables.product.prodname_copilot_short %} then works on a task without stopping to prompt you for input. Your local machine does the work, and you can watch progress in real time. Use autopilot when you want hands-free local execution.
19+
20+
* **`/delegate`** pushes the task to {% data variables.copilot.copilot_cloud_agent %} on {% data variables.product.github %}. The work runs remotely: {% data variables.product.prodname_copilot_short %} creates a branch, opens a draft pull request, and works in the background. Use `/delegate` when you want to hand off a task entirely and continue running even if you shut down your local machine.
21+
22+
## Get autopilot to complete tasks autonomously on your local machine
1923

2024
There are two ways to use autopilot mode:
2125

@@ -26,9 +30,7 @@ For more information, see [AUTOTITLE](/copilot/concepts/agents/copilot-cli/autop
2630

2731
## Delegate tasks to {% data variables.copilot.copilot_cloud_agent %}
2832

29-
The delegate command lets you push your current session to {% data variables.copilot.copilot_cloud_agent %} on {% data variables.product.github %}. This lets you hand off work while preserving all the context {% data variables.product.prodname_copilot_short %} needs to complete your task.
30-
31-
You can delegate a task using the slash command, followed by a prompt:
33+
You can delegate a task to {% data variables.copilot.copilot_cloud_agent %} on {% data variables.product.github %} by using the `/delegate`slash command, followed by a prompt:
3234

3335
```shell
3436
/delegate complete the API integration tests and fix any failing edge cases

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

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ docsTeamMetrics:
1919
| Command | Purpose |
2020
|------------------------|----------------------------------------------------|
2121
| `copilot` | Launch the interactive user interface. |
22+
| `copilot completion SHELL` | Print a shell script for the chosen shell that can be used to enable tab completion for {% data variables.copilot.copilot_cli_short %}. Supported shells: `bash`, `zsh`, `fish`. See [Using `copilot completion`](#using-copilot-completion). |
2223
| `copilot help [TOPIC]` | Display help information. Help topics include: `config`, `commands`, `environment`, `logging`, `monitoring`, `permissions`, and `providers`. |
2324
| `copilot init` | Initialize {% data variables.product.prodname_copilot_short %} custom instructions for this repository. |
2425
| `copilot login` | Authenticate with {% data variables.product.prodname_copilot_short %} via the OAuth device flow. Accepts `--host HOST` to specify the {% data variables.product.github %} host URL (default: `https://github.com`). |
@@ -33,9 +34,8 @@ docsTeamMetrics:
3334
| Option | Purpose |
3435
|-------------------------|-----------------------------------------------------------------------------------------------|
3536
| `--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`). |
3737

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/`.
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/` (or the directory specified by `COPILOT_HOME` if set).
3939

4040
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.
4141

@@ -54,6 +54,38 @@ copilot login --host https://example.ghe.com
5454
COPILOT_GITHUB_TOKEN=github_pat_... copilot
5555
```
5656

57+
### Using `copilot completion`
58+
59+
The command `copilot completion SHELL` outputs a script for the specified shell (bash, zsh, or fish).
60+
61+
By sourcing this script (or writing it to your shell's completion directory) you can enable tab completion in your terminal for `copilot` subcommands, command options, and known value choices for command options.
62+
63+
#### Usage examples
64+
65+
Bash (current session only):
66+
67+
```bash copy
68+
source <(copilot completion bash)
69+
```
70+
71+
Bash (persistent, Linux):
72+
73+
```bash copy
74+
copilot completion bash | sudo tee /etc/bash_completion.d/copilot
75+
```
76+
77+
Zsh — write the output to a directory on your $fpath. Restart the shell after running this command:
78+
79+
```shell copy
80+
copilot completion zsh > "${fpath[1]}/_copilot"
81+
```
82+
83+
Fish:
84+
85+
```shell copy
86+
copilot completion fish > ~/.config/fish/completions/copilot.fish
87+
```
88+
5789
## Global shortcuts in the interactive interface
5890

5991
| Shortcut | Purpose |
@@ -182,7 +214,6 @@ For a complete list of available slash commands enter `/help` in the CLI's inter
182214
| `--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). |
183215
| `--banner`, `--no-banner` | Show or hide the startup banner. |
184216
| `--bash-env` | Enable `BASH_ENV` support for bash shells. |
185-
| `--config-dir=PATH` | Set the configuration directory (default: `~/.copilot`). |
186217
| `--connect[=SESSION-ID]` | Connect directly to a remote session (optionally specify a session ID or task ID). Conflicts with `--resume` and `--continue`. |
187218
| `--continue` | Resume the most recent session in the current working directory, falling back to the globally most recent session. |
188219
| `--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. |
@@ -332,7 +363,7 @@ copilot --allow-tool='MyMCP'
332363
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).
333364

334365
> [!NOTE]
335-
> 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.
336367
337368
## Project initialization for {% data variables.product.prodname_copilot_short %}
338369

@@ -944,7 +975,6 @@ Use `copilot mcp` to manage MCP server configurations from the command line with
944975
| `--timeout <ms>` | Timeout in milliseconds. |
945976
| `--json` | Output added configuration as JSON. |
946977
| `--show-secrets` | Show full environment variable and header values. |
947-
| `--config-dir <path>` | Path to the configuration directory. |
948978

949979
> [!CAUTION]
950980
> `--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.

0 commit comments

Comments
 (0)