Skip to main content

GitHub Copilot CLI command reference

Find commands and keyboard shortcuts to help you use Copilot CLI effectively.

Command-line commands

CommandPurpose
copilotLaunch interactive mode.
copilot help [topic]Display help information. Help topics include: config, commands, environment, logging, and permissions.
copilot initInitialize Copilot custom instructions for this repository.
copilot updateDownload and install the latest version.
copilot versionDisplay version information and check for updates.
copilot pluginManage plugins and plugin marketplaces.

Global shortcuts in interactive mode

ShortcutPurpose
@ FILENAMEInclude file contents in the context.
Ctrl+X then /After you have started typing a prompt, this allows you to run a slash command—for example, if you want to change the model without having to retype your prompt.
EscCancel the current operation.
! COMMANDExecute a command in your local shell, bypassing Copilot.
Ctrl+CCancel operation / clear input. Press twice to exit.
Ctrl+DShutdown.
Ctrl+LClear the screen.

Timeline shortcuts in interactive mode

ShortcutPurpose
ctrl+oWhile there is not input, this expands recent items in Copilot's response timeline to show more details.
ctrl+eWhile there is not input, this expands all items in Copilot's response timeline.
ShortcutPurpose
Ctrl+AMove to beginning of the line (when typing).
Ctrl+EMove to end of the line (when typing).
Ctrl+HDelete the previous character.
Ctrl+WDelete the previous word.
Ctrl+UDelete from cursor to beginning of the line.
Ctrl+KDelete from cursor to end of the line.
Meta+/Move the cursor by a word.
/Navigate the command history.

Slash commands in interactive mode

CommandPurpose
/add-dir PATHAdd a directory to the allowed list for file access.
/agentBrowse and select from available agents (if any).
/allow-all, /yoloEnable all permissions (tools, paths, and URLs).
/clear, /newClear the conversation history.
/compactSummarize the conversation history to reduce context window usage.
/contextShow the context window token usage and visualization.
/cwd, /cd [PATH]Change the working directory or display the current directory.
/delegate [PROMPT]Delegate changes to a remote repository with an AI-generated pull request.
/diffReview the changes made in the current directory.
/exit, /quitExit the CLI.
/experimental [on|off]Toggle or turn on/off experimental features.
/share [file|gist] [PATH]Share the session to a Markdown file or GitHub gist.
/feedbackProvide feedback about the CLI.
/helpShow the help for interactive commands.
/ideConnect to an IDE workspace.
/initInitialize Copilot custom instructions and agentic features for this repository.
/list-dirsDisplay all of the directories for which file access has been allowed.
/loginLog in to Copilot.
/logoutLog out of Copilot.
/lsp [show|test|reload|help] [SERVER-NAME]Manage the language server configuration.
/mcp [show|add|edit|delete|disable|enable] [SERVER-NAME]Manage the MCP server configuration.
/model, /models [MODEL]Select the AI model you want to use.
/plan [PROMPT]Create an implementation plan before coding.
/plugin [marketplace|install|uninstall|update|list] [ARGS...]Manage plugins and plugin marketplaces.
/rename NAMERename the current session (alias for /session rename).
/reset-allowed-toolsReset the list of allowed tools.
/resume [SESSION-ID]Switch to a different session (optionally specify a session ID).
/review [PROMPT]Run the code review agent to analyze changes.
/session [checkpoints [n]|files|plan|rename NAME]Show session information and a workspace summary. Use the subcommands for details.
/skills [list|info|add|remove|reload] [ARGS...]Manage skills for enhanced capabilities.
/terminal-setupConfigure the terminal for multiline input support (Shift+Enter and Ctrl+Enter).
/theme [show|set|list] [auto|THEME-ID]View or configure the terminal theme.
/usageDisplay session usage metrics and statistics.
/user [show|list|switch]Manage the current GitHub user.

For a complete list of available slash commands enter /help in interactive mode.

