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": "Deprecated: Use notification_style instead. Disable desktop notifications",
496          "default": false
497        },
498        "notification_style": {
499          "type": "string",
500          "enum": [
501            "auto",
502            "native",
503            "osc",
504            "bell",
505            "disabled"
506          ],
507          "description": "Notification style to use. Options: auto (default)",
508          "default": "auto"
509        },
510        "disabled_skills": {
511          "items": {
512            "type": "string",
513            "examples": [
514              "crush-config"
515            ]
516          },
517          "type": "array",
518          "description": "List of skill names to disable and hide from the agent"
519        }
520      },
521      "additionalProperties": false,
522      "type": "object"
523    },
524    "Permissions": {
525      "properties": {
526        "allowed_tools": {
527          "items": {
528            "type": "string",
529            "examples": [
530              "bash",
531              "view"
532            ]
533          },
534          "type": "array",
535          "description": "List of tools that don't require permission prompts"
536        }
537      },
538      "additionalProperties": false,
539      "type": "object"
540    },
541    "ProviderConfig": {
542      "properties": {
543        "id": {
544          "type": "string",
545          "description": "Unique identifier for the provider",
546          "examples": [
547            "openai"
548          ]
549        },
550        "name": {
551          "type": "string",
552          "description": "Human-readable name for the provider",
553          "examples": [
554            "OpenAI"
555          ]
556        },
557        "base_url": {
558          "type": "string",
559          "format": "uri",
560          "description": "Base URL for the provider's API",
561          "examples": [
562            "https://api.openai.com/v1"
563          ]
564        },
565        "type": {
566          "type": "string",
567          "enum": [
568            "openai",
569            "openai-compat",
570            "anthropic",
571            "gemini",
572            "azure",
573            "vertexai"
574          ],
575          "description": "Provider type that determines the API format",
576          "default": "openai"
577        },
578        "api_key": {
579          "type": "string",
580          "description": "API key for authentication with the provider",
581          "examples": [
582            "$OPENAI_API_KEY"
583          ]
584        },
585        "oauth": {
586          "$ref": "#/$defs/Token",
587          "description": "OAuth2 token for authentication with the provider"
588        },
589        "disable": {
590          "type": "boolean",
591          "description": "Whether this provider is disabled",
592          "default": false
593        },
594        "system_prompt_prefix": {
595          "type": "string",
596          "description": "Custom prefix to add to system prompts for this provider"
597        },
598        "extra_headers": {
599          "additionalProperties": {
600            "type": "string"
601          },
602          "type": "object",
603          "description": "Additional HTTP headers to send with requests"
604        },
605        "extra_body": {
606          "type": "object",
607          "description": "Additional fields to include in request bodies, only works with openai-compatible providers"
608        },
609        "provider_options": {
610          "type": "object",
611          "description": "Additional provider-specific options for this provider"
612        },
613        "flat_rate": {
614          "type": "boolean",
615          "description": "Flat-rate mode for this provider"
616        },
617        "models": {
618          "items": {
619            "$ref": "#/$defs/Model"
620          },
621          "type": "array",
622          "description": "List of models available from this provider"
623        }
624      },
625      "additionalProperties": false,
626      "type": "object"
627    },
628    "SelectedModel": {
629      "properties": {
630        "model": {
631          "type": "string",
632          "description": "The model ID as used by the provider API",
633          "examples": [
634            "gpt-4o"
635          ]
636        },
637        "provider": {
638          "type": "string",
639          "description": "The model provider ID that matches a key in the providers config",
640          "examples": [
641            "openai"
642          ]
643        },
644        "reasoning_effort": {
645          "type": "string",
646          "enum": [
647            "low",
648            "medium",
649            "high"
650          ],
651          "description": "Reasoning effort level for OpenAI models that support it"
652        },
653        "think": {
654          "type": "boolean",
655          "description": "Enable thinking mode for Anthropic models that support reasoning"
656        },
657        "max_tokens": {
658          "type": "integer",
659          "maximum": 200000,
660          "description": "Maximum number of tokens for model responses",
661          "examples": [
662            4096
663          ]
664        },
665        "temperature": {
666          "type": "number",
667          "maximum": 1,
668          "minimum": 0,
669          "description": "Sampling temperature",
670          "examples": [
671            0.7
672          ]
673        },
674        "top_p": {
675          "type": "number",
676          "maximum": 1,
677          "minimum": 0,
678          "description": "Top-p (nucleus) sampling parameter",
679          "examples": [
680            0.9
681          ]
682        },
683        "top_k": {
684          "type": "integer",
685          "description": "Top-k sampling parameter"
686        },
687        "frequency_penalty": {
688          "type": "number",
689          "description": "Frequency penalty to reduce repetition"
690        },
691        "presence_penalty": {
692          "type": "number",
693          "description": "Presence penalty to increase topic diversity"
694        },
695        "provider_options": {
696          "type": "object",
697          "description": "Additional provider-specific options for the model"
698        }
699      },
700      "additionalProperties": false,
701      "type": "object",
702      "required": [
703        "model",
704        "provider"
705      ]
706    },
707    "TUIOptions": {
708      "properties": {
709        "compact_mode": {
710          "type": "boolean",
711          "description": "Enable compact mode for the TUI interface",
712          "default": false
713        },
714        "diff_mode": {
715          "type": "string",
716          "enum": [
717            "unified",
718            "split"
719          ],
720          "description": "Diff mode for the TUI interface"
721        },
722        "completions": {
723          "$ref": "#/$defs/Completions",
724          "description": "Completions UI options"
725        },
726        "transparent": {
727          "type": "boolean",
728          "description": "Enable transparent background for the TUI interface",
729          "default": false
730        }
731      },
732      "additionalProperties": false,
733      "type": "object"
734    },
735    "Token": {
736      "properties": {
737        "access_token": {
738          "type": "string"
739        },
740        "refresh_token": {
741          "type": "string"
742        },
743        "expires_in": {
744          "type": "integer"
745        },
746        "expires_at": {
747          "type": "integer"
748        }
749      },
750      "additionalProperties": false,
751      "type": "object",
752      "required": [
753        "access_token",
754        "refresh_token",
755        "expires_in",
756        "expires_at"
757      ]
758    },
759    "ToolGrep": {
760      "properties": {
761        "timeout": {
762          "type": "integer",
763          "description": "Timeout for the grep tool call"
764        }
765      },
766      "additionalProperties": false,
767      "type": "object"
768    },
769    "ToolLs": {
770      "properties": {
771        "max_depth": {
772          "type": "integer",
773          "description": "Maximum depth for the ls tool",
774          "default": 0,
775          "examples": [
776            10
777          ]
778        },
779        "max_items": {
780          "type": "integer",
781          "description": "Maximum number of items to return for the ls tool",
782          "default": 1000,
783          "examples": [
784            100
785          ]
786        }
787      },
788      "additionalProperties": false,
789      "type": "object"
790    },
791    "Tools": {
792      "properties": {
793        "ls": {
794          "$ref": "#/$defs/ToolLs"
795        },
796        "grep": {
797          "$ref": "#/$defs/ToolGrep"
798        }
799      },
800      "additionalProperties": false,
801      "type": "object"
802    }
803  }
804}