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