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