コンテンツにスキップ

パーソナライズ

好みやワークフローに合わせて 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.jsonThemes
キーボードショートカットtui.jsonKeybinds
モデル・プロバイダー・認証情報opencode.jsonModels, Providers
エージェントとプロンプトopencode.jsonAgents
ツール権限opencode.jsonPermissions
保存時の自動フォーマットopencode.jsonFormatters
言語サーバーopencode.jsonLSP
MCP サーバーopencode.jsonMCP servers
プロジェクトルールAGENTS.mdRules