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