パーソナライズ
好みやワークフローに合わせて OpenCode をカスタマイズします。以下の設定は、所有ファイルごとにまとめられています。
インターフェース設定 → tui.json
ターミナル UI には独自の設定ファイルがあります。~/.config/opencode/tui.json(または tui.jsonc)を作成して必要なキーを設定します。
テーマ
{
"$schema": "https://opencode.ai/tui.json",
"theme": "tokyonight"
}
Built-in themes include system, tokyonight, everforest, ayu, catppuccin, catppuccin-macchiato, gruvbox, kanagawa, nord, matrix, and one-dark. Custom themes are JSON files — see Themes.
キーバインド
{
"$schema": "https://opencode.ai/tui.json",
"keybinds": {
"leader": "ctrl+x",
"command_list": "ctrl+p",
"theme_list": "<leader>t"
}
}
Disable a binding with "none". See Keybinds for the full list.
通知・カーソル・スクロール
{
"$schema": "https://opencode.ai/tui.json",
"attention": {
"enabled": true,
"notifications": true,
"sound": true,
"volume": 0.4
},
"cursor": {
"style": "blink",
"blink": true
},
"scroll_speed": 3
}
エージェントとランタイム設定 → opencode.json
デフォルトモデルとエージェント
{
"$schema": "https://opencode.ai/config.json",
"model": "anthropic/claude-sonnet-5-5",
"small_model": "anthropic/claude-haiku-5-5",
"default_agent": "build"
}
カスタムエージェント
{
"$schema": "https://opencode.ai/config.json",
"agent": {
"reviewer": {
"description": "Reviews code for correctness",
"model": "anthropic/claude-sonnet-5-5",
"prompt": "You are a code reviewer.",
"tools": { "write": false, "edit": false }
}
}
}
権限
{
"$schema": "https://opencode.ai/config.json",
"permission": {
"edit": "ask",
"bash": "ask",
"webfetch": "allow"
}
}
フォーマッタと LSP サーバー
{
"$schema": "https://opencode.ai/config.json",
"formatter": true,
"lsp": true
}
指示・参照・ウォッチャー
{
"$schema": "https://opencode.ai/config.json",
"instructions": ["CONTRIBUTING.md", ".cursor/ja/rules/*.md"],
"watcher": {
"ignore": ["**/generated/**"]
}
}
ignore は watcher の配下です。トップレベルキーではありません。
次のステップ
| 変更したいもの | ファイル | ページ |
|---|---|---|
| 色とカスタムテーマ | tui.json | Themes |
| キーボードショートカット | tui.json | Keybinds |
| モデル・プロバイダー・認証情報 | opencode.json | Models, Providers |
| エージェントとプロンプト | opencode.json | Agents |
| ツール権限 | opencode.json | Permissions |
| 保存時の自動フォーマット | opencode.json | Formatters |
| 言語サーバー | opencode.json | LSP |
| MCP サーバー | opencode.json | MCP servers |
| プロジェクトルール | AGENTS.md | Rules |