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