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