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