1{
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "$id": "https://github.com/charmbracelet/crush/internal/config/config",
4 "$ref": "#/$defs/Config",
5 "$defs": {
6 "Config": {
7 "properties": {
8 "models": {
9 "additionalProperties": {
10 "$ref": "#/$defs/SelectedModel"
11 },
12 "type": "object",
13 "description": "Model configurations for different model types"
14 },
15 "providers": {
16 "additionalProperties": {
17 "$ref": "#/$defs/ProviderConfig"
18 },
19 "type": "object",
20 "description": "AI provider configurations"
21 },
22 "mcp": {
23 "$ref": "#/$defs/MCPs",
24 "description": "Model Context Protocol server configurations"
25 },
26 "lsp": {
27 "$ref": "#/$defs/LSPs",
28 "description": "Language Server Protocol configurations"
29 },
30 "options": {
31 "$ref": "#/$defs/Options",
32 "description": "General application options"
33 },
34 "permissions": {
35 "$ref": "#/$defs/Permissions",
36 "description": "Permission settings for tool usage"
37 }
38 },
39 "additionalProperties": false,
40 "type": "object"
41 },
42 "LSPConfig": {
43 "properties": {
44 "enabled": {
45 "type": "boolean",
46 "description": "Whether this LSP server is disabled",
47 "default": false
48 },
49 "command": {
50 "type": "string",
51 "description": "Command to execute for the LSP server",
52 "examples": [
53 "gopls"
54 ]
55 },
56 "args": {
57 "items": {
58 "type": "string"
59 },
60 "type": "array",
61 "description": "Arguments to pass to the LSP server command"
62 },
63 "options": {
64 "description": "LSP server-specific configuration options"
65 }
66 },
67 "additionalProperties": false,
68 "type": "object",
69 "required": [
70 "command"
71 ]
72 },
73 "LSPs": {
74 "additionalProperties": {
75 "$ref": "#/$defs/LSPConfig"
76 },
77 "type": "object"
78 },
79 "MCPConfig": {
80 "properties": {
81 "command": {
82 "type": "string",
83 "description": "Command to execute for stdio MCP servers",
84 "examples": [
85 "npx"
86 ]
87 },
88 "env": {
89 "additionalProperties": {
90 "type": "string"
91 },
92 "type": "object",
93 "description": "Environment variables to set for the MCP server"
94 },
95 "args": {
96 "items": {
97 "type": "string"
98 },
99 "type": "array",
100 "description": "Arguments to pass to the MCP server command"
101 },
102 "type": {
103 "$ref": "#/$defs/MCPType",
104 "description": "Type of MCP connection"
105 },
106 "url": {
107 "type": "string",
108 "format": "uri",
109 "description": "URL for HTTP or SSE MCP servers",
110 "examples": [
111 "http://localhost:3000/mcp"
112 ]
113 },
114 "disabled": {
115 "type": "boolean",
116 "description": "Whether this MCP server is disabled",
117 "default": false
118 },
119 "headers": {
120 "additionalProperties": {
121 "type": "string"
122 },
123 "type": "object",
124 "description": "HTTP headers for HTTP/SSE MCP servers"
125 }
126 },
127 "additionalProperties": false,
128 "type": "object",
129 "required": [
130 "type"
131 ]
132 },
133 "MCPType": {
134 "type": "string",
135 "enum": [
136 "stdio",
137 "sse",
138 "http"
139 ],
140 "description": "Type of MCP connection protocol",
141 "default": "stdio"
142 },
143 "MCPs": {
144 "additionalProperties": {
145 "$ref": "#/$defs/MCPConfig"
146 },
147 "type": "object"
148 },
149 "Model": {
150 "properties": {
151 "id": {
152 "type": "string"
153 },
154 "name": {
155 "type": "string"
156 },
157 "cost_per_1m_in": {
158 "type": "number"
159 },
160 "cost_per_1m_out": {
161 "type": "number"
162 },
163 "cost_per_1m_in_cached": {
164 "type": "number"
165 },
166 "cost_per_1m_out_cached": {
167 "type": "number"
168 },
169 "context_window": {
170 "type": "integer"
171 },
172 "default_max_tokens": {
173 "type": "integer"
174 },
175 "can_reason": {
176 "type": "boolean"
177 },
178 "has_reasoning_efforts": {
179 "type": "boolean"
180 },
181 "default_reasoning_effort": {
182 "type": "string"
183 },
184 "supports_attachments": {
185 "type": "boolean"
186 }
187 },
188 "additionalProperties": false,
189 "type": "object",
190 "required": [
191 "id",
192 "name",
193 "cost_per_1m_in",
194 "cost_per_1m_out",
195 "cost_per_1m_in_cached",
196 "cost_per_1m_out_cached",
197 "context_window",
198 "default_max_tokens",
199 "can_reason",
200 "has_reasoning_efforts",
201 "supports_attachments"
202 ]
203 },
204 "Options": {
205 "properties": {
206 "context_paths": {
207 "items": {
208 "type": "string",
209 "examples": [
210 ".cursorrules",
211 "CRUSH.md"
212 ]
213 },
214 "type": "array",
215 "description": "Paths to files containing context information for the AI"
216 },
217 "tui": {
218 "$ref": "#/$defs/TUIOptions",
219 "description": "Terminal user interface options"
220 },
221 "debug": {
222 "type": "boolean",
223 "description": "Enable debug logging",
224 "default": false
225 },
226 "debug_lsp": {
227 "type": "boolean",
228 "description": "Enable debug logging for LSP servers",
229 "default": false
230 },
231 "disable_auto_summarize": {
232 "type": "boolean",
233 "description": "Disable automatic conversation summarization",
234 "default": false
235 },
236 "data_directory": {
237 "type": "string",
238 "description": "Directory for storing application data (relative to working directory)",
239 "default": ".crush",
240 "examples": [
241 ".crush"
242 ]
243 }
244 },
245 "additionalProperties": false,
246 "type": "object"
247 },
248 "Permissions": {
249 "properties": {
250 "allowed_tools": {
251 "items": {
252 "type": "string",
253 "examples": [
254 "bash",
255 "view"
256 ]
257 },
258 "type": "array",
259 "description": "List of tools that don't require permission prompts"
260 }
261 },
262 "additionalProperties": false,
263 "type": "object"
264 },
265 "ProviderConfig": {
266 "properties": {
267 "id": {
268 "type": "string",
269 "description": "Unique identifier for the provider",
270 "examples": [
271 "openai"
272 ]
273 },
274 "name": {
275 "type": "string",
276 "description": "Human-readable name for the provider",
277 "examples": [
278 "OpenAI"
279 ]
280 },
281 "base_url": {
282 "type": "string",
283 "format": "uri",
284 "description": "Base URL for the provider's API",
285 "examples": [
286 "https://api.openai.com/v1"
287 ]
288 },
289 "type": {
290 "type": "string",
291 "enum": [
292 "openai",
293 "anthropic",
294 "gemini",
295 "azure",
296 "vertexai"
297 ],
298 "description": "Provider type that determines the API format",
299 "default": "openai"
300 },
301 "api_key": {
302 "type": "string",
303 "description": "API key for authentication with the provider",
304 "examples": [
305 "$OPENAI_API_KEY"
306 ]
307 },
308 "disable": {
309 "type": "boolean",
310 "description": "Whether this provider is disabled",
311 "default": false
312 },
313 "system_prompt_prefix": {
314 "type": "string",
315 "description": "Custom prefix to add to system prompts for this provider"
316 },
317 "extra_headers": {
318 "additionalProperties": {
319 "type": "string"
320 },
321 "type": "object",
322 "description": "Additional HTTP headers to send with requests"
323 },
324 "extra_body": {
325 "type": "object",
326 "description": "Additional fields to include in request bodies"
327 },
328 "models": {
329 "items": {
330 "$ref": "#/$defs/Model"
331 },
332 "type": "array",
333 "description": "List of models available from this provider"
334 }
335 },
336 "additionalProperties": false,
337 "type": "object"
338 },
339 "SelectedModel": {
340 "properties": {
341 "model": {
342 "type": "string",
343 "description": "The model ID as used by the provider API",
344 "examples": [
345 "gpt-4o"
346 ]
347 },
348 "provider": {
349 "type": "string",
350 "description": "The model provider ID that matches a key in the providers config",
351 "examples": [
352 "openai"
353 ]
354 },
355 "reasoning_effort": {
356 "type": "string",
357 "enum": [
358 "low",
359 "medium",
360 "high"
361 ],
362 "description": "Reasoning effort level for OpenAI models that support it"
363 },
364 "max_tokens": {
365 "type": "integer",
366 "maximum": 200000,
367 "minimum": 1,
368 "description": "Maximum number of tokens for model responses",
369 "examples": [
370 4096
371 ]
372 },
373 "think": {
374 "type": "boolean",
375 "description": "Enable thinking mode for Anthropic models that support reasoning"
376 }
377 },
378 "additionalProperties": false,
379 "type": "object",
380 "required": [
381 "model",
382 "provider"
383 ]
384 },
385 "TUIOptions": {
386 "properties": {
387 "compact_mode": {
388 "type": "boolean",
389 "description": "Enable compact mode for the TUI interface",
390 "default": false
391 }
392 },
393 "additionalProperties": false,
394 "type": "object"
395 }
396 }
397}