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    "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      },
276      "additionalProperties": false,
277      "type": "object"
278    },
279    "Permissions": {
280      "properties": {
281        "allowed_tools": {
282          "items": {
283            "type": "string",
284            "examples": [
285              "bash",
286              "view"
287            ]
288          },
289          "type": "array",
290          "description": "List of tools that don't require permission prompts"
291        }
292      },
293      "additionalProperties": false,
294      "type": "object"
295    },
296    "ProviderConfig": {
297      "properties": {
298        "id": {
299          "type": "string",
300          "description": "Unique identifier for the provider",
301          "examples": [
302            "openai"
303          ]
304        },
305        "name": {
306          "type": "string",
307          "description": "Human-readable name for the provider",
308          "examples": [
309            "OpenAI"
310          ]
311        },
312        "base_url": {
313          "type": "string",
314          "format": "uri",
315          "description": "Base URL for the provider's API",
316          "examples": [
317            "https://api.openai.com/v1"
318          ]
319        },
320        "type": {
321          "type": "string",
322          "enum": [
323            "openai",
324            "anthropic",
325            "gemini",
326            "azure",
327            "vertexai"
328          ],
329          "description": "Provider type that determines the API format",
330          "default": "openai"
331        },
332        "api_key": {
333          "type": "string",
334          "description": "API key for authentication with the provider",
335          "examples": [
336            "$OPENAI_API_KEY"
337          ]
338        },
339        "disable": {
340          "type": "boolean",
341          "description": "Whether this provider is disabled",
342          "default": false
343        },
344        "system_prompt_prefix": {
345          "type": "string",
346          "description": "Custom prefix to add to system prompts for this provider"
347        },
348        "extra_headers": {
349          "additionalProperties": {
350            "type": "string"
351          },
352          "type": "object",
353          "description": "Additional HTTP headers to send with requests"
354        },
355        "extra_body": {
356          "type": "object",
357          "description": "Additional fields to include in request bodies"
358        },
359        "models": {
360          "items": {
361            "$ref": "#/$defs/Model"
362          },
363          "type": "array",
364          "description": "List of models available from this provider"
365        }
366      },
367      "additionalProperties": false,
368      "type": "object"
369    },
370    "SelectedModel": {
371      "properties": {
372        "model": {
373          "type": "string",
374          "description": "The model ID as used by the provider API",
375          "examples": [
376            "gpt-4o"
377          ]
378        },
379        "provider": {
380          "type": "string",
381          "description": "The model provider ID that matches a key in the providers config",
382          "examples": [
383            "openai"
384          ]
385        },
386        "reasoning_effort": {
387          "type": "string",
388          "enum": [
389            "low",
390            "medium",
391            "high"
392          ],
393          "description": "Reasoning effort level for OpenAI models that support it"
394        },
395        "max_tokens": {
396          "type": "integer",
397          "maximum": 200000,
398          "minimum": 1,
399          "description": "Maximum number of tokens for model responses",
400          "examples": [
401            4096
402          ]
403        },
404        "think": {
405          "type": "boolean",
406          "description": "Enable thinking mode for Anthropic models that support reasoning"
407        }
408      },
409      "additionalProperties": false,
410      "type": "object",
411      "required": [
412        "model",
413        "provider"
414      ]
415    },
416    "TUIOptions": {
417      "properties": {
418        "compact_mode": {
419          "type": "boolean",
420          "description": "Enable compact mode for the TUI interface",
421          "default": false
422        },
423        "diff_mode": {
424          "type": "string",
425          "enum": [
426            "unified",
427            "split"
428          ],
429          "description": "Diff mode for the TUI interface"
430        }
431      },
432      "additionalProperties": false,
433      "type": "object"
434    }
435  }
436}