Skip to Content
用户指南设置参考

设置参考

本页列出常用及进阶的用户设置。如何选择配置文件、优先级与信任规则见设置指南。键名中的点表示嵌套对象,不应原样作为 JSON 的顶层键。

{ "ui": { "showLineNumbers": true }, "general": { "plan": { "enabled": true } } }

表中的缺省值描述源码定义;未设置值可能由宿主、模型或运行时策略决定。需要重启的字段应重启进程验证。outputStyle 对新对话生效,请用 /clear 或 /new。

模型与行为

键类型缺省重启用途
model.namestring未设置 / 由运行时决定否默认模型标识
model.reasoningEffortenum未设置 / 由运行时决定否已废弃:已迁移到 model.preferences[modelId].reasoning.effort。支持推理强度档位的模型使用的推理强度。
model.contextWindownumber未设置 / 由运行时决定否已废弃:已迁移到 model.preferences[modelId].contextWindow。支持上下文窗口选项的模型使用的上下文窗口(token 数)。
outputStylestring未设置 / 由运行时决定是输出风格
languagestring未设置 / 由运行时决定是偏好的回复语言
agent’string’ as const未设置 / 由运行时决定是默认 Agent
general.maxAttemptsnumber由 CLI 宿主注入否主模型请求最大尝试次数(含首次)
general.retryFetchErrorsbooleantrue否重试符合条件的 fetch 错误
output.formatenumtext否默认输出格式
autoMemoryEnabledboolean未设置 / 由运行时决定是项目自动记忆。未设置时,交互会话中默认开启;非交互运行默认关闭,设置 QWEN_MEMORY_HEADLESS=1 可开启。
autoMemoryUserScopeEnabledboolean未设置 / 由运行时决定是用户级自动记忆。未设置时,交互会话中默认开启;非交互运行默认关闭,设置 QWEN_MEMORY_HEADLESS=1 可开启。

权限与信任

键类型缺省重启用途
general.defaultPermissionModestringdefault否默认权限模式
security.folderTrust.enabledbooleantrue是启用文件夹可信检查
security.disableYoloModebooleanfalse是禁止绕过权限模式
permissions.additionalDirectoriesarray[]否额外工作目录
permissions.trustDirectoriesarray[]否可信目录
security.enableAllExternalImportsbooleanfalse是允许全部外部指令导入
security.approvedExternalImportProjectsarray[]是批准外部指令导入的项目
security.environmentVariableRedaction.enabledbooleanfalse是子进程敏感环境变量过滤
security.environmentVariableRedaction.allowedarray[]是允许的环境变量规则
security.environmentVariableRedaction.blockedarray[]是阻止的环境变量规则

上下文与工作目录

键类型缺省重启用途
context.fileNamestringAGENTS.md否指令文件名
context.discoveryMaxDirsnumber200否指令发现最多扫描目录数
context.memoryBoundaryMarkersarray['.git']是指令发现边界标记
context.loadMemoryFromIncludeDirectoriesbooleanfalse否从额外目录加载指令
context.fileFiltering.respectGitIgnorebooleantrue是遵守 Git 忽略规则
context.fileFiltering.respectBrandIgnorebooleantrue是遵守产品忽略文件
context.fileFiltering.customIgnoreFilePathsarray[]是额外忽略规则文件
agentsMdExcludesarray[]是排除指令文件的模式
worktree.baseRefstring'fresh'是worktree 起点策略
worktree.sparsePathsarray[]是worktree 稀疏检出路径
worktree.symlinkDirectoriesarray[]是worktree 链接目录
general.fileCheckpointing.enabledbooleantrue是启用文件检查点
general.plan.enabledbooleantrue是启用规划模式
general.plan.directorystring未设置 / 由运行时决定是规划文件目录;自定义写入仍需授权

工具与扩展

