配置参考
Oh My OpenAgent 高度自有主张,但可根据个人喜好调整。大多数用户无需配置——运行 bunx oh-my-opencode install 即可开始。
快速开始
{
"$schema": "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/master/assets/oh-my-opencode.schema.json",
"agents": {
"oracle": { "model": "openai/gpt-5.4", "variant": "high" },
"explore": { "model": "github-copilot/grok-code-fast-1" }
},
"categories": {
"quick": { "model": "opencode/gpt-5-nano" },
"visual-engineering": { "model": "google/gemini-3.1-pro" }
}
}配置文件位置
.opencode/oh-my-opencode.json(项目级)~/.config/opencode/oh-my-opencode.json(用户级)
支持 JSONC 格式,允许注释和尾随逗号。
Agents
为内置 Agent 配置特定行为:Sisyphus、Hephaestus、Oracle、Librarian、Explore、Multimodal Looker、Prometheus、Metis、Momus、Atlas 和 Frontend Engineer。
覆盖选项
| Option | Type | Default | Description |
|---|---|---|---|
| model | string | - | 模型标识符(例如 openai/gpt-4o) |
| variant | string | - | 模型变体(max、high、medium、low) |
| category | string | - | 从分类继承配置 |
| temperature | number | - | 采样温度(0-2) |
| top_p | number | - | Top-p 采样(0-1) |
| prompt | string | - | 完全覆盖系统提示词 |
| prompt_append | string | - | 在系统提示词后追加文本 |
| tools | Record | - | 启用或禁用特定工具 |
| disable | boolean | false | 禁用此 Agent |
| maxTokens | number | - | 响应的最大 token 数 |
| thinking | object | - | 扩展思考配置 |
| reasoningEffort | string | - | 推理强度:low、medium、high、xhigh |
权限
| Permission | Values | Description |
|---|---|---|
| edit | ask / allow / deny | 文件编辑能力 |
| bash | ask / allow / deny | Bash 命令执行 |
| webfetch | ask / allow / deny | 网络请求能力 |
| doom_loop | ask / allow / deny | 无限循环覆盖 |
| external_directory | ask / allow / deny | 访问项目外部文件 |
分类
分类允许你定义 Agent 可以继承的共享配置。
| Category | Default Model | Description |
|---|---|---|
| visual-engineering | gemini-3.1-pro (high) | 前端、UI/UX、设计任务 |
| ultrabrain | gpt-5.3-codex (xhigh) | 深度逻辑推理 |
| deep | gpt-5.3-codex (medium) | 自主解决问题与深入研究 |
| artistry | gemini-3.1-pro (high) | 创意任务 |
| quick | claude-haiku-4-5 | 简单、快速任务 |
| unspecified-low | claude-sonnet-4-6 | 低投入一般任务 |
| unspecified-high | gpt-5.4 (high) | 高投入一般任务 |
| writing | gemini-3-flash | 文档和写作 |
分类可用选项:model, variant, temperature, top_p, maxTokens, thinking, reasoningEffort, textVerbosity, tools, prompt_append, is_unstable_agent。
Skills
内置技能包括 playwright、agent-browser 和 git-master。你也可以定义自定义技能。
"skills": {
"my-custom-skill": {
"description": "A custom skill for specific tasks",
"instructions": "Always use this skill when..."
}
}后台任务
| Option | Type | Default | Description |
|---|---|---|---|
| defaultConcurrency | number | - | 默认最大并发任务数 |
| staleTimeoutMs | number | - | 过时任务超时时间(毫秒) |
| providerConcurrency | number | - | 每个提供商的并发限制 |
| modelConcurrency | number | - | 每个模型的并发限制 |
优先级:modelConcurrency >providerConcurrency >defaultConcurrency
钩子
钩子允许你在各个生命周期点扩展功能。
agent-usage-reminder
anthropic-context-window-limit-recovery
anthropic-effort
atlas
auto-slash-command
auto-update-checker
background-notification
category-skill-reminder
claude-code-hooks
comment-checker
compaction-context-injector
compaction-todo-preserver
delegate-task-retry
directory-agents-injector
directory-readme-injector
edit-error-recovery
interactive-bash-session
keyword-detector
non-interactive-env
prometheus-md-only
question-label-truncator
ralph-loop
rules-injector
session-recovery
sisyphus-junior-notepad
start-work
stop-continuation-guard
subagent-question-blocker
task-reminder
task-resume-info
tasks-todowrite-disabler
think-mode
thinking-block-validator
unstable-agent-babysitter
write-existing-file-guard
MCPs
websearch
由 Exa 驱动,提供高质量搜索结果。
context7
文档检索和上下文管理。
grep_app
GitHub 代码搜索集成。
浏览器自动化
| Tool | Description | Use Case |
|---|---|---|
| playwright | 完整的浏览器自动化(默认) | 测试、复杂交互 |
| agent-browser | 轻量级浏览器 Agent | 快速查询、简单抓取 |
Tmux 集成
| Option | Type | Default | Description |
|---|---|---|---|
| enabled | boolean | - | 启用 Tmux 集成 |
| layout | string | - | Tmux 窗口布局 |
| main_pane_size | string | - | 主面板大小 |
Git Master
| Option | Type | Default | Description |
|---|---|---|---|
| commit_footer | string | - | 追加到提交消息的文本 |
| include_co_authored_by | boolean | - | 添加 Co-authored-by 标记 |
实验性功能
| Option | Type | Default | Description |
|---|---|---|---|
| aggressive_truncation | boolean | - | 积极截断输出 |
| auto_resume | boolean | - | 自动恢复中断的任务 |
| preemptive_compaction | boolean | - | 在达到限制前压缩上下文 |
| truncate_all_tool_outputs | boolean | - | 截断所有工具输出 |
LSP 配置
| Option | Type | Default | Description |
|---|---|---|---|
| command | string | - | LSP 服务器命令 |
| extensions | array | - | 匹配的文件扩展名 |
| priority | number | - | 服务器优先级 |
| env | object | - | 环境变量 |
| initialization | object | - | 初始化选项 |
| disabled | boolean | - | 禁用此 LSP |
环境变量
OPENCODE_CONFIG_DIR
覆盖默认配置目录路径。
注释检查器
验证代码中的注释。在自定义提示词中使用 {{comments}} 占位符。