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 "Attribution": {
7 "properties": {
8 "co_authored_by": {
9 "type": "boolean",
10 "description": "Add Co-Authored-By trailer to commit messages",
11 "default": true
12 },
13 "generated_with": {
14 "type": "boolean",
15 "description": "Add Generated with Crush line to commit messages and issues and PRs",
16 "default": true
17 }
18 },
19 "additionalProperties": false,
20 "type": "object"
21 },
22 "Completions": {
23 "properties": {
24 "max_depth": {
25 "type": "integer",
26 "description": "Maximum depth for the ls tool",
27 "default": 0,
28 "examples": [
29 10
30 ]
31 },
32 "max_items": {
33 "type": "integer",
34 "description": "Maximum number of items to return for the ls tool",
35 "default": 1000,
36 "examples": [
37 100
38 ]
39 }
40 },
41 "additionalProperties": false,
42 "type": "object"
43 },
44 "Config": {
45 "properties": {
46 "$schema": {
47 "type": "string"
48 },
49 "models": {
50 "additionalProperties": {
51 "$ref": "#/$defs/SelectedModel"
52 },
53 "type": "object",
54 "description": "Model configurations for different model types"
55 },
56 "recent_models": {
57 "additionalProperties": {
58 "items": {
59 "$ref": "#/$defs/SelectedModel"
60 },
61 "type": "array"
62 },
63 "type": "object",
64 "description": "Recently used models sorted by most recent first"
65 },
66 "providers": {
67 "additionalProperties": {
68 "$ref": "#/$defs/ProviderConfig"
69 },
70 "type": "object",
71 "description": "AI provider configurations"
72 },
73 "mcp": {
74 "$ref": "#/$defs/MCPs",
75 "description": "Model Context Protocol server configurations"
76 },
77 "lsp": {
78 "$ref": "#/$defs/LSPs",
79 "description": "Language Server Protocol configurations"
80 },
81 "options": {
82 "$ref": "#/$defs/Options",
83 "description": "General application options"
84 },
85 "permissions": {
86 "$ref": "#/$defs/Permissions",
87 "description": "Permission settings for tool usage"
88 },
89 "tools": {
90 "$ref": "#/$defs/Tools",
91 "description": "Tool configurations"
92 }
93 },
94 "additionalProperties": false,
95 "type": "object",
96 "required": [
97 "tools"
98 ]
99 },
100 "LSPConfig": {
101 "properties": {
102 "disabled": {
103 "type": "boolean",
104 "description": "Whether this LSP server is disabled",
105 "default": false
106 },
107 "command": {
108 "type": "string",
109 "description": "Command to execute for the LSP server",
110 "examples": [
111 "gopls"
112 ]
113 },
114 "args": {
115 "items": {
116 "type": "string"
117 },
118 "type": "array",
119 "description": "Arguments to pass to the LSP server command"
120 },
121 "env": {
122 "additionalProperties": {
123 "type": "string"
124 },
125 "type": "object",
126 "description": "Environment variables to set to the LSP server command"
127 },
128 "filetypes": {
129 "items": {
130 "type": "string",
131 "examples": [
132 "go",
133 "mod",
134 "rs",
135 "c",
136 "js",
137 "ts"
138 ]
139 },
140 "type": "array",
141 "description": "File types this LSP server handles"
142 },
143 "root_markers": {
144 "items": {
145 "type": "string",
146 "examples": [
147 "go.mod",
148 "package.json",
149 "Cargo.toml"
150 ]
151 },
152 "type": "array",
153 "description": "Files or directories that indicate the project root"
154 },
155 "init_options": {
156 "type": "object",
157 "description": "Initialization options passed to the LSP server during initialize request"
158 },
159 "options": {
160 "type": "object",
161 "description": "LSP server-specific settings passed during initialization"
162 }
163 },
164 "additionalProperties": false,
165 "type": "object",
166 "required": [
167 "command"
168 ]
169 },
170 "LSPs": {
171 "additionalProperties": {
172 "$ref": "#/$defs/LSPConfig"
173 },
174 "type": "object"
175 },
176 "MCPConfig": {
177 "properties": {
178 "command": {
179 "type": "string",
180 "description": "Command to execute for stdio MCP servers",
181 "examples": [
182 "npx"
183 ]
184 },
185 "env": {
186 "additionalProperties": {
187 "type": "string"
188 },
189 "type": "object",
190 "description": "Environment variables to set for the MCP server"
191 },
192 "args": {
193 "items": {
194 "type": "string"
195 },
196 "type": "array",
197 "description": "Arguments to pass to the MCP server command"
198 },
199 "type": {
200 "type": "string",
201 "enum": [
202 "stdio",
203 "sse",
204 "http"
205 ],
206 "description": "Type of MCP connection",
207 "default": "stdio"
208 },
209 "url": {
210 "type": "string",
211 "format": "uri",
212 "description": "URL for HTTP or SSE MCP servers",
213 "examples": [
214 "http://localhost:3000/mcp"
215 ]
216 },
217 "disabled": {
218 "type": "boolean",
219 "description": "Whether this MCP server is disabled",
220 "default": false
221 },
222 "timeout": {
223 "type": "integer",
224 "description": "Timeout in seconds for MCP server connections",
225 "default": 15,
226 "examples": [
227 30,
228 60,
229 120
230 ]
231 },
232 "headers": {
233 "additionalProperties": {
234 "type": "string"
235 },
236 "type": "object",
237 "description": "HTTP headers for HTTP/SSE MCP servers"
238 }
239 },
240 "additionalProperties": false,
241 "type": "object",
242 "required": [
243 "type"
244 ]
245 },
246 "MCPs": {
247 "additionalProperties": {
248 "$ref": "#/$defs/MCPConfig"
249 },
250 "type": "object"
251 },
252 "Model": {
253 "properties": {
254 "id": {
255 "type": "string"
256 },
257 "name": {
258 "type": "string"
259 },
260 "cost_per_1m_in": {
261 "type": "number"
262 },
263 "cost_per_1m_out": {
264 "type": "number"
265 },
266 "cost_per_1m_in_cached": {
267 "type": "number"
268 },
269 "cost_per_1m_out_cached": {
270 "type": "number"
271 },
272 "context_window": {
273 "type": "integer"
274 },
275 "default_max_tokens": {
276 "type": "integer"
277 },
278 "can_reason": {
279 "type": "boolean"
280 },
281 "reasoning_levels": {
282 "items": {
283 "type": "string"
284 },
285 "type": "array"
286 },
287 "default_reasoning_effort": {
288 "type": "string"
289 },
290 "supports_attachments": {
291 "type": "boolean"
292 },
293 "options": {
294 "$ref": "#/$defs/ModelOptions"
295 }
296 },
297 "additionalProperties": false,
298 "type": "object",
299 "required": [
300 "id",
301 "name",
302 "cost_per_1m_in",
303 "cost_per_1m_out",
304 "cost_per_1m_in_cached",
305 "cost_per_1m_out_cached",
306 "context_window",
307 "default_max_tokens",
308 "can_reason",
309 "supports_attachments",
310 "options"
311 ]
312 },
313 "ModelOptions": {
314 "properties": {
315 "temperature": {
316 "type": "number"
317 },
318 "top_p": {
319 "type": "number"
320 },
321 "top_k": {
322 "type": "integer"
323 },
324 "frequency_penalty": {
325 "type": "number"
326 },
327 "presence_penalty": {
328 "type": "number"
329 },
330 "provider_options": {
331 "type": "object"
332 }
333 },
334 "additionalProperties": false,
335 "type": "object"
336 },
337 "Options": {
338 "properties": {
339 "context_paths": {
340 "items": {
341 "type": "string",
342 "examples": [
343 ".cursorrules",
344 "CRUSH.md"
345 ]
346 },
347 "type": "array",
348 "description": "Paths to files containing context information for the AI"
349 },
350 "tui": {
351 "$ref": "#/$defs/TUIOptions",
352 "description": "Terminal user interface options"
353 },
354 "debug": {
355 "type": "boolean",
356 "description": "Enable debug logging",
357 "default": false
358 },
359 "debug_lsp": {
360 "type": "boolean",
361 "description": "Enable debug logging for LSP servers",
362 "default": false
363 },
364 "disable_auto_summarize": {
365 "type": "boolean",
366 "description": "Disable automatic conversation summarization",
367 "default": false
368 },
369 "data_directory": {
370 "type": "string",
371 "description": "Directory for storing application data (relative to working directory)",
372 "default": ".crush",
373 "examples": [
374 ".crush"
375 ]
376 },
377 "disabled_tools": {
378 "items": {
379 "type": "string"
380 },
381 "type": "array",
382 "description": "Tools to disable"
383 },
384 "disable_provider_auto_update": {
385 "type": "boolean",
386 "description": "Disable providers auto-update",
387 "default": false
388 },
389 "attribution": {
390 "$ref": "#/$defs/Attribution",
391 "description": "Attribution settings for generated content"
392 },
393 "disable_metrics": {
394 "type": "boolean",
395 "description": "Disable sending metrics",
396 "default": false
397 }
398 },
399 "additionalProperties": false,
400 "type": "object",
401 "required": [
402 "disabled_tools"
403 ]
404 },
405 "Permissions": {
406 "properties": {
407 "allowed_tools": {
408 "items": {
409 "type": "string",
410 "examples": [
411 "bash",
412 "view"
413 ]
414 },
415 "type": "array",
416 "description": "List of tools that don't require permission prompts"
417 }
418 },
419 "additionalProperties": false,
420 "type": "object"
421 },
422 "ProviderConfig": {
423 "properties": {
424 "id": {
425 "type": "string",
426 "description": "Unique identifier for the provider",
427 "examples": [
428 "openai"
429 ]
430 },
431 "name": {
432 "type": "string",
433 "description": "Human-readable name for the provider",
434 "examples": [
435 "OpenAI"
436 ]
437 },
438 "base_url": {
439 "type": "string",
440 "format": "uri",
441 "description": "Base URL for the provider's API",
442 "examples": [
443 "https://api.openai.com/v1"
444 ]
445 },
446 "type": {
447 "type": "string",
448 "enum": [
449 "openai",
450 "anthropic",
451 "gemini",
452 "azure",
453 "vertexai"
454 ],
455 "description": "Provider type that determines the API format",
456 "default": "openai"
457 },
458 "api_key": {
459 "type": "string",
460 "description": "API key for authentication with the provider",
461 "examples": [
462 "$OPENAI_API_KEY"
463 ]
464 },
465 "disable": {
466 "type": "boolean",
467 "description": "Whether this provider is disabled",
468 "default": false
469 },
470 "system_prompt_prefix": {
471 "type": "string",
472 "description": "Custom prefix to add to system prompts for this provider"
473 },
474 "extra_headers": {
475 "additionalProperties": {
476 "type": "string"
477 },
478 "type": "object",
479 "description": "Additional HTTP headers to send with requests"
480 },
481 "extra_body": {
482 "type": "object",
483 "description": "Additional fields to include in request bodies"
484 },
485 "provider_options": {
486 "type": "object",
487 "description": "Additional provider-specific options for this provider"
488 },
489 "models": {
490 "items": {
491 "$ref": "#/$defs/Model"
492 },
493 "type": "array",
494 "description": "List of models available from this provider"
495 }
496 },
497 "additionalProperties": false,
498 "type": "object"
499 },
500 "SelectedModel": {
501 "properties": {
502 "model": {
503 "type": "string",
504 "description": "The model ID as used by the provider API",
505 "examples": [
506 "gpt-4o"
507 ]
508 },
509 "provider": {
510 "type": "string",
511 "description": "The model provider ID that matches a key in the providers config",
512 "examples": [
513 "openai"
514 ]
515 },
516 "reasoning_effort": {
517 "type": "string",
518 "enum": [
519 "low",
520 "medium",
521 "high"
522 ],
523 "description": "Reasoning effort level for OpenAI models that support it"
524 },
525 "think": {
526 "type": "boolean",
527 "description": "Enable thinking mode for Anthropic models that support reasoning"
528 },
529 "max_tokens": {
530 "type": "integer",
531 "maximum": 200000,
532 "minimum": 1,
533 "description": "Maximum number of tokens for model responses",
534 "examples": [
535 4096
536 ]
537 },
538 "temperature": {
539 "type": "number",
540 "maximum": 1,
541 "minimum": 0,
542 "description": "Sampling temperature",
543 "examples": [
544 0.7
545 ]
546 },
547 "top_p": {
548 "type": "number",
549 "maximum": 1,
550 "minimum": 0,
551 "description": "Top-p (nucleus) sampling parameter",
552 "examples": [
553 0.9
554 ]
555 },
556 "top_k": {
557 "type": "integer",
558 "description": "Top-k sampling parameter"
559 },
560 "frequency_penalty": {
561 "type": "number",
562 "description": "Frequency penalty to reduce repetition"
563 },
564 "presence_penalty": {
565 "type": "number",
566 "description": "Presence penalty to increase topic diversity"
567 },
568 "provider_options": {
569 "type": "object",
570 "description": "Additional provider-specific options for the model"
571 }
572 },
573 "additionalProperties": false,
574 "type": "object",
575 "required": [
576 "model",
577 "provider"
578 ]
579 },
580 "TUIOptions": {
581 "properties": {
582 "compact_mode": {
583 "type": "boolean",
584 "description": "Enable compact mode for the TUI interface",
585 "default": false
586 },
587 "diff_mode": {
588 "type": "string",
589 "enum": [
590 "unified",
591 "split"
592 ],
593 "description": "Diff mode for the TUI interface"
594 },
595 "completions": {
596 "$ref": "#/$defs/Completions",
597 "description": "Completions UI options"
598 }
599 },
600 "additionalProperties": false,
601 "type": "object",
602 "required": [
603 "completions"
604 ]
605 },
606 "ToolLs": {
607 "properties": {
608 "max_depth": {
609 "type": "integer",
610 "description": "Maximum depth for the ls tool",
611 "default": 0,
612 "examples": [
613 10
614 ]
615 },
616 "max_items": {
617 "type": "integer",
618 "description": "Maximum number of items to return for the ls tool",
619 "default": 1000,
620 "examples": [
621 100
622 ]
623 }
624 },
625 "additionalProperties": false,
626 "type": "object"
627 },
628 "Tools": {
629 "properties": {
630 "ls": {
631 "$ref": "#/$defs/ToolLs"
632 }
633 },
634 "additionalProperties": false,
635 "type": "object",
636 "required": [
637 "ls"
638 ]
639 }
640 }
641}