Copilot CLI reference - CLI flags
Copilot CLI command-line flags
Copilot CLI documents 102 CLI flags, including --host HOST, --web-flow and --device-code. You pass these to copilot on the command line. Each row gives the docs' description, accepted values and an example where one is documented.
Last verified 3 official pagesFull Copilot CLI reference
| Flag | Description | Example |
|---|---|---|
--host HOST | copilot login option: GitHub host URL, used to authenticate with a GitHub Enterprise Cloud instance that uses data residency. Default: https://github.com Docs: --host HOST | copilot login --host https://example.ghe.com |
--web-flow | copilot login option: force the browser-based web authentication flow, the default on a local terminal. Docs: --web-flow | copilot login --web-flow |
--device-code | copilot login option: force the OAuth device code flow, the default on a remote terminal or in CI. Docs: --device-code | copilot login --device-code |
--with-token | copilot login option: read an authentication token from standard input instead of starting an OAuth flow. Conflicts with --web-flow and --device-code. Docs: --with-token | copilot login --with-token < mytoken.txt |
--list | copilot config option: list settings as key=value lines; conflicts with KEY/VALUE/--rm. Docs: --list | copilot config --list |
--json | Emit JSON instead of text. Accepted by copilot config --list, copilot instruction list, copilot lsp list, copilot plugin list, copilot mcp list/get/add, copilot skill list, and copilot plugin marketplace list/browse. Docs: --json | copilot config --repo --list --json |
--rm | copilot config option: remove the key, or only the given item from a list; requires KEY. Docs: --rm | copilot config --rm allowedUrls github.com |
--global | copilot config option: use your user settings file (the default); conflicts with --repo/--local. Docs: --global | -no example |
--repo | copilot config option: use the repository's .github/copilot/settings.json; only repo-overridable keys are accepted. Conflicts with --global/--local. Docs: --repo | copilot config --repo --list --json |
--local | copilot config option: use the repository's .github/copilot/settings.local.json; conflicts with --global/--repo. Docs: --local | -no example |
--args JSON or --args @PATH | copilot workflow run option: supply the workflow's inputs as inline JSON or a UTF-8 JSON file. Arguments are not read from standard input. Default: {} Docs: --args JSON or --args @PATH | -no example |
--result-file PATH | copilot workflow run option: write the returned value as JSON to a file instead of standard output; written only when the workflow completes and returns a result. Docs: --result-file PATH | -no example |
--transport <transport> | copilot mcp add option: transport type for the server. stdio, http, sse; default stdio Docs: --transport <transport> | copilot mcp add --transport http SERVER-NAME URL |
--env KEY=VALUE | copilot mcp add option: environment variable for the server (repeatable). Docs: --env KEY=VALUE | -no example |
--header "HEADER: VALUE" | copilot mcp add option: HTTP header for remote servers (repeatable). Docs: --header "HEADER: VALUE" | -no example |
--tools <tools> | copilot mcp add option: tool filter for the server. "*" for all, a comma-separated list, or "" for none Docs: --tools <tools> | -no example |
--timeout <ms> | copilot mcp add option: timeout in milliseconds for tool discovery and tool calls. Positive integer from 1 to 4294967295; default 30000 Docs: --timeout <ms> | -no example |
--show-secrets | copilot mcp add option: show full environment variable and header values. Can print sensitive values; use only in trusted environments. Docs: --show-secrets | -no example |
-- <command> [args...] | copilot mcp add option: command and arguments for a local (stdio) server. Docs: -- <command> [args...] | copilot mcp add SERVER-NAME -- COMMAND [ARGS...] |
--all | copilot plugin update option: update every installed plugin. Docs: --all | -no example |
--force | copilot plugin marketplace remove option: also uninstall plugins sourced from the marketplace. Docs: --force | -no example |
--project | copilot skill add option: install a file or URL skill into the current project (.github/skills) instead of your user account. Docs: --project | copilot skill add --project ./my-skill/SKILL.md |
--stdio | With --acp, start the ACP server in stdio mode (the default). Mutually exclusive with --port. Docs: --stdio | copilot --acp --stdio |
--port | With --acp, start the ACP server in TCP mode on the given port, binding to 127.0.0.1 by default. Docs: --port | copilot --acp --port 3000 |
--add-dir=PATH | Allow file access to a directory and load its .github/skills and .github/agents as trusted configurations (repeatable). The path must be an existing directory. Docs: --add-dir=PATH | -no example |
--add-github-mcp-tool=TOOL | Add a tool to enable for the GitHub MCP server instead of the default CLI subset (repeatable). Use * for all tools Docs: --add-github-mcp-tool=TOOL | -no example |
--add-github-mcp-toolset=TOOLSET | Add a toolset to enable for the GitHub MCP server instead of the default CLI subset (repeatable). Use all for all toolsets Docs: --add-github-mcp-toolset=TOOLSET | -no example |
--additional-mcp-config=JSON | Add an MCP server for this session only, as a JSON string or an @-prefixed file path. Augments ~/.copilot/mcp-config.json and overrides installed servers with the same name. Docs: --additional-mcp-config=JSON | -no example |
--agent=AGENT | Specify a custom agent to use, matched by agent ID or name. Docs: --agent=AGENT | copilot -p "Review the latest commit" \
--allow-tool='shell' \
--agent code-review |
--allow-all | Enable all permissions, equivalent to --allow-all-tools --allow-all-paths --allow-all-urls. Suppressed when permissions.disableBypassPermissionsMode is "disable". Docs: --allow-all | -no example |
--allow-all-mcp-server-instructions | Include initialization instructions from all MCP servers in the system prompt; by default only allowlisted servers' instructions are included up front. Docs: --allow-all-mcp-server-instructions | -no example |
--allow-all-paths | Disable file path verification and allow access to any path. Docs: --allow-all-paths | -no example |
--allow-all-tools | Allow all tools to run automatically without confirmation. Required when using the CLI programmatically (env: COPILOT_ALLOW_ALL). Docs: --allow-all-tools | -no example |
--allow-all-urls | Allow access to all URLs without confirmation. Docs: --allow-all-urls | -no example |
--allow-tool=TOOL ... | Tools the CLI may use without prompting, as permission patterns Kind(argument). Use a quoted, comma-separated list for multiple tools. Kinds: memory, read, shell, url, write, or an MCP server name; shell(cmd:*) matches a command stem Docs: --allow-tool=TOOL ... | copilot --allow-tool='shell(git:*)' --deny-tool='shell(git push)' |
--allow-url=URL ... | Allow access to specific URLs or domains. Use a quoted, comma-separated list for multiple URLs. Docs: --allow-url=URL ... | -no example |
--acp | Start as an Agent Client Protocol server (public preview). Defaults to stdio transport; --port selects TCP. --available-tools, --excluded-tools, and --effort passed at startup apply to every session. Docs: --acp | copilot --acp --port 3000 --effort=max --available-tools="bash,view" |
--attachment PATH | Attach a file to the initial prompt (repeatable). Images require the model and organization policy to allow vision input. Docs: --attachment PATH | -no example |
--autopilot | Enable autopilot continuation: the agent keeps working until task_complete is called, then returns to interactive mode. Docs: --autopilot | -no example |
--available-tools=TOOL ... | Only these tools will be available to the model. Use a quoted, comma-separated list. Tool names such as bash, powershell, apply_patch, create, edit, view, task, ask_user, glob, grep, skill, web_fetch Docs: --available-tools=TOOL ... | -no example |
--banner | Show the startup banner. Docs: --banner | -no example |
--no-banner | Hide the startup banner. Docs: --no-banner | -no example |
--bash-env | Enable BASH_ENV support for bash shells. Docs: --bash-env | -no example |
-C DIRECTORY | Change working directory before doing anything else. Docs: -C DIRECTORY | -no example |
--connect[=SESSION-ID] | Connect directly to a remote session, optionally by session ID or task ID. Conflicts with --resume and --continue; requires remote sessions on the account. Docs: --connect[=SESSION-ID] | -no example |
--context TIER | Set the context window tier for tiered-pricing models, overriding the persisted setting. default, long_context Docs: --context TIER | -no example |
--config-dir=DIRECTORY | Deprecated option for setting the configuration directory; use the COPILOT_HOME environment variable instead. Also accepted by several list/enable/install subcommands. Docs: --config-dir=DIRECTORY | -no example |
--continue | Resume the most recent session in the current working directory, falling back to the globally most recent session. Conflicts with --resume. Docs: --continue | -no example |
--deny-tool=TOOL ... | Tools the CLI may not use, without prompting. Deny rules always take precedence over allow rules, even with --allow-all. Docs: --deny-tool=TOOL ... | copilot --deny-tool='write(secret.txt)' |
--deny-url=URL ... | Deny access to specific URLs or domains; takes precedence over --allow-url. Docs: --deny-url=URL ... | -no example |
--disable-builtin-mcps | Disable all built-in MCP servers (currently: github-mcp-server). Docs: --disable-builtin-mcps | -no example |
--disable-mcp-server=SERVER-NAME | Disable a specific MCP server (repeatable). Docs: --disable-mcp-server=SERVER-NAME | -no example |
--disallow-temp-dir | Prevent automatic access to the system temporary directory. Docs: --disallow-temp-dir | -no example |
--effort=LEVEL, --reasoning-effort=LEVEL | Set the reasoning effort level. max is the highest-depth tier for Anthropic models. low, medium, high, xhigh, max Docs: --effort=LEVEL, --reasoning-effort=LEVEL | -no example |
--enable-all-github-mcp-tools | Enable all GitHub MCP server tools instead of the default CLI subset; overrides --add-github-mcp-toolset and --add-github-mcp-tool. Docs: --enable-all-github-mcp-tools | -no example |
--enable-mcp-server=SERVER-NAME | Re-enable an MCP server disabled in your settings, for this session only (repeatable); not persisted. Docs: --enable-mcp-server=SERVER-NAME | -no example |
--enable-memory | Enable memory in prompt mode (disabled by default). Docs: --enable-memory | -no example |
--enable-reasoning-summaries | Deprecated compatibility option, accepted but ignored; reasoning summaries for supporting OpenAI models are shown by default and toggled with Ctrl+T. Docs: --enable-reasoning-summaries | -no example |
--excluded-tools=TOOL ... | These tools will not be available to the model. Use a quoted, comma-separated list. Docs: --excluded-tools=TOOL ... | -no example |
--experimental | Enable experimental features (use --no-experimental to disable). Docs: --experimental | -no example |
--extension-sdk-path DIRECTORY | Override the bundled @github/copilot-sdk injected into extension subprocesses with a local copilot-sdk/ folder; invalid paths fall back to the bundled SDK. Docs: --extension-sdk-path DIRECTORY | -no example |
--fleet | Run the prompt in fleet mode (parallel subagent orchestration). Requires a prompt from -i, -p, or piped stdin; equivalent to prefixing a prompt with /fleet. Not supported in ACP server mode. Docs: --fleet | -no example |
-h, --help | Display help. Docs: -h, --help | -no example |
-i PROMPT, --interactive=PROMPT | Start an interactive session and automatically execute this prompt. Docs: -i PROMPT, --interactive=PROMPT | -no example |
--log-dir=DIRECTORY | Set the log file directory. Default: ~/.copilot/logs/ Docs: --log-dir=DIRECTORY | -no example |
--log-level=LEVEL | Set the log level. none, error, warning, info, debug, all, default Docs: --log-level=LEVEL | -no example |
--max-ai-credits=CREDITS | Set a soft maximum for AI Credits allowed for each response; resets per user message and is adjustable mid-session with /limits. Docs: --max-ai-credits=CREDITS | -no example |
--max-autopilot-continues=COUNT | Maximum number of continuation messages in autopilot mode. Malformed values (NaN, negative, fractional, scientific notation) are rejected. Non-negative integer; default unlimited Docs: --max-autopilot-continues=COUNT | -no example |
--mode=MODE | Set the initial agent mode. --plan --mode autopilot gives plan-then-autopilot; any other --plan --mode pairing is rejected. interactive, plan, autopilot Docs: --mode=MODE | -no example |
--model=MODEL | Set the AI model. Pass auto to let Copilot pick the best available model. Model IDs such as claude-sonnet-5.5 (default), gpt-5.4, gpt-6.1-sol, gpt-6-astra, gpt-6-luna, claude-opus-5.5, claude-haiku-5.5, claude-haiku-4.5, gpt-5.3-codex, gemini-3.7-flash, gemini-3.8-flash, or auto Docs: --model=MODEL | copilot -p "What does this project do?" -s --model claude-haiku-4.5 |
--mouse[=VALUE] | Enable or disable mouse support in the interactive interface. An explicit value is persisted to your configuration file. on (default), off Docs: --mouse[=VALUE] | -no example |
-n NAME, --name=NAME | Set a name for the new session, used by --resume and /resume to find sessions by name. Docs: -n NAME, --name=NAME | -no example |
--no-ask-user | Disable the ask_user tool so the agent works autonomously without asking questions. Docs: --no-ask-user | -no example |
--no-auto-update | Disable downloading CLI updates automatically. Docs: --no-auto-update | -no example |
--no-bash-env | Disable BASH_ENV support for bash shells. Docs: --no-bash-env | -no example |
--no-color | Disable all color output. Docs: --no-color | -no example |
--no-custom-instructions | Disable loading of custom instructions from AGENTS.md and related files; no agent receives repository instructions when set. Docs: --no-custom-instructions | -no example |
--no-experimental | Disable experimental features. Docs: --no-experimental | -no example |
--no-mouse | Disable mouse support. Docs: --no-mouse | -no example |
--no-remote | Disable remote access for this session. Docs: --no-remote | -no example |
--no-remote-export | Disable exporting your session to GitHub.com and GitHub Mobile (also disables remote control). Docs: --no-remote-export | -no example |
--output-format=FORMAT | Set output format; json emits JSONL (one JSON object per line). Also accepted by copilot workflow run. text (default), json Docs: --output-format=FORMAT | -no example |
-p PROMPT, --prompt=PROMPT | Execute a prompt programmatically and exit after completion. The exit summary includes a copilot --resume=SESSION-ID hint. Docs: -p PROMPT, --prompt=PROMPT | copilot -p "Fix the race condition in the worker pool" \
--model gpt-5.3-codex \
--allow-tool='write, shell' |
--plan | Start in plan mode; shorthand for --mode plan. Cannot be combined with --autopilot; can be combined with --mode autopilot. Docs: --plan | -no example |
--plain-diff | Disable rich diff rendering (syntax highlighting via the diff tool specified by your Git config). Docs: --plain-diff | -no example |
--plugin-dir=DIRECTORY | Load a plugin from a local directory (repeatable). Its agents are available in server-mode, interactive, and -p sessions. Docs: --plugin-dir=DIRECTORY | -no example |
--remote | Enable remote access to this session from GitHub.com and GitHub Mobile. With --resume <TASK-ID>, resumes a remote task locally. Docs: --remote | -no example |
--remote-export | Export your session to GitHub.com and GitHub Mobile read-only, without enabling remote control. Docs: --remote-export | -no example |
-r, --resume[=VALUE] | Resume a previous interactive session from a picker, or by session ID, ID prefix, or session name (exact, case-insensitive). Bare --resume requires a TTY; conflicts with --continue. Docs: -r, --resume[=VALUE] | -no example |
-s, --silent | Output only the agent response without usage statistics, for scripting with -p. For copilot workflow run, suppresses progress output. Docs: -s, --silent | -no example |
--screen-reader | Enable screen reader optimizations. Docs: --screen-reader | -no example |
--secret-env-vars=VAR ... | Redact an environment variable from shell and MCP server environments (repeatable). GITHUB_TOKEN and COPILOT_GITHUB_TOKEN values are redacted by default. Docs: --secret-env-vars=VAR ... | -no example |
--session-id ID | Use an exact session or task ID; resumes it if it exists, otherwise creates a new session only when the value is a valid UUID. Do not combine with --resume, --continue, or --connect. Docs: --session-id ID | -no example |
--trust-folder | Trust the working directory's hooks, workspace MCP servers, and repository plugin settings for one new non-interactive session; not saved and not a tool or path grant. Cannot be combined with --resume, --continue, or --session-id. Docs: --trust-folder | -no example |
--sandbox | Enable the OS-level shell sandbox for this session only, without changing your saved sandbox setting. Docs: --sandbox | -no example |
--no-sandbox | Disable local sandboxing for this session only. Ignored if an enterprise-managed policy enforces sandboxing. Docs: --no-sandbox | -no example |
--share=PATH | Share a session to a Markdown file after a programmatic session completes. Default path: ./copilot-session-<ID>.md Docs: --share=PATH | -no example |
--share-gist | Share a session to a secret GitHub gist after a programmatic session completes. Docs: --share-gist | -no example |
--stream=MODE | Enable or disable streaming mode, which displays the response progressively as it is generated. on (default), off Docs: --stream=MODE | -no example |
-v, --version | Show version information. Docs: -v, --version | -no example |
-w, --worktree[=NAME] | Create or reuse an isolated Git worktree (under <repo>.worktrees/ by default) and start the session inside it. Conflicts with --resume, --continue, and --connect. Docs: -w, --worktree[=NAME] | -no example |
--yolo | Enable all permissions (equivalent to --allow-all). Docs: --yolo | -no example |
The rest of the Copilot CLI reference
FAQ
How many CLI flags does Copilot CLI have?
The official Copilot CLI docs list 102 CLI flags, including --host HOST, --web-flow and --device-code. All of them are in the table above, in the docs' order.
What does --host HOST do in Copilot CLI?
copilot login option: GitHub host URL, used to authenticate with a GitHub Enterprise Cloud instance that uses data residency. Values: Default: https://github.com. Example: copilot login --host https://example.ghe.com
Where are Copilot CLI command-line flags documented?
On 3 official docs pages at docs.github.com, last read on October 17, 2026. Every row in the table links the exact section it came from.
More on Copilot CLI
- Copilot CLI in the tools directoryWhat it is, who makes it and how it fits next to other coding agents.
- Copilot CLI errors and fixes12 error messages, quoted verbatim, with the documented fix for each.
- GitHub Copilot premium requests and usage limitsPlan and tier limits for this tool, copied from the official docs.
Use other models in Copilot CLI
Setup guides from the model-in-tool directory, each with the env vars and base URL from official docs.
Sources
Last verified . Names and examples are copied verbatim from the 3 official pages below, and every row above links the exact section it came from.
Newsletter
Know when your tools change
One email per week. New coding agent releases, the flags and commands they add, and what they mean for how you work.