键类型缺省重启用途
tools.corearray未设置 / 由运行时决定是限制内置工具集合
tools.excludearray未设置 / 由运行时决定是排除的工具
tools.shell.pagerstring'cat'否Shell 分页器
tools.shell.showColorbooleantrue否Shell 输出保留颜色
tools.shell.inactivityTimeoutnumber300否Shell 无输出超时(秒)
tools.useRipgrepbooleantrue否使用 ripgrep 搜索
mcp.allowedarray未设置 / 由运行时决定是允许的 MCP 服务
mcp.excludedarray未设置 / 由运行时决定是排除的 MCP 服务
mcp.enableAllProjectMcpServersbooleanfalse是批准全部项目 MCP 服务
mcp.enabledProjectMcpServersarray[]是已批准的项目 MCP 服务
mcp.disabledProjectMcpServersarray[]是禁用的项目 MCP 服务
mcp.lazyLoadbooleanfalse是延迟加载 MCP
skills.enabledbooleantrue是启用 Skills
skills.loadFromAgentsDirectorybooleantrue是从兼容 agents 目录加载 Skills
skills.disabledarray[]是禁用的 Skills
skills.disableShellExecutionbooleanfalse否禁止 Skill Shell 执行
plugins.enabledarray[]是已废弃:请改用顶层 enabledPlugins。仅为迁移保留。
plugins.disabledarray[]是已废弃:请改用顶层 enabledPlugins 并将值设为 false。仅为迁移保留。
plugins.autoUpdatebooleantrue否插件自动更新
disableAllHooksbooleanfalse否为 true 时,无论各项单独设置如何,禁用全部 Hook 和 statusLine 执行。顶层总开关。
allowedHttpHookUrlsarray未设置 / 由运行时决定是允许的 HTTP Hook URL 规则
hooksConfig.enabledbooleantrue是启用 Hook 系统
hooksConfig.notificationsbooleanfalse否显示 Hook 通知
hooksConfig.headlessFastModebooleanfalse是非交互 Hook 快速模式
experimental.enableAgentsbooleantrue是启用 Agent 功能(实验设置)

终端界面

键类型缺省重启用途
ui.languageenumen否界面语言
ui.themestring'auto'否主题
ui.autoThemeSwitchingbooleantrue否自动切换主题
general.preferredEditorstring未设置 / 由运行时决定否首选编辑器
general.vimModebooleanfalse否Vim 编辑模式
ui.hideWindowTitlebooleanfalse是隐藏窗口标题
ui.inlineThinkingModeenumfull否思考过程显示方式
ui.showShortcutsHintbooleantrue否显示快捷键提示
ui.compactToolOutputbooleantrue否紧凑工具输出
ui.copyFullResponsebooleanfalse否复制完整回答
ui.hideBannerbooleanfalse否隐藏横幅
ui.hideContextSummarybooleanfalse否隐藏上下文摘要
ui.hideFooterbooleanfalse否已废弃并忽略;只为兼容旧配置保留
ui.showLineNumbersbooleantrue否显示行号
ui.renderMermaidbooleantrue否渲染 Mermaid
ui.errorVerbosityenumlow否错误显示详细程度
ui.accessibility.screenReaderbooleanfalse是屏幕阅读器纯文本输出
statusLine.typestringcommand否自定义状态栏类型
statusLine.commandstring""否状态栏脚本命令
statusLine.paddingnumber0否状态栏内边距

更新与数据

键类型缺省重启用途
general.enableAutoUpdatebooleantrue否自动更新;仍需可用发行源
general.enableAutoUpdateNotificationbooleantrue否显示更新通知
general.enableNotificationsbooleanfalse否运行事件通知
privacy.usageStatisticsEnabledbooleantrue否使用统计;关闭进入隐私模式,并非停止全部遥测
general.sessionRetention.enabledbooleanfalse否自动清理会话
general.sessionRetention.maxAgestring'30d'否会话保留时长
general.sessionRetention.maxCountnumber未设置 / 由运行时决定否按数量清理的目标上限;不适用于所有对话 JSONL
general.sessionRetention.minRetentionstring由 CLI 宿主注入否最短保留期保护
advanced.useProxyFromEnvironmentbooleantrue是读取环境中的代理配置
advanced.excludedEnvVarsarray['DEBUG', 'DEBUG_MODE']否qwen mcp list 启动 MCP 服务器时不传递的环境变量。会话和 .env 加载不使用此设置。

复杂配置与高级边界

providers、mcpServers、hooks、permissions、插件市场及 Agent 定义有各自结构,不能用上述标量表替代。按模型、MCP、Hooks、权限、插件和子 Agent中的示例配置。

配置 schema 定义在源码文件 packages/resource/src/settings/settingsSchema.ts 中;它也包含宿主集成、兼容和实验字段(源码仓库中的 schemas/settings.schema.json 是为另一个产品构建生成的,不适用于 Qwen Code),不应把字段存在解释为稳定公开功能承诺。不要复制陌生的内部设置来绕过功能限制。模型覆盖、团队协议、调试与运行时注入字段不在本页的用户配置承诺内。

Last updated on