Loading...
Loading...
Compare original and translation side by side
(Recommended)(推荐)| Type | Global | Project |
|---|---|---|
| Config | | |
| Rules | | |
| 类型 | 全局路径 | 项目路径 |
|---|---|---|
| 配置文件 | | |
| 规则文件 | | |
questionheaderlabelquestionheaderlabel{
"$schema": "https://opencode.ai/config.json",
"model": "anthropic/claude-sonnet-4-20250514",
"theme": "opencode",
"autoupdate": true
}{
"$schema": "https://opencode.ai/config.json",
"model": "anthropic/claude-sonnet-4-20250514",
"theme": "opencode",
"autoupdate": true
}| Option | Purpose | Example |
|---|---|---|
| Default model | |
| Lightweight tasks | |
| UI theme | |
| Auto-update OpenCode | |
| Session sharing | |
| 选项 | 用途 | 示例 |
|---|---|---|
| 默认模型 | |
| 轻量任务模型 | |
| UI主题 | |
| 自动更新OpenCode | |
| 会话共享 | |
permission{
"permission": {
"edit": "allow", // "allow" | "ask" | "deny"
"bash": {
"npm *": "allow", // pattern matching
"git *": "allow",
"rm *": "ask",
"*": "ask" // default for this tool
},
"webfetch": "allow",
"skill": {
"*": "allow",
"dangerous-*": "deny"
}
}
}permission{
"permission": {
"edit": "allow", // "allow" | "ask" | "deny"
"bash": {
"npm *": "allow", // 模式匹配
"git *": "allow",
"rm *": "ask",
"*": "ask" // 该工具的默认规则
},
"webfetch": "allow",
"skill": {
"*": "allow",
"dangerous-*": "deny"
}
}
}toolsmaxStepspermissionstepstoolsmaxStepspermissionsteps{
"instructions": [
"CONTRIBUTING.md",
"docs/guidelines.md",
".cursor/rules/*.md"
]
}references/config-schema.md{
"instructions": [
"CONTRIBUTING.md",
"docs/guidelines.md",
".cursor/rules/*.md"
]
}references/config-schema.md/init/initundefinedundefinedsrc/tests/src/tests/npm run buildnpm testundefinednpm run buildnpm testundefined{
"plugin": [
"opencode-openai-codex-auth@latest",
//"@tarquinen/opencode-dcp@latest", // disabled for now
//"@howaboua/pickle-thinker@0.4.0", // only for GLM-4.6
"@ramtinj95/opencode-tokenscope@latest"
]
}{
"plugin": [
"opencode-openai-codex-auth@latest",
//"@tarquinen/opencode-dcp@latest", // 暂时禁用
//"@howaboua/pickle-thinker@0.4.0", // 仅适用于GLM-4.6
"@ramtinj95/opencode-tokenscope@latest"
]
}opencode run "test"Error: Config file at ~/.config/opencode/opencode.json is not valid JSON(C):
--- Errors ---
CommaExpected at line 464, column 5
Line 464: "explore": {
^
--- End ---}opencode run "test"Error: Config file at ~/.config/opencode/opencode.json is not valid JSON(C):
--- Errors ---
CommaExpected at line 464, column 5
Line 464: "explore": {
^
--- End ---}{
"$schema": "https://opencode.ai/config.json",
"model": "anthropic/claude-sonnet-4-20250514",
"permission": {
"edit": "ask",
"bash": "ask"
}
}{
"$schema": "https://opencode.ai/config.json",
"model": "anthropic/claude-sonnet-4-20250514",
"permission": {
"edit": "ask",
"bash": "ask"
}
}{
"$schema": "https://opencode.ai/config.json",
"model": "anthropic/claude-sonnet-4-20250514",
"autoupdate": true,
"permission": {
"edit": "allow",
"bash": {
"*": "allow",
"rm -rf *": "deny",
"sudo *": "ask"
}
},
"instructions": ["CONTRIBUTING.md"]
}{
"$schema": "https://opencode.ai/config.json",
"model": "anthropic/claude-sonnet-4-20250514",
"autoupdate": true,
"permission": {
"edit": "allow",
"bash": {
"*": "allow",
"rm -rf *": "deny",
"sudo *": "ask"
}
},
"instructions": ["CONTRIBUTING.md"]
}{
"$schema": "https://opencode.ai/config.json",
"model": "anthropic/claude-sonnet-4-20250514",
"share": "auto",
"instructions": [
"docs/development.md",
"docs/api-guidelines.md"
]
}| Issue | Solution |
|---|---|
| Config not loading | Check JSON syntax, ensure valid path |
| Skill not found | Verify |
| Permission denied unexpectedly | Check global vs project config precedence |
{
"$schema": "https://opencode.ai/config.json",
"model": "anthropic/claude-sonnet-4-20250514",
"share": "auto",
"instructions": [
"docs/development.md",
"docs/api-guidelines.md"
]
}| 问题 | 解决方案 |
|---|---|
| 配置未加载 | 检查JSON语法,确保路径正确 |
| 未找到Skill | 验证 |
| 意外出现权限拒绝 | 检查全局与项目配置的优先级 |
references/config-schema.mdreferences/config-schema.md