Skip to content

Commit d5dffae

Browse files
docs-botgithub-actions[bot]hubwriter
authored
docs: update copilot-cli content from source docs (#60972)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: hubwriter <hubwriter@github.com>
1 parent 463b05b commit d5dffae

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

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

Lines changed: 33 additions & 0 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`). |
@@ -53,6 +54,38 @@ copilot login --host https://example.ghe.com
5354
COPILOT_GITHUB_TOKEN=github_pat_... copilot
5455
```
5556

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+
5689
## Global shortcuts in the interactive interface
5790

5891
| Shortcut | Purpose |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
374da3ae1c75caf8102b669ac6f1d624f7dedcd9
1+
1a74df9f2a81e052650047d18b97fcf82300ba79

0 commit comments

Comments
 (0)