Skip to main content

Configuration

The three cosh-ng binaries share the configuration file ~/.copilot-shell/config.toml. Environment variable overrides and CLI parameter precedence are supported.

Configuration File Locations

Configuration is loaded in the following priority order (highest to lowest):

  1. .copilot-shell/config.toml (project-level, current directory)
  2. ~/.copilot-shell/config.toml (user-level)
  3. /etc/copilot-shell/config.toml (system-level)

cosh-core Configuration

[ai]
# Active model identifier
active_model = "qwen-plus"
# Output language (optional)
output_language = "zh"

[ai.providers.aliyun]
type = "aliyun"
access_key_id = "" # Or via ALIBABA_CLOUD_ACCESS_KEY_ID
access_key_secret = "" # Or via ALIBABA_CLOUD_ACCESS_KEY_SECRET
model = "qwen-plus"

[ai.providers.dashscope]
type = "dashscope"
base_url = "https://dashscope.aliyuncs.com/compatible-mode/v1"
api_key = "" # Or via DASHSCOPE_API_KEY
model = "qwen-plus"

[agent]
# Approval mode: trust | auto | balanced | suggest | strict
approval_mode = "balanced"
# Maximum conversation turns
max_turns = 20

[hooks]
enabled = true

[skills]
# Custom skill search paths
custom_paths = []

[session]
# Session persistence directory (relative to ~/.copilot-shell/)
persist_dir = "sessions"
auto_persist = true

[logging]
level = "warn"

cosh-shell Configuration

[ui]
# Log level
log_level = "warn"

[shell]
# Default shell (auto = auto-detect)
default = "auto"
# Default AI adapter
adapter_default = "cosh-core"
# Analysis mode (smart | auto | manual)
analysis_mode = "smart"
# Approval mode (recommend | auto | trust)
approval_mode = "auto"

Environment Variable Overrides

Environment VariablePurposeMapped Configuration
COSH_MODELOverride active modelai.active_model
COSH_APPROVAL_MODEOverride approval modeagent.approval_mode
COSH_AI_PROVIDEROverride active providerai.active_provider
COSH_OUTPUT_LANGUAGEOutput languageai.output_language
COSH_MAX_TURNSMaximum turnsagent.max_turns
COSH_LOGLog level (global)logging.level
RUST_LOGRust log filter
COSH_SHELL_ADAPTERShell adaptershell.adapter_default
COSH_SHELL_DEBUGMaps to debug levelui.log_level
COSH_SHELL_LANGShell language
ALIBABA_CLOUD_ACCESS_KEY_IDAlibaba Cloud AKai.providers.aliyun.access_key_id
ALIBABA_CLOUD_ACCESS_KEY_SECRETAlibaba Cloud SKai.providers.aliyun.access_key_secret
DASHSCOPE_API_KEYDashScope API KeyProvider resolution chain

Log Level Priority

COSH_LOG > RUST_LOG > --verbose > config file > default (warn)

Valid values: error, warn, info, debug, trace

Log Files

~/.copilot-shell/logs/
├── cosh-shell.log.2026-06-26 # Daily rotation
├── cosh-core.log.2026-06-26
└── ...

Approval Mode Reference

ModeReadOnly ToolsFileEdit ToolsShellExec Tools
trustAuto-executeAuto-executeAuto-execute
autoAuto-executeAuto-executeRequire approval
balancedAuto-executeRequire approvalRequire approval
suggestAuto-executeRequire approvalRequire approval
strictAuto-executeRequire approvalRequire approval