Command-line options

OptionPurpose
--acpStart the Agent Client Protocol server.
--add-dir PATHAdd a directory to the allowed list for file access (can be used multiple times).
--add-github-mcp-tool TOOLAdd a tool to enable for the GitHub MCP server, instead of the default CLI subset (can be used multiple times). Use * for all tools.
--add-github-mcp-toolset TOOLSETAdd a toolset to enable for the GitHub MCP server, instead of the default CLI subset (can be used multiple times). Use all for all toolsets.
--additional-mcp-config JSONAdditional MCP servers configuration as a JSON string or a file path (prefix with @) (can be used multiple times). Augments the configuration from ~/.copilot/mcp-config.json for this session.
--agent AGENTSpecify a custom agent to use.
--allow-allEnable all permissions (equivalent to --allow-all-tools --allow-all-paths --allow-all-urls).
--allow-all-pathsDisable file path verification and allow access to any path.
--allow-all-toolsAllow all tools to run automatically without confirmation. Required for non-interactive mode (env: COPILOT_ALLOW_ALL).
--allow-all-urlsAllow access to all URLs without confirmation.
--allow-tool [TOOLS...]Tools the CLI has permission to use. Will not prompt for permission.
--allow-url [URLS...]Allow access to specific URLs or domains.
--available-tools [TOOLS...]Only these tools will be available to the model.
--bannerShow the startup banner.
--config-dir PATHSet the configuration directory (default: ~/.copilot).
--continueResume the most recent session.
--deny-tool [TOOLS...]Tools the CLI does not have permission to use. Will not prompt for permission.
--deny-url [URLS...]Deny access to specific URLs or domains, takes precedence over --allow-url.
--disable-builtin-mcpsDisable all built-in MCP servers (currently: github-mcp-server).
--disable-mcp-server SERVER-NAMEDisable a specific MCP server (can be used multiple times).
--disable-parallel-tools-executionDisable parallel execution of tools (LLM can still make parallel tool calls, but they will be executed sequentially).
--disallow-temp-dirPrevent automatic access to the system temporary directory.
--enable-all-github-mcp-toolsEnable all GitHub MCP server tools, instead of the default CLI subset. Overrides the --add-github-mcp-toolset and --add-github-mcp-tool options.
--excluded-tools [TOOLS...]These tools will not be available to the model.
--experimentalEnable experimental features (use --no-experimental to disable).
-h, --helpDisplay help.
-i PROMPT, --interactive PROMPTStart interactive mode and automatically execute this prompt.
--log-dir DIRECTORYSet the log file directory (default: ~/.copilot/logs/).
--log-level LEVELSet the log level (choices: none, error, warning, info, debug, all, default).
--model MODELSet the AI model you want to use.
--no-ask-userDisable the ask_user tool (the agent works autonomously without asking questions).
--no-auto-updateDisable downloading CLI updates automatically.
--no-colorDisable all color output.
--no-custom-instructionsDisable loading of custom instructions from AGENTS.md and related files.
-p PROMPT, --prompt PROMPTExecute a prompt in non-interactive mode (exits after completion).
--plain-diffDisable rich diff rendering (syntax highlighting via the diff tool specified by your git config).
--resume [SESSION-ID]Resume from a previous session (optionally specify a session ID).
-s, --silentOutput only the agent response (without usage statistics), useful for scripting with -p.
--screen-readerEnable screen reader optimizations.
--share [PATH]Share a session to a Markdown file after completion in non-interactive mode (default path: ./copilot-session-<ID>.md).
--share-gistShare a session to a secret GitHub gist after completion in non-interactive mode.
--stream MODEEnable or disable streaming mode (mode choices: on or off).
-v, --versionShow version information.
--yoloEnable all permissions (equivalent to --allow-all-tools --allow-all-paths --allow-all-urls).

For a complete list of commands and options, run copilot help.