Copilot CLI Options Reference
Complete reference for all command-line options and flags.
Core Options
-p, --prompt
Execute a prompt in non-interactive mode (exits after completion).
copilot -p "Fix the bug in main.js" --allow-all-toolsType: String
Mode: Non-interactive
Requires: Permission flags for automation
-i, --interactive
Start interactive mode and automatically execute the provided prompt.
copilot -i "Review the codebase for security issues"Type: String
Mode: Interactive
Difference from -p: Remains in session after executing initial prompt
-s, --silent
Output only the agent response (no stats, banners, or metadata). Useful for scripting.
copilot -p "Generate API docs" --allow-all -s > api-docs.mdType: Boolean
Requires: Used with -p (non-interactive mode)
Output: Clean agent response only
-v, --version
Show version information.
copilot -v
copilot --version-h, --help
Display help information.
copilot -h
copilot --helpSession Management
--continue
Resume the most recent session.
copilot --continue
copilot --continue --allow-all-toolsBehavior:
- Loads last session automatically
- Restores conversation context
- Can override permissions
--resume
Resume a previous session (optionally with session ID).
# Interactive picker
copilot --resume
# Specific session
copilot --resume abc123def456With ID: Resumes specific session
Without ID: Shows interactive session picker
Permission Options
--allow-all
Enable all permissions (equivalent to --allow-all-tools --allow-all-paths --allow-all-urls).
copilot -p "Implement feature" --allow-allGrants:
- All tool permissions
- All file path access
- All URL access
Alias: --yolo
--yolo
Shorthand for --allow-all.
copilot -p "Quick fix" --yoloUse when: Trusted environment, quick iteration, full automation
--allow-all-tools
Allow all tools to run automatically without confirmation.
copilot -p "Deploy changes" --allow-all-toolsEnvironment variable: COPILOT_ALLOW_ALL
Required for: Non-interactive mode automation
--allow-tool
Specify individual tools the CLI has permission to use.
# Allow file writing
copilot --allow-tool write
# Allow all git commands
copilot --allow-tool 'shell(git:*)'
# Multiple tools
copilot --allow-tool write --allow-tool 'shell(npm:*)'Pattern matching:
write- File write operationsshell(git:*)- All git commandsshell(npm install)- Specific commandMyMCP(tool_name)- Specific MCP tool
--deny-tool
Deny specific tools (takes precedence over --allow-tool).
# Allow all git except push
copilot --allow-tool 'shell(git:*)' --deny-tool 'shell(git push)'
# Deny dangerous commands
copilot --allow-all-tools --deny-tool 'shell(rm *)'Use for: Blacklisting dangerous operations while allowing broad access
--available-tools
Restrict available tools to specific set.
copilot --available-tools write read shellEffect: Only listed tools are available to the model
Use for: Limiting scope for specific tasks
--excluded-tools
Prevent specific tools from being available.
copilot --excluded-tools 'shell(rm)' 'shell(dd)'Difference from --deny-tool: Tools not shown to model at all
--allow-all-paths
Disable file path verification and allow access to any path.
copilot --allow-all-pathsSecurity: Use cautiously, only in trusted environments
--add-dir
Add a directory to the allowed list for file access.
# Single directory
copilot --add-dir /home/user/projects
# Multiple directories
copilot --add-dir ~/workspace --add-dir /tmp --add-dir ~/sharedDefault allowed: Current working directory
Can be used multiple times
--disallow-temp-dir
Prevent automatic access to system temporary directory.
copilot --disallow-temp-dirDefault: Temp directory is allowed
--allow-all-urls
Allow access to all URLs without confirmation.
copilot --allow-all-urlsUse when: Automation requires web access
--allow-url
Allow access to specific URLs or domains.
# Single domain (defaults to HTTPS)
copilot --allow-url github.com
# Multiple URLs
copilot --allow-url github.com --allow-url api.example.com
# Specific protocol
copilot --allow-url https://api.example.comCan be used multiple times
--deny-url
Deny access to specific URLs or domains (takes precedence over --allow-url).
copilot --deny-url malicious-site.com
copilot --deny-url https://blocked.example.comModel Selection
--model
Set the AI model to use.
copilot --model claude-sonnet-4.5
copilot --model gpt-5
copilot --model claude-opus-4.5Available models:
claude-sonnet-4.5(default) - Best for most coding tasksclaude-opus-4.5- Complex reasoning and architectureclaude-haiku-4.5- Fast, lightweight tasksclaude-sonnet-4- Previous generationgpt-5.2-codex- GPT variant optimized for codegpt-5.2- Latest GPT modelgpt-5.1-codex-max- Large context GPT codexgpt-5.1-codex- GPT codex variantgpt-5.1- GPT variantgpt-5- GPT basegpt-5.1-codex-mini- Small GPT codexgpt-5-mini- Small GPTgpt-4.1- Previous GPT generationgemini-3-pro-preview- Google Gemini
Selection guide:
- Default/general:
claude-sonnet-4.5 - Complex/architecture:
claude-opus-4.5 - Fast/simple:
claude-haiku-4.5 - Alternative:
gpt-5orgemini-3-pro-preview
Agent and Behavior
--agent
Specify a custom agent to use.
copilot --agent my-custom-agentUse for: Custom agent implementations
--no-ask-user
Disable the ask_user tool (agent works autonomously without asking questions).
copilot -p "Implement feature" --no-ask-user --allow-allEffect: Agent makes decisions without user input
Use for: Full automation, CI/CD
--experimental
Enable experimental features.
copilot --experimentalDisable: --no-experimental
MCP Server Configuration
--disable-builtin-mcps
Disable all built-in MCP servers (currently: github-mcp-server).
copilot --disable-builtin-mcps--disable-mcp-server
Disable a specific MCP server.
copilot --disable-mcp-server github-mcp-server
copilot --disable-mcp-server custom-serverCan be used multiple times
--enable-all-github-mcp-tools
Enable all GitHub MCP server tools instead of the default CLI subset.
copilot --enable-all-github-mcp-toolsOverrides: --add-github-mcp-toolset and --add-github-mcp-tool
--add-github-mcp-tool
Add a specific tool to enable for the GitHub MCP server.
# Add single tool
copilot --add-github-mcp-tool create_pull_request
# Add multiple tools
copilot --add-github-mcp-tool create_pull_request \
--add-github-mcp-tool merge_pull_request
# Enable all tools
copilot --add-github-mcp-tool "*"Can be used multiple times
--add-github-mcp-toolset
Add a toolset to enable for the GitHub MCP server.
# Add toolset
copilot --add-github-mcp-toolset pull_requests
# Enable all toolsets
copilot --add-github-mcp-toolset allCan be used multiple times
--additional-mcp-config
Additional MCP servers configuration as JSON string or file path.
# From file (prefix with @)
copilot --additional-mcp-config @~/my-mcp-config.json
# JSON string
copilot --additional-mcp-config '{"myserver": {"command": "node", "args": ["server.js"]}}'
# Multiple configs
copilot --additional-mcp-config @~/config1.json \
--additional-mcp-config @~/config2.jsonAugments: ~/.copilot/mcp-config.json for this session
Can be used multiple times
Custom Instructions
--no-custom-instructions
Disable loading of custom instructions from AGENTS.md and related files.
copilot --no-custom-instructionsUse when: Testing without project-specific instructions
Output and Sharing
--share
Share session to markdown file after completion in non-interactive mode.
# Default path
copilot -p "Implement feature" --allow-all --share
# Custom path
copilot -p "Fix bug" --allow-all --share ./bug-fix-session.mdDefault path: ./copilot-session-<id>.md
Mode: Non-interactive only
--share-gist
Share session to a secret GitHub gist after completion.
copilot -p "Create component" --allow-all --share-gistMode: Non-interactive only
Output: Gist URL
Display and UI
--banner
Show the startup banner.
copilot --bannerDefault: Banner shown in interactive mode
--no-color
Disable all color output.
copilot --no-colorUse for: Logging, CI/CD environments
--plain-diff
Disable rich diff rendering (use plain text diffs).
copilot --plain-diffEffect: No syntax highlighting in diffs
--screen-reader
Enable screen reader optimizations.
copilot --screen-readerEffect: Adjusts output for accessibility
--stream
Enable or disable streaming mode.
copilot --stream on
copilot --stream offChoices: on, off
Default: Streaming enabled
Configuration and Logging
--config-dir
Set the configuration directory.
copilot --config-dir ~/.my-copilot-configDefault: ~/.copilot
Contains: Authentication, settings, MCP configs
--log-dir
Set log file directory.
copilot --log-dir ~/copilot-logsDefault: ~/.copilot/logs/
--log-level
Set the log level.
copilot --log-level debug
copilot --log-level error
copilot --log-level noneChoices:
none- No loggingerror- Errors onlywarning- Warnings and errorsinfo- Informational messagesdebug- Detailed debuggingall- Everythingdefault- Standard logging
Updates
--no-auto-update
Disable downloading CLI update automatically.
copilot --no-auto-updateDefault: Auto-update enabled
Advanced Options
--acp
Start as Agent Client Protocol server.
copilot --acpUse for: Integration with ACP-compatible tools
--disable-parallel-tools-execution
Disable parallel execution of tools.
copilot --disable-parallel-tools-executionEffect: Tools executed sequentially even if LLM requests parallel execution
Use when: Resource constraints or debugging
Option Combinations
Full Automation
copilot -p "task" --allow-all --no-ask-user -sSafe Automation
copilot -p "task" \
--allow-tool write \
--allow-tool 'shell(git:*)' \
--deny-tool 'shell(git push)' \
--add-dir ~/safe-workspaceDevelopment Session
copilot -i "Implement auth" \
--model claude-sonnet-4.5 \
--allow-all-tools \
--add-dir ~/projectCI/CD Integration
copilot -p "Run tests and fix failures" \
--allow-all \
--no-ask-user \
-s \
--no-color \
--share ./test-results.mdEnvironment Variables
Options can also be set via environment variables:
COPILOT_ALLOW_ALL- Equivalent to--allow-all-tools- See
copilot help environmentfor full list
Configuration Precedence
- Command-line flags (highest priority)
- Environment variables
- Configuration files in
~/.copilot/ - Defaults (lowest priority)