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