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