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