Config Schema
.dscc.json / .dscc/settings.json /
.dscc/settings.local.json 的完整
schema。源头:crates/runtime/src/config.rs(1294 行)。
顶层字段
| Key | 类型 | 默认 | 作用 | Cite |
|---|---|---|---|---|
model |
string | — | 覆盖默认模型 | config.rs:552–557 |
env |
object | {} |
注入的环境变量 | config.rs |
hooks.PreToolUse |
string[] | [] |
每次工具调用前执行的 shell 命令 | config.rs:568 |
hooks.PostToolUse |
string[] | [] |
每次工具调用后执行的 shell 命令 | config.rs:570 |
permissions.defaultMode |
string | "default" |
取值:default / plan /
read-only、acceptEdits / auto /
workspace-write、dontAsk /
danger-full-access |
config.rs:618 |
permissionMode |
string | — | 扁平写法,等同于 permissions.defaultMode |
config.rs:611 |
mcpServers.<name> |
object | — | 每个 MCP server 的配置(见下) | config.rs:531–550 |
plugins.enabled |
{[id]: bool} |
{} |
每个插件启用状态 | config.rs:590–591 |
plugins.externalDirectories |
string[] | [] |
额外插件搜索目录 | config.rs:593–595 |
plugins.installRoot |
string | — | 插件安装目录覆盖 | config.rs:596–597 |
plugins.registryPath |
string | — | 插件注册表文件覆盖 | config.rs:598–599 |
plugins.bundledRoot |
string | — | 打包插件目录 | config.rs:600–601 |
enabledPlugins |
object | {} |
扁平写法的启用表 | config.rs:581–582 |
sandbox.enabled |
bool | true |
开启沙箱 | config.rs:651 |
sandbox.namespaceRestrictions |
bool | true |
命名空间隔离 | config.rs:652–655 |
sandbox.networkIsolation |
bool | false |
屏蔽网络 | config.rs:657 |
sandbox.filesystemMode |
"off"|"workspace-only"|"allow-list" |
"workspace-only" |
文件系统模式 | config.rs:647–649 |
sandbox.allowedMounts |
string[] | [] |
文件系统挂载白名单 | config.rs:659–660 |
oauth.clientId |
string | — | OAuth client id | config.rs:683 |
oauth.authorizeUrl |
string | — | Auth endpoint | config.rs:684 |
oauth.tokenUrl |
string | — | Token endpoint | config.rs:685 |
oauth.callbackPort |
number | — | 回调端口 | config.rs:686 |
oauth.manualRedirectUrl |
string | — | 手动跳转备用地址 | config.rs:687–688 |
oauth.scopes |
string[] | [] |
OAuth scopes | config.rs:689 |
mcpServers.<name>
字段
结构体定义在 config.rs:75–127,加载器
config.rs:700–735。
| 字段 | 适用类型 | 作用 |
|---|---|---|
type |
全部 | stdio | sse | http |
ws | sdk | managed-proxy |
command |
stdio | 可执行文件 |
args |
stdio | 命令行参数 |
env |
stdio | 环境变量 |
url |
sse / http / ws / managed-proxy | endpoint |
headers |
远程 | HTTP headers |
headersHelper |
远程 | 动态 headers 脚本路径 |
oauth.clientId |
远程 | 该 server 专用 OAuth client id |
oauth.callbackPort |
远程 | 回调端口 |
oauth.authServerMetadataUrl |
远程 | OIDC metadata URL |
oauth.xaa |
远程 | 扩展属性标志 |
name |
sdk | SDK server id |
id |
managed-proxy | 代理 server id |
优先级
由低到高:
~/.dscc.json~/.dscc/settings.json./.dscc.json./.dscc/settings.json./.dscc/settings.local.json
后者按 key 覆盖前者。
完整示例
参见上方英文小节的 JSON 示例;所有字段都在此文档表格中列出,示例覆盖 hooks、permissions、mcpServers、plugins、sandbox、oauth。