-
Notifications
You must be signed in to change notification settings - Fork 65.6k
Fix #42356: consolidate Copilot CLI parameters and in-session commands #42357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -74,6 +74,63 @@ Install {% data variables.copilot.copilot_cli_short %}. See [AUTOTITLE](/copilot | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| For example, if you ask {% data variables.product.prodname_copilot_short %} to create a bash script but you do not want to use the script {% data variables.product.prodname_copilot_short %} suggests, you can stop the current operation and enter a new prompt, such as: `Continue the previous task but include usage instructions in the script`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## CLI parameters | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You can pass options and flags to the `copilot` command. The following table lists the most commonly used parameters and examples. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | Parameter | Description | Example | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | --- | --- | --- | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `--agent=<name>` | Use a named custom agent for this run. | `copilot --agent=refactor-agent --prompt "Refactor this code block"` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `-p "<text>"` or `--prompt "<text>"` | Provide a prompt non-interactively (non-interactive mode exits after completion). | `copilot -p "Run tests and fix failures"` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `-i "<text>"` or `--interactive "<text>"` | Start interactive mode and automatically execute a prompt. | `copilot -i "Fix the bug in main.js"` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `--resume` | Resume a previously saved interactive session (session picker). | `copilot --resume` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `--continue` | Quickly resume the most recently closed session. | `copilot --continue` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `--model <model>` | Start with a specific model. | `copilot --model gpt-5` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `--add-dir <path>` (repeatable) | Allow access to one or more directories by repeating the flag. | `copilot --add-dir /home/user/projects --add-dir ~/workspace` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `--allow-all-paths` | Disable path verification for this run (trust all filesystem paths). | `copilot --allow-all-paths` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `--allow-tool '<tool>'` | Allow a specific tool or tool pattern. | `copilot --allow-tool 'write'` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `--deny-tool '<tool>'` | Deny a specific tool (can be used alongside `--allow-tool`). | `copilot --deny-tool 'MyMCP(denied_tool)' --allow-tool 'MyMCP'` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `--allow-all-tools` | Allow all tools without per-command approval for this run. | `copilot --allow-all-tools --resume` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `--allow-url <domain>` (repeatable) | Pre-approve one or more domains for network access by repeating the flag. | `copilot --allow-url github.com --allow-url api.github.com` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `--deny-url <url>` | Deny network access to a specific URL/domain. | `copilot --deny-url malicious-site.com` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `--allow-all-urls` | Allow all URLs without confirmation. | `copilot --allow-all-urls` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `--help` or `help` | Show CLI help and available commands. | `copilot help` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## In-session commands | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| While in an interactive `copilot` session you can use slash commands and special prefixes to control behavior. Use the `?` command to list available in-session help. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | Command | Description | Example | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | --- | --- | --- | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/add-dir <directory>` | Add a directory to the allowed list for file access | `/add-dir /path/to/directory` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/agent` | Browse and select from available agents (if any) | `/agent` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/clear` | Clear the conversation history | `/clear` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/compact` | Summarize conversation history to reduce context window usage | `/compact` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/context` | Show context window token usage and visualization | `/context` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/cwd [directory]` | Change working directory or show current directory | `/cwd /path/to/dir` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/delegate <prompt>` | Delegate changes to remote repository with an AI-generated PR | `/delegate complete the API integration tests` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/exit` or `/quit` | Exit the CLI | `/exit` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/share [file or gist] [path]` | Share session to a markdown file or GitHub Gist | `/share file session.md` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/feedback` | Provide feedback about the CLI | `/feedback` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/help` | Show help for interactive commands | `/help` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/list-dirs` | Display all allowed directories for file access | `/list-dirs` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/login` | Log in to Copilot | `/login` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/logout` | Log out of Copilot | `/logout` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/mcp [show, add, edit, delete, disable, enable] [server-name]` | Manage MCP servers and configurations | `/mcp add` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/model [model]` | Select AI model to use | `/model gpt-5-mini` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/reset-allowed-tools` | Reset the list of allowed tools during the session | `/reset-allowed-tools` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/session` | Show information about the current CLI session | `/session` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/skills [list, info, add, remove, reload] [args...]` | Manage skills for enhanced capabilities | `/skills list` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/terminal-setup` | Configure terminal for multiline input support | `/terminal-setup` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/theme [show, set, list] [auto, dark, light]` | View or configure terminal theme | `/theme set dark` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/usage` | Display session usage metrics and statistics | `/usage` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/user [show, list, switch]` | Manage GitHub user list | `/user list` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `?` | Display interactive help and available commands | `?` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `!<shell command>` | Run a shell command directly from the prompt without calling the model | `!git clone https://github.com/github/copilot-cli` | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+118
to
+131
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | `/list-dirs` | Display all allowed directories for file access | `/list-dirs` | | |
| | `/login` | Log in to Copilot | `/login` | | |
| | `/logout` | Log out of Copilot | `/logout` | | |
| | `/mcp [show, add, edit, delete, disable, enable] [server-name]` | Manage MCP servers and configurations | `/mcp add` | | |
| | `/model [model]` | Select AI model to use | `/model gpt-5-mini` | | |
| | `/reset-allowed-tools` | Reset the list of allowed tools during the session | `/reset-allowed-tools` | | |
| | `/session` | Show information about the current CLI session | `/session` | | |
| | `/skills [list, info, add, remove, reload] [args...]` | Manage skills for enhanced capabilities | `/skills list` | | |
| | `/terminal-setup` | Configure terminal for multiline input support | `/terminal-setup` | | |
| | `/theme [show, set, list] [auto, dark, light]` | View or configure terminal theme | `/theme set dark` | | |
| | `/usage` | Display session usage metrics and statistics | `/usage` | | |
| | `/user [show, list, switch]` | Manage GitHub user list | `/user list` | | |
| | `?` | Display interactive help and available commands | `?` | | |
| | `!<shell command>` | Run a shell command directly from the prompt without calling the model | `!git clone https://github.com/github/copilot-cli` | | |
| | `/list-dirs` | Display all allowed directories for file access. | `/list-dirs` | | |
| | `/login` | Log in to Copilot. | `/login` | | |
| | `/logout` | Log out of Copilot. | `/logout` | | |
| | `/mcp [show, add, edit, delete, disable, enable] [server-name]` | Manage MCP servers and configurations. | `/mcp add` | | |
| | `/model [model]` | Select AI model to use. | `/model gpt-5-mini` | | |
| | `/reset-allowed-tools` | Reset the list of allowed tools during the session. | `/reset-allowed-tools` | | |
| | `/session` | Show information about the current CLI session. | `/session` | | |
| | `/skills [list, info, add, remove, reload] [args...]` | Manage skills for enhanced capabilities. | `/skills list` | | |
| | `/terminal-setup` | Configure terminal for multiline input support. | `/terminal-setup` | | |
| | `/theme [show, set, list] [auto, dark, light]` | View or configure terminal theme. | `/theme set dark` | | |
| | `/usage` | Display session usage metrics and statistics. | `/usage` | | |
| | `/user [show, list, switch]` | Manage GitHub user list. | `/user list` | | |
| | `?` | Display interactive help and available commands. | `?` | | |
| | `!<shell command>` | Run a shell command directly from the prompt without calling the model. | `!git clone https://github.com/github/copilot-cli` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The descriptions in this table are inconsistently punctuated. Some descriptions end with periods while others don't. For consistency and proper documentation style, all descriptions should end with periods since they are complete phrases describing actions. This follows the pattern used in other documentation tables in the repository.