schema.json

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