opencode-schema.json

  1{
  2  "$schema": "http://json-schema.org/draft-07/schema#",
  3  "definitions": {
  4    "agent": {
  5      "description": "Agent configuration",
  6      "properties": {
  7        "maxTokens": {
  8          "description": "Maximum tokens for the agent",
  9          "minimum": 1,
 10          "type": "integer"
 11        },
 12        "model": {
 13          "description": "Model ID for the agent",
 14          "enum": [
 15            "gemini-2.0-flash",
 16            "bedrock.claude-3.7-sonnet",
 17            "claude-3-opus",
 18            "claude-3.5-sonnet",
 19            "gpt-4o-mini",
 20            "o1",
 21            "o3-mini",
 22            "o1-pro",
 23            "o4-mini",
 24            "claude-3-haiku",
 25            "gpt-4o",
 26            "o3",
 27            "gpt-4.1-mini",
 28            "gpt-4.5-preview",
 29            "gemini-2.5-flash",
 30            "claude-3.5-haiku",
 31            "gpt-4.1",
 32            "gemini-2.0-flash-lite",
 33            "claude-3.7-sonnet",
 34            "o1-mini",
 35            "gpt-4.1-nano",
 36            "gemini-2.5"
 37          ],
 38          "type": "string"
 39        },
 40        "reasoningEffort": {
 41          "description": "Reasoning effort for models that support it (OpenAI, Anthropic)",
 42          "enum": [
 43            "low",
 44            "medium",
 45            "high"
 46          ],
 47          "type": "string"
 48        }
 49      },
 50      "required": [
 51        "model"
 52      ],
 53      "type": "object"
 54    }
 55  },
 56  "description": "Configuration schema for the OpenCode application",
 57  "properties": {
 58    "agents": {
 59      "additionalProperties": {
 60        "description": "Agent configuration",
 61        "properties": {
 62          "maxTokens": {
 63            "description": "Maximum tokens for the agent",
 64            "minimum": 1,
 65            "type": "integer"
 66          },
 67          "model": {
 68            "description": "Model ID for the agent",
 69            "enum": [
 70              "gemini-2.0-flash",
 71              "bedrock.claude-3.7-sonnet",
 72              "claude-3-opus",
 73              "claude-3.5-sonnet",
 74              "gpt-4o-mini",
 75              "o1",
 76              "o3-mini",
 77              "o1-pro",
 78              "o4-mini",
 79              "claude-3-haiku",
 80              "gpt-4o",
 81              "o3",
 82              "gpt-4.1-mini",
 83              "gpt-4.5-preview",
 84              "gemini-2.5-flash",
 85              "claude-3.5-haiku",
 86              "gpt-4.1",
 87              "gemini-2.0-flash-lite",
 88              "claude-3.7-sonnet",
 89              "o1-mini",
 90              "gpt-4.1-nano",
 91              "gemini-2.5"
 92            ],
 93            "type": "string"
 94          },
 95          "reasoningEffort": {
 96            "description": "Reasoning effort for models that support it (OpenAI, Anthropic)",
 97            "enum": [
 98              "low",
 99              "medium",
100              "high"
101            ],
102            "type": "string"
103          }
104        },
105        "required": [
106          "model"
107        ],
108        "type": "object"
109      },
110      "description": "Agent configurations",
111      "properties": {
112        "coder": {
113          "$ref": "#/definitions/agent"
114        },
115        "task": {
116          "$ref": "#/definitions/agent"
117        },
118        "title": {
119          "$ref": "#/definitions/agent"
120        }
121      },
122      "type": "object"
123    },
124    "data": {
125      "description": "Storage configuration",
126      "properties": {
127        "directory": {
128          "default": ".opencode",
129          "description": "Directory where application data is stored",
130          "type": "string"
131        }
132      },
133      "required": [
134        "directory"
135      ],
136      "type": "object"
137    },
138    "debug": {
139      "default": false,
140      "description": "Enable debug mode",
141      "type": "boolean"
142    },
143    "debugLSP": {
144      "default": false,
145      "description": "Enable LSP debug mode",
146      "type": "boolean"
147    },
148    "lsp": {
149      "additionalProperties": {
150        "description": "LSP configuration for a language",
151        "properties": {
152          "args": {
153            "description": "Command arguments for the LSP server",
154            "items": {
155              "type": "string"
156            },
157            "type": "array"
158          },
159          "command": {
160            "description": "Command to execute for the LSP server",
161            "type": "string"
162          },
163          "disabled": {
164            "default": false,
165            "description": "Whether the LSP is disabled",
166            "type": "boolean"
167          },
168          "options": {
169            "description": "Additional options for the LSP server",
170            "type": "object"
171          }
172        },
173        "required": [
174          "command"
175        ],
176        "type": "object"
177      },
178      "description": "Language Server Protocol configurations",
179      "type": "object"
180    },
181    "mcpServers": {
182      "additionalProperties": {
183        "description": "MCP server configuration",
184        "properties": {
185          "args": {
186            "description": "Command arguments for the MCP server",
187            "items": {
188              "type": "string"
189            },
190            "type": "array"
191          },
192          "command": {
193            "description": "Command to execute for the MCP server",
194            "type": "string"
195          },
196          "env": {
197            "description": "Environment variables for the MCP server",
198            "items": {
199              "type": "string"
200            },
201            "type": "array"
202          },
203          "headers": {
204            "additionalProperties": {
205              "type": "string"
206            },
207            "description": "HTTP headers for SSE type MCP servers",
208            "type": "object"
209          },
210          "type": {
211            "default": "stdio",
212            "description": "Type of MCP server",
213            "enum": [
214              "stdio",
215              "sse"
216            ],
217            "type": "string"
218          },
219          "url": {
220            "description": "URL for SSE type MCP servers",
221            "type": "string"
222          }
223        },
224        "required": [
225          "command"
226        ],
227        "type": "object"
228      },
229      "description": "Model Control Protocol server configurations",
230      "type": "object"
231    },
232    "providers": {
233      "additionalProperties": {
234        "description": "Provider configuration",
235        "properties": {
236          "apiKey": {
237            "description": "API key for the provider",
238            "type": "string"
239          },
240          "disabled": {
241            "default": false,
242            "description": "Whether the provider is disabled",
243            "type": "boolean"
244          },
245          "provider": {
246            "description": "Provider type",
247            "enum": [
248              "anthropic",
249              "openai",
250              "gemini",
251              "groq",
252              "bedrock"
253            ],
254            "type": "string"
255          }
256        },
257        "type": "object"
258      },
259      "description": "LLM provider configurations",
260      "type": "object"
261    },
262    "wd": {
263      "description": "Working directory for the application",
264      "type": "string"
265    }
266  },
267  "title": "OpenCode Configuration",
268  "type": "object"
269}