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