Skip to main content

CLI Reference

Copilot Shell's command-line interface supports various flags and options to control startup behavior, authentication, tool configuration, and output format.

Basic Usage

cosh [options] [query]

Aliases: co, copilot

Common Options

OptionShortDescription
--help-hShow help information
--version-vShow version number
--debug-dEnable debug mode
--model <name>-mSpecify the model to use
--prompt <text>-pNon-interactive mode: execute prompt then exit
--prompt-interactive <text>-iExecute prompt then stay interactive
--yolo-yAuto-approve all operations (YOLO mode)

Session Options

OptionDescription
--continueResume the most recent session
--resume <id>Resume a session by ID
--max-session-turns <n>Limit maximum session turns

Approval Options

OptionDescription
--approval-mode <mode>Set approval mode (plan/default/auto-edit/yolo)
--checkpointingEnable file edit checkpoints (allows rollback)

Authentication Options

OptionDescription
--auth-type <type>Specify authentication type
--openai-api-key <key>OpenAI-compatible API key
--openai-base-url <url>OpenAI-compatible Base URL

Tool Options

OptionDescription
--allowed-tools <list>Allowed tools (comma-separated)
--exclude-tools <list>Excluded tools (comma-separated)
--core-tools <path>Core tool definition file path
--allowed-mcp-server-names <list>Allowed MCP servers (comma-separated)

Extension Options

OptionDescription
--extensions <list>Extensions to load (comma-separated)
--list-extensionsList all loaded extensions then exit

Input/Output Options

OptionShortDescription
--input-format <fmt>-IInput format (text/stream-json)
--output-format <fmt>-OOutput format (text/json/stream-json)
--include-partial-messagesInclude partial messages (stream-json only)

Advanced Options

OptionDescription
--all-files / -aInclude all files in context
--acpACP mode (Zed integration)
--proxy <url>Network proxy (format: schema://user:password@host:port)
--screen-readerScreen reader accessibility mode
--skip-startup-contextSkip workspace startup context
--skip-loop-detectionSkip loop detection

Usage Examples

Non-interactive Execution

# Execute a task then exit
cosh -p "List all TODO comments"

# Specify a model
cosh -m qwen3.7-max -p "Explain what this code does"

Resume Session

# Resume the most recent session
cosh --continue

# Resume a specific session
cosh --resume abc123

YOLO Mode

# Auto-approve all operations
cosh -y -p "Fix all lint errors"

JSON Output

# Output results in JSON format
cosh -O json -p "Analyze project dependencies"

Proxy Settings

cosh --proxy http://proxy.example.com:8080