Skip to main content

Configuration System

Copilot Shell uses a layered configuration system that supports overrides from system-level down to project-level.

Configuration File Locations

LevelPathPurpose
System Settings/etc/copilot-shell/settings.jsonAdmin global policies
System Defaults/etc/copilot-shell/system-defaults.jsonSystem default values
User Settings~/.copilot-shell/settings.jsonPersonal preferences
Project Settings.copilot-shell/settings.jsonProject-level overrides

Priority (Highest to Lowest)

  1. CLI arguments
  2. Environment variables
  3. System settings (admin-enforced overrides)
  4. Project settings
  5. User settings
  6. System defaults

Higher-priority values override lower-priority ones. System settings serve as an administrator policy layer with priority above user and project settings, used to enforce organization-wide security policies.

Configuration Categories

general — General Settings

KeyTypeDefaultDescription
general.languagestring"auto"UI language (auto/en/zh-CN)
general.outputLanguagestring"auto"LLM output language
general.vimModebooleanfalseEnable Vim keybindings
general.preferredEditorstringPreferred editor
general.gitCoAuthorbooleantrueAuto-add Co-authored-by
general.terminalBellbooleantruePlay terminal bell on completion
general.chatRecordingbooleantrueSave chat history to disk
general.checkpointing.enabledbooleanfalseEnable session checkpoints

ui — UI Settings

KeyTypeDefaultDescription
ui.themestring"Copilot Shell Dark"Color theme
ui.hideTipsbooleanfalseHide tip messages
ui.showLineNumbersbooleanfalseShow line numbers in code
ui.compactModebooleanfalseCompact mode (Ctrl+O toggle)
ui.enableWelcomeBackbooleantrueShow "Welcome back" dialog
ui.customThemesobject{}Custom theme definitions

tools — Tool Settings

KeyTypeDefaultDescription
tools.approvalModeenum"default"Approval mode (plan/default/auto-edit/yolo)
tools.allowedarrayTools allowlisted for auto-execution
tools.excludearrayTools to exclude
tools.shell.enableInteractiveShellbooleanfalseEnable PTY interactive shell
tools.useRipgrepbooleantrueUse ripgrep for search

security — Security Settings

KeyTypeDefaultDescription
security.auth.selectedTypestringCurrent authentication type
security.auth.enforcedTypestringEnforced authentication type
security.auth.apiKeystringOpenAI-compatible API key
security.auth.baseUrlstringOpenAI-compatible Base URL
security.folderTrust.enabledbooleanfalseFolder trust

model — Model Settings

KeyTypeDefaultDescription
model.namestringCurrent model in use
model.maxSessionTurnsnumber-1Max session turns (-1 = unlimited)
model.sessionTokenLimitnumberSession token limit
model.chatCompressionobjectChat compression configuration
model.generationConfig.timeoutnumberRequest timeout (ms)
model.generationConfig.maxRetriesnumberMax retry count
model.generationConfig.contextWindowSizenumberOverride context window size

context — Context Settings

KeyTypeDefaultDescription
context.fileNamestringContext file name
context.includeDirectoriesarray[]Additional directories to include
context.fileFiltering.respectGitIgnorebooleantrueRespect .gitignore
context.fileFiltering.respectQwenIgnorebooleantrueRespect .copilotignore

mcp — MCP Servers

KeyTypeDefaultDescription
mcpServersobject{}MCP server configuration
mcp.allowedarrayAllowed MCP servers
mcp.excludedarrayExcluded MCP servers

hooksConfig — Hooks Configuration

KeyTypeDefaultDescription
hooksConfig.enabledbooleantrueEnable hooks system
hooksConfig.disabledarray[]List of disabled hook names

hooks — Hook Event Configuration

KeyTypeDescription
hooks.PreToolUsearrayHooks triggered before tool execution
hooks.UserPromptSubmitarrayHooks triggered before agent processing
hooks.StoparrayHooks triggered after agent processing

skills — Skills Configuration

KeyTypeDefaultDescription
skills.customPathsarray[]Custom skill search paths
skillOS.baseUrlstringRemote Skill-OS address
clawhub.registrystringClawhub registry URL
KeyTypeDescription
webSearch.providerarraySearch provider config (Tavily/Google/DashScope)
webSearch.defaultstringDefault search provider

autoMemory — Auto Memory

KeyTypeDefaultDescription
autoMemory.enabledbooleanfalseEnable automatic memory extraction
autoMemory.cooldownSecondsnumber1800Extraction cooldown (seconds)

Configuration Example

Full user configuration example (~/.copilot-shell/settings.json):

{
"general": {
"language": "en",
"outputLanguage": "English",
"vimMode": false
},
"ui": {
"theme": "Copilot Shell Dark",
"compactMode": false
},
"tools": {
"approvalMode": "default",
"shell": {
"enableInteractiveShell": true
}
},
"security": {
"auth": {
"selectedType": "aliyun"
}
},
"model": {
"generationConfig": {
"timeout": 60000,
"maxRetries": 3
}
}
}

Environment Variables

Some configuration supports environment variables:

VariableCorresponding Setting
OPENAI_API_KEYsecurity.auth.apiKey
OPENAI_BASE_URLsecurity.auth.baseUrl

Folder Trust

When Copilot Shell runs in a new project directory for the first time, project-level configuration (.copilot-shell/settings.json) is not trusted by default. Project settings only take effect after the user confirms trust for that directory.

This behavior is controlled by security.folderTrust.enabled.