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        "disable_notifications": {
400          "type": "boolean",
401          "description": "Disable desktop notifications",
402          "default": false
403        }
404      },
405      "additionalProperties": false,
406      "type": "object",
407      "required": [
408        "disabled_tools"
409      ]
410    },
411    "Permissions": {
412      "properties": {
413        "allowed_tools": {
414          "items": {
415            "type": "string",
416            "examples": [
417              "bash",
418              "view"
419            ]
420          },
421          "type": "array",
422          "description": "List of tools that don't require permission prompts"
423        }
424      },
425      "additionalProperties": false,
426      "type": "object"
427    },
428    "ProviderConfig": {
429      "properties": {
430        "id": {
431          "type": "string",
432          "description": "Unique identifier for the provider",
433          "examples": [
434            "openai"
435          ]
436        },
437        "name": {
438          "type": "string",
439          "description": "Human-readable name for the provider",
440          "examples": [
441            "OpenAI"
442          ]
443        },
444        "base_url": {
445          "type": "string",
446          "format": "uri",
447          "description": "Base URL for the provider's API",
448          "examples": [
449            "https://api.openai.com/v1"
450          ]
451        },
452        "type": {
453          "type": "string",
454          "enum": [
455            "openai",
456            "anthropic",
457            "gemini",
458            "azure",
459            "vertexai"
460          ],
461          "description": "Provider type that determines the API format",
462          "default": "openai"
463        },
464        "api_key": {
465          "type": "string",
466          "description": "API key for authentication with the provider",
467          "examples": [
468            "$OPENAI_API_KEY"
469          ]
470        },
471        "disable": {
472          "type": "boolean",
473          "description": "Whether this provider is disabled",
474          "default": false
475        },
476        "system_prompt_prefix": {
477          "type": "string",
478          "description": "Custom prefix to add to system prompts for this provider"
479        },
480        "extra_headers": {
481          "additionalProperties": {
482            "type": "string"
483          },
484          "type": "object",
485          "description": "Additional HTTP headers to send with requests"
486        },
487        "extra_body": {
488          "type": "object",
489          "description": "Additional fields to include in request bodies"
490        },
491        "provider_options": {
492          "type": "object",
493          "description": "Additional provider-specific options for this provider"
494        },
495        "models": {
496          "items": {
497            "$ref": "#/$defs/Model"
498          },
499          "type": "array",
500          "description": "List of models available from this provider"
501        }
502      },
503      "additionalProperties": false,
504      "type": "object"
505    },
506    "SelectedModel": {
507      "properties": {
508        "model": {
509          "type": "string",
510          "description": "The model ID as used by the provider API",
511          "examples": [
512            "gpt-4o"
513          ]
514        },
515        "provider": {
516          "type": "string",
517          "description": "The model provider ID that matches a key in the providers config",
518          "examples": [
519            "openai"
520          ]
521        },
522        "reasoning_effort": {
523          "type": "string",
524          "enum": [
525            "low",
526            "medium",
527            "high"
528          ],
529          "description": "Reasoning effort level for OpenAI models that support it"
530        },
531        "think": {
532          "type": "boolean",
533          "description": "Enable thinking mode for Anthropic models that support reasoning"
534        },
535        "max_tokens": {
536          "type": "integer",
537          "maximum": 200000,
538          "minimum": 1,
539          "description": "Maximum number of tokens for model responses",
540          "examples": [
541            4096
542          ]
543        },
544        "temperature": {
545          "type": "number",
546          "maximum": 1,
547          "minimum": 0,
548          "description": "Sampling temperature",
549          "examples": [
550            0.7
551          ]
552        },
553        "top_p": {
554          "type": "number",
555          "maximum": 1,
556          "minimum": 0,
557          "description": "Top-p (nucleus) sampling parameter",
558          "examples": [
559            0.9
560          ]
561        },
562        "top_k": {
563          "type": "integer",
564          "description": "Top-k sampling parameter"
565        },
566        "frequency_penalty": {
567          "type": "number",
568          "description": "Frequency penalty to reduce repetition"
569        },
570        "presence_penalty": {
571          "type": "number",
572          "description": "Presence penalty to increase topic diversity"
573        },
574        "provider_options": {
575          "type": "object",
576          "description": "Additional provider-specific options for the model"
577        }
578      },
579      "additionalProperties": false,
580      "type": "object",
581      "required": [
582        "model",
583        "provider"
584      ]
585    },
586    "TUIOptions": {
587      "properties": {
588        "compact_mode": {
589          "type": "boolean",
590          "description": "Enable compact mode for the TUI interface",
591          "default": false
592        },
593        "diff_mode": {
594          "type": "string",
595          "enum": [
596            "unified",
597            "split"
598          ],
599          "description": "Diff mode for the TUI interface"
600        },
601        "completions": {
602          "$ref": "#/$defs/Completions",
603          "description": "Completions UI options"
604        }
605      },
606      "additionalProperties": false,
607      "type": "object",
608      "required": [
609        "completions"
610      ]
611    },
612    "ToolLs": {
613      "properties": {
614        "max_depth": {
615          "type": "integer",
616          "description": "Maximum depth for the ls tool",
617          "default": 0,
618          "examples": [
619            10
620          ]
621        },
622        "max_items": {
623          "type": "integer",
624          "description": "Maximum number of items to return for the ls tool",
625          "default": 1000,
626          "examples": [
627            100
628          ]
629        }
630      },
631      "additionalProperties": false,
632      "type": "object"
633    },
634    "Tools": {
635      "properties": {
636        "ls": {
637          "$ref": "#/$defs/ToolLs"
638        }
639      },
640      "additionalProperties": false,
641      "type": "object",
642      "required": [
643        "ls"
644      ]
645    }
646  }
647}