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        "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        "timeout": {
164          "type": "integer",
165          "description": "Timeout in seconds for LSP server initialization",
166          "default": 30,
167          "examples": [
168            60,
169            120
170          ]
171        }
172      },
173      "additionalProperties": false,
174      "type": "object"
175    },
176    "LSPs": {
177      "additionalProperties": {
178        "$ref": "#/$defs/LSPConfig"
179      },
180      "type": "object"
181    },
182    "MCPConfig": {
183      "properties": {
184        "command": {
185          "type": "string",
186          "description": "Command to execute for stdio MCP servers",
187          "examples": [
188            "npx"
189          ]
190        },
191        "env": {
192          "additionalProperties": {
193            "type": "string"
194          },
195          "type": "object",
196          "description": "Environment variables to set for the MCP server"
197        },
198        "args": {
199          "items": {
200            "type": "string"
201          },
202          "type": "array",
203          "description": "Arguments to pass to the MCP server command"
204        },
205        "type": {
206          "type": "string",
207          "enum": [
208            "stdio",
209            "sse",
210            "http"
211          ],
212          "description": "Type of MCP connection",
213          "default": "stdio"
214        },
215        "url": {
216          "type": "string",
217          "format": "uri",
218          "description": "URL for HTTP or SSE MCP servers",
219          "examples": [
220            "http://localhost:3000/mcp"
221          ]
222        },
223        "disabled": {
224          "type": "boolean",
225          "description": "Whether this MCP server is disabled",
226          "default": false
227        },
228        "disabled_tools": {
229          "items": {
230            "type": "string",
231            "examples": [
232              "get-library-doc"
233            ]
234          },
235          "type": "array",
236          "description": "List of tools from this MCP server to disable"
237        },
238        "timeout": {
239          "type": "integer",
240          "description": "Timeout in seconds for MCP server connections",
241          "default": 15,
242          "examples": [
243            30,
244            60,
245            120
246          ]
247        },
248        "headers": {
249          "additionalProperties": {
250            "type": "string"
251          },
252          "type": "object",
253          "description": "HTTP headers for HTTP/SSE MCP servers"
254        }
255      },
256      "additionalProperties": false,
257      "type": "object",
258      "required": [
259        "type"
260      ]
261    },
262    "MCPs": {
263      "additionalProperties": {
264        "$ref": "#/$defs/MCPConfig"
265      },
266      "type": "object"
267    },
268    "Model": {
269      "properties": {
270        "id": {
271          "type": "string"
272        },
273        "name": {
274          "type": "string"
275        },
276        "cost_per_1m_in": {
277          "type": "number"
278        },
279        "cost_per_1m_out": {
280          "type": "number"
281        },
282        "cost_per_1m_in_cached": {
283          "type": "number"
284        },
285        "cost_per_1m_out_cached": {
286          "type": "number"
287        },
288        "context_window": {
289          "type": "integer"
290        },
291        "default_max_tokens": {
292          "type": "integer"
293        },
294        "can_reason": {
295          "type": "boolean"
296        },
297        "reasoning_levels": {
298          "items": {
299            "type": "string"
300          },
301          "type": "array"
302        },
303        "default_reasoning_effort": {
304          "type": "string"
305        },
306        "supports_attachments": {
307          "type": "boolean"
308        },
309        "options": {
310          "$ref": "#/$defs/ModelOptions"
311        }
312      },
313      "additionalProperties": false,
314      "type": "object",
315      "required": [
316        "id",
317        "name",
318        "cost_per_1m_in",
319        "cost_per_1m_out",
320        "cost_per_1m_in_cached",
321        "cost_per_1m_out_cached",
322        "context_window",
323        "default_max_tokens",
324        "can_reason",
325        "supports_attachments",
326        "options"
327      ]
328    },
329    "ModelOptions": {
330      "properties": {
331        "temperature": {
332          "type": "number"
333        },
334        "top_p": {
335          "type": "number"
336        },
337        "top_k": {
338          "type": "integer"
339        },
340        "frequency_penalty": {
341          "type": "number"
342        },
343        "presence_penalty": {
344          "type": "number"
345        },
346        "provider_options": {
347          "type": "object"
348        }
349      },
350      "additionalProperties": false,
351      "type": "object"
352    },
353    "Options": {
354      "properties": {
355        "context_paths": {
356          "items": {
357            "type": "string",
358            "examples": [
359              ".cursorrules",
360              "CRUSH.md"
361            ]
362          },
363          "type": "array",
364          "description": "Paths to files containing context information for the AI"
365        },
366        "skills_paths": {
367          "items": {
368            "type": "string",
369            "examples": [
370              "~/.config/crush/skills",
371              "./skills"
372            ]
373          },
374          "type": "array",
375          "description": "Paths to directories containing Agent Skills (folders with SKILL.md files)"
376        },
377        "tui": {
378          "$ref": "#/$defs/TUIOptions",
379          "description": "Terminal user interface options"
380        },
381        "debug": {
382          "type": "boolean",
383          "description": "Enable debug logging",
384          "default": false
385        },
386        "debug_lsp": {
387          "type": "boolean",
388          "description": "Enable debug logging for LSP servers",
389          "default": false
390        },
391        "disable_auto_summarize": {
392          "type": "boolean",
393          "description": "Disable automatic conversation summarization",
394          "default": false
395        },
396        "data_directory": {
397          "type": "string",
398          "description": "Directory for storing application data (relative to working directory)",
399          "default": ".crush",
400          "examples": [
401            ".crush"
402          ]
403        },
404        "disabled_tools": {
405          "items": {
406            "type": "string",
407            "examples": [
408              "bash",
409              "sourcegraph"
410            ]
411          },
412          "type": "array",
413          "description": "List of built-in tools to disable and hide from the agent"
414        },
415        "disable_provider_auto_update": {
416          "type": "boolean",
417          "description": "Disable providers auto-update",
418          "default": false
419        },
420        "disable_default_providers": {
421          "type": "boolean",
422          "description": "Ignore all default/embedded providers. When enabled",
423          "default": false
424        },
425        "attribution": {
426          "$ref": "#/$defs/Attribution",
427          "description": "Attribution settings for generated content"
428        },
429        "disable_metrics": {
430          "type": "boolean",
431          "description": "Disable sending metrics",
432          "default": false
433        },
434        "initialize_as": {
435          "type": "string",
436          "description": "Name of the context file to create/update during project initialization",
437          "default": "AGENTS.md",
438          "examples": [
439            "AGENTS.md",
440            "CRUSH.md",
441            "CLAUDE.md",
442            "docs/LLMs.md"
443          ]
444        },
445        "auto_lsp": {
446          "type": "boolean",
447          "description": "Automatically setup LSPs based on root markers",
448          "default": true
449        },
450        "progress": {
451          "type": "boolean",
452          "description": "Show indeterminate progress updates during long operations",
453          "default": true
454        }
455      },
456      "additionalProperties": false,
457      "type": "object"
458    },
459    "Permissions": {
460      "properties": {
461        "allowed_tools": {
462          "items": {
463            "type": "string",
464            "examples": [
465              "bash",
466              "view"
467            ]
468          },
469          "type": "array",
470          "description": "List of tools that don't require permission prompts"
471        }
472      },
473      "additionalProperties": false,
474      "type": "object"
475    },
476    "ProviderConfig": {
477      "properties": {
478        "id": {
479          "type": "string",
480          "description": "Unique identifier for the provider",
481          "examples": [
482            "openai"
483          ]
484        },
485        "name": {
486          "type": "string",
487          "description": "Human-readable name for the provider",
488          "examples": [
489            "OpenAI"
490          ]
491        },
492        "base_url": {
493          "type": "string",
494          "format": "uri",
495          "description": "Base URL for the provider's API",
496          "examples": [
497            "https://api.openai.com/v1"
498          ]
499        },
500        "type": {
501          "type": "string",
502          "enum": [
503            "openai",
504            "openai-compat",
505            "anthropic",
506            "gemini",
507            "azure",
508            "vertexai"
509          ],
510          "description": "Provider type that determines the API format",
511          "default": "openai"
512        },
513        "api_key": {
514          "type": "string",
515          "description": "API key for authentication with the provider",
516          "examples": [
517            "$OPENAI_API_KEY"
518          ]
519        },
520        "oauth": {
521          "$ref": "#/$defs/Token",
522          "description": "OAuth2 token for authentication with the provider"
523        },
524        "disable": {
525          "type": "boolean",
526          "description": "Whether this provider is disabled",
527          "default": false
528        },
529        "system_prompt_prefix": {
530          "type": "string",
531          "description": "Custom prefix to add to system prompts for this provider"
532        },
533        "extra_headers": {
534          "additionalProperties": {
535            "type": "string"
536          },
537          "type": "object",
538          "description": "Additional HTTP headers to send with requests"
539        },
540        "extra_body": {
541          "type": "object",
542          "description": "Additional fields to include in request bodies"
543        },
544        "provider_options": {
545          "type": "object",
546          "description": "Additional provider-specific options for this provider"
547        },
548        "models": {
549          "items": {
550            "$ref": "#/$defs/Model"
551          },
552          "type": "array",
553          "description": "List of models available from this provider"
554        }
555      },
556      "additionalProperties": false,
557      "type": "object"
558    },
559    "SelectedModel": {
560      "properties": {
561        "model": {
562          "type": "string",
563          "description": "The model ID as used by the provider API",
564          "examples": [
565            "gpt-4o"
566          ]
567        },
568        "provider": {
569          "type": "string",
570          "description": "The model provider ID that matches a key in the providers config",
571          "examples": [
572            "openai"
573          ]
574        },
575        "reasoning_effort": {
576          "type": "string",
577          "enum": [
578            "low",
579            "medium",
580            "high"
581          ],
582          "description": "Reasoning effort level for OpenAI models that support it"
583        },
584        "think": {
585          "type": "boolean",
586          "description": "Enable thinking mode for Anthropic models that support reasoning"
587        },
588        "max_tokens": {
589          "type": "integer",
590          "maximum": 200000,
591          "description": "Maximum number of tokens for model responses",
592          "examples": [
593            4096
594          ]
595        },
596        "temperature": {
597          "type": "number",
598          "maximum": 1,
599          "minimum": 0,
600          "description": "Sampling temperature",
601          "examples": [
602            0.7
603          ]
604        },
605        "top_p": {
606          "type": "number",
607          "maximum": 1,
608          "minimum": 0,
609          "description": "Top-p (nucleus) sampling parameter",
610          "examples": [
611            0.9
612          ]
613        },
614        "top_k": {
615          "type": "integer",
616          "description": "Top-k sampling parameter"
617        },
618        "frequency_penalty": {
619          "type": "number",
620          "description": "Frequency penalty to reduce repetition"
621        },
622        "presence_penalty": {
623          "type": "number",
624          "description": "Presence penalty to increase topic diversity"
625        },
626        "provider_options": {
627          "type": "object",
628          "description": "Additional provider-specific options for the model"
629        }
630      },
631      "additionalProperties": false,
632      "type": "object",
633      "required": [
634        "model",
635        "provider"
636      ]
637    },
638    "TUIOptions": {
639      "properties": {
640        "compact_mode": {
641          "type": "boolean",
642          "description": "Enable compact mode for the TUI interface",
643          "default": false
644        },
645        "diff_mode": {
646          "type": "string",
647          "enum": [
648            "unified",
649            "split"
650          ],
651          "description": "Diff mode for the TUI interface"
652        },
653        "completions": {
654          "$ref": "#/$defs/Completions",
655          "description": "Completions UI options"
656        },
657        "transparent": {
658          "type": "boolean",
659          "description": "Enable transparent background for the TUI interface",
660          "default": false
661        }
662      },
663      "additionalProperties": false,
664      "type": "object",
665      "required": [
666        "completions"
667      ]
668    },
669    "Token": {
670      "properties": {
671        "access_token": {
672          "type": "string"
673        },
674        "refresh_token": {
675          "type": "string"
676        },
677        "expires_in": {
678          "type": "integer"
679        },
680        "expires_at": {
681          "type": "integer"
682        }
683      },
684      "additionalProperties": false,
685      "type": "object",
686      "required": [
687        "access_token",
688        "refresh_token",
689        "expires_in",
690        "expires_at"
691      ]
692    },
693    "ToolGrep": {
694      "properties": {
695        "timeout": {
696          "type": "integer",
697          "description": "Timeout for the grep tool call"
698        }
699      },
700      "additionalProperties": false,
701      "type": "object"
702    },
703    "ToolLs": {
704      "properties": {
705        "max_depth": {
706          "type": "integer",
707          "description": "Maximum depth for the ls tool",
708          "default": 0,
709          "examples": [
710            10
711          ]
712        },
713        "max_items": {
714          "type": "integer",
715          "description": "Maximum number of items to return for the ls tool",
716          "default": 1000,
717          "examples": [
718            100
719          ]
720        }
721      },
722      "additionalProperties": false,
723      "type": "object"
724    },
725    "Tools": {
726      "properties": {
727        "ls": {
728          "$ref": "#/$defs/ToolLs"
729        },
730        "grep": {
731          "$ref": "#/$defs/ToolGrep"
732        }
733      },
734      "additionalProperties": false,
735      "type": "object",
736      "required": [
737        "ls",
738        "grep"
739      ]
740    }
741  }
742}