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