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        "memory_paths": {
371          "items": {
372            "type": "string"
373          },
374          "type": "array",
375          "description": "Paths to files containing memory information for the AI",
376          "default": [
377            "~/.config/crush/CRUSH.md",
378            "~/.config/AGENTS.md"
379          ]
380        },
381        "skills_paths": {
382          "items": {
383            "type": "string",
384            "examples": [
385              "~/.config/crush/skills",
386              "./skills"
387            ]
388          },
389          "type": "array",
390          "description": "Paths to directories containing Agent Skills (folders with SKILL.md files)"
391        },
392        "tui": {
393          "$ref": "#/$defs/TUIOptions",
394          "description": "Terminal user interface options"
395        },
396        "debug": {
397          "type": "boolean",
398          "description": "Enable debug logging",
399          "default": false
400        },
401        "debug_lsp": {
402          "type": "boolean",
403          "description": "Enable debug logging for LSP servers",
404          "default": false
405        },
406        "disable_auto_summarize": {
407          "type": "boolean",
408          "description": "Disable automatic conversation summarization",
409          "default": false
410        },
411        "data_directory": {
412          "type": "string",
413          "description": "Directory for storing application data (relative to working directory)",
414          "default": ".crush",
415          "examples": [
416            ".crush"
417          ]
418        },
419        "disabled_tools": {
420          "items": {
421            "type": "string",
422            "examples": [
423              "bash",
424              "sourcegraph"
425            ]
426          },
427          "type": "array",
428          "description": "List of built-in tools to disable and hide from the agent"
429        },
430        "disable_provider_auto_update": {
431          "type": "boolean",
432          "description": "Disable providers auto-update",
433          "default": false
434        },
435        "attribution": {
436          "$ref": "#/$defs/Attribution",
437          "description": "Attribution settings for generated content"
438        },
439        "disable_metrics": {
440          "type": "boolean",
441          "description": "Disable sending metrics",
442          "default": false
443        },
444        "initialize_as": {
445          "type": "string",
446          "description": "Name of the context file to create/update during project initialization",
447          "default": "AGENTS.md",
448          "examples": [
449            "AGENTS.md",
450            "CRUSH.md",
451            "CLAUDE.md",
452            "docs/LLMs.md"
453          ]
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      },
658      "additionalProperties": false,
659      "type": "object",
660      "required": [
661        "completions"
662      ]
663    },
664    "Token": {
665      "properties": {
666        "access_token": {
667          "type": "string"
668        },
669        "refresh_token": {
670          "type": "string"
671        },
672        "expires_in": {
673          "type": "integer"
674        },
675        "expires_at": {
676          "type": "integer"
677        }
678      },
679      "additionalProperties": false,
680      "type": "object",
681      "required": [
682        "access_token",
683        "refresh_token",
684        "expires_in",
685        "expires_at"
686      ]
687    },
688    "ToolLs": {
689      "properties": {
690        "max_depth": {
691          "type": "integer",
692          "description": "Maximum depth for the ls tool",
693          "default": 0,
694          "examples": [
695            10
696          ]
697        },
698        "max_items": {
699          "type": "integer",
700          "description": "Maximum number of items to return for the ls tool",
701          "default": 1000,
702          "examples": [
703            100
704          ]
705        }
706      },
707      "additionalProperties": false,
708      "type": "object"
709    },
710    "Tools": {
711      "properties": {
712        "ls": {
713          "$ref": "#/$defs/ToolLs"
714        }
715      },
716      "additionalProperties": false,
717      "type": "object",
718      "required": [
719        "ls"
720      ]
721    }
722  }
723}