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 "co_authored_by": {
9 "type": "boolean",
10 "description": "Add Co-Authored-By trailer to commit messages",
11 "default": true
12 },
13 "generated_with": {
14 "type": "boolean",
15 "description": "Add Generated with Crush line to commit messages and issues and PRs",
16 "default": true
17 }
18 },
19 "additionalProperties": false,
20 "type": "object"
21 },
22 "Completions": {
23 "properties": {
24 "max_depth": {
25 "type": "integer",
26 "description": "Maximum depth for the ls tool",
27 "default": 0,
28 "examples": [
29 10
30 ]
31 },
32 "max_items": {
33 "type": "integer",
34 "description": "Maximum number of items to return for the ls tool",
35 "default": 1000,
36 "examples": [
37 100
38 ]
39 }
40 },
41 "additionalProperties": false,
42 "type": "object"
43 },
44 "Config": {
45 "properties": {
46 "$schema": {
47 "type": "string"
48 },
49 "models": {
50 "additionalProperties": {
51 "$ref": "#/$defs/SelectedModel"
52 },
53 "type": "object",
54 "description": "Model configurations for different model types"
55 },
56 "providers": {
57 "additionalProperties": {
58 "$ref": "#/$defs/ProviderConfig"
59 },
60 "type": "object",
61 "description": "AI provider configurations"
62 },
63 "mcp": {
64 "$ref": "#/$defs/MCPs",
65 "description": "Model Context Protocol server configurations"
66 },
67 "lsp": {
68 "$ref": "#/$defs/LSPs",
69 "description": "Language Server Protocol configurations"
70 },
71 "options": {
72 "$ref": "#/$defs/Options",
73 "description": "General application options"
74 },
75 "permissions": {
76 "$ref": "#/$defs/Permissions",
77 "description": "Permission settings for tool usage"
78 },
79 "tools": {
80 "$ref": "#/$defs/Tools",
81 "description": "Tool configurations"
82 }
83 },
84 "additionalProperties": false,
85 "type": "object",
86 "required": [
87 "tools"
88 ]
89 },
90 "LSPConfig": {
91 "properties": {
92 "disabled": {
93 "type": "boolean",
94 "description": "Whether this LSP server is disabled",
95 "default": false
96 },
97 "command": {
98 "type": "string",
99 "description": "Command to execute for the LSP server",
100 "examples": [
101 "gopls"
102 ]
103 },
104 "args": {
105 "items": {
106 "type": "string"
107 },
108 "type": "array",
109 "description": "Arguments to pass to the LSP server command"
110 },
111 "env": {
112 "additionalProperties": {
113 "type": "string"
114 },
115 "type": "object",
116 "description": "Environment variables to set to the LSP server command"
117 },
118 "filetypes": {
119 "items": {
120 "type": "string",
121 "examples": [
122 "go",
123 "mod",
124 "rs",
125 "c",
126 "js",
127 "ts"
128 ]
129 },
130 "type": "array",
131 "description": "File types this LSP server handles"
132 },
133 "root_markers": {
134 "items": {
135 "type": "string",
136 "examples": [
137 "go.mod",
138 "package.json",
139 "Cargo.toml"
140 ]
141 },
142 "type": "array",
143 "description": "Files or directories that indicate the project root"
144 },
145 "init_options": {
146 "type": "object",
147 "description": "Initialization options passed to the LSP server during initialize request"
148 },
149 "options": {
150 "type": "object",
151 "description": "LSP server-specific settings passed during initialization"
152 }
153 },
154 "additionalProperties": false,
155 "type": "object",
156 "required": [
157 "command"
158 ]
159 },
160 "LSPs": {
161 "additionalProperties": {
162 "$ref": "#/$defs/LSPConfig"
163 },
164 "type": "object"
165 },
166 "MCPConfig": {
167 "properties": {
168 "command": {
169 "type": "string",
170 "description": "Command to execute for stdio MCP servers",
171 "examples": [
172 "npx"
173 ]
174 },
175 "env": {
176 "additionalProperties": {
177 "type": "string"
178 },
179 "type": "object",
180 "description": "Environment variables to set for the MCP server"
181 },
182 "args": {
183 "items": {
184 "type": "string"
185 },
186 "type": "array",
187 "description": "Arguments to pass to the MCP server command"
188 },
189 "type": {
190 "type": "string",
191 "enum": [
192 "stdio",
193 "sse",
194 "http"
195 ],
196 "description": "Type of MCP connection",
197 "default": "stdio"
198 },
199 "url": {
200 "type": "string",
201 "format": "uri",
202 "description": "URL for HTTP or SSE MCP servers",
203 "examples": [
204 "http://localhost:3000/mcp"
205 ]
206 },
207 "disabled": {
208 "type": "boolean",
209 "description": "Whether this MCP server is disabled",
210 "default": false
211 },
212 "timeout": {
213 "type": "integer",
214 "description": "Timeout in seconds for MCP server connections",
215 "default": 15,
216 "examples": [
217 30,
218 60,
219 120
220 ]
221 },
222 "headers": {
223 "additionalProperties": {
224 "type": "string"
225 },
226 "type": "object",
227 "description": "HTTP headers for HTTP/SSE MCP servers"
228 }
229 },
230 "additionalProperties": false,
231 "type": "object",
232 "required": [
233 "type"
234 ]
235 },
236 "MCPs": {
237 "additionalProperties": {
238 "$ref": "#/$defs/MCPConfig"
239 },
240 "type": "object"
241 },
242 "Model": {
243 "properties": {
244 "id": {
245 "type": "string"
246 },
247 "name": {
248 "type": "string"
249 },
250 "cost_per_1m_in": {
251 "type": "number"
252 },
253 "cost_per_1m_out": {
254 "type": "number"
255 },
256 "cost_per_1m_in_cached": {
257 "type": "number"
258 },
259 "cost_per_1m_out_cached": {
260 "type": "number"
261 },
262 "context_window": {
263 "type": "integer"
264 },
265 "default_max_tokens": {
266 "type": "integer"
267 },
268 "can_reason": {
269 "type": "boolean"
270 },
271 "has_reasoning_efforts": {
272 "type": "boolean"
273 },
274 "default_reasoning_effort": {
275 "type": "string"
276 },
277 "supports_attachments": {
278 "type": "boolean"
279 }
280 },
281 "additionalProperties": false,
282 "type": "object",
283 "required": [
284 "id",
285 "name",
286 "cost_per_1m_in",
287 "cost_per_1m_out",
288 "cost_per_1m_in_cached",
289 "cost_per_1m_out_cached",
290 "context_window",
291 "default_max_tokens",
292 "can_reason",
293 "has_reasoning_efforts",
294 "supports_attachments"
295 ]
296 },
297 "Options": {
298 "properties": {
299 "context_paths": {
300 "items": {
301 "type": "string",
302 "examples": [
303 ".cursorrules",
304 "CRUSH.md"
305 ]
306 },
307 "type": "array",
308 "description": "Paths to files containing context information for the AI"
309 },
310 "tui": {
311 "$ref": "#/$defs/TUIOptions",
312 "description": "Terminal user interface options"
313 },
314 "debug": {
315 "type": "boolean",
316 "description": "Enable debug logging",
317 "default": false
318 },
319 "debug_lsp": {
320 "type": "boolean",
321 "description": "Enable debug logging for LSP servers",
322 "default": false
323 },
324 "disable_auto_summarize": {
325 "type": "boolean",
326 "description": "Disable automatic conversation summarization",
327 "default": false
328 },
329 "data_directory": {
330 "type": "string",
331 "description": "Directory for storing application data (relative to working directory)",
332 "default": ".crush",
333 "examples": [
334 ".crush"
335 ]
336 },
337 "disabled_tools": {
338 "items": {
339 "type": "string"
340 },
341 "type": "array",
342 "description": "Tools to disable"
343 },
344 "disable_provider_auto_update": {
345 "type": "boolean",
346 "description": "Disable providers auto-update",
347 "default": false
348 },
349 "attribution": {
350 "$ref": "#/$defs/Attribution",
351 "description": "Attribution settings for generated content"
352 },
353 "disable_metrics": {
354 "type": "boolean",
355 "description": "Disable sending metrics",
356 "default": false
357 }
358 },
359 "additionalProperties": false,
360 "type": "object",
361 "required": [
362 "disabled_tools"
363 ]
364 },
365 "Permissions": {
366 "properties": {
367 "allowed_tools": {
368 "items": {
369 "type": "string",
370 "examples": [
371 "bash",
372 "view"
373 ]
374 },
375 "type": "array",
376 "description": "List of tools that don't require permission prompts"
377 }
378 },
379 "additionalProperties": false,
380 "type": "object"
381 },
382 "ProviderConfig": {
383 "properties": {
384 "id": {
385 "type": "string",
386 "description": "Unique identifier for the provider",
387 "examples": [
388 "openai"
389 ]
390 },
391 "name": {
392 "type": "string",
393 "description": "Human-readable name for the provider",
394 "examples": [
395 "OpenAI"
396 ]
397 },
398 "base_url": {
399 "type": "string",
400 "format": "uri",
401 "description": "Base URL for the provider's API",
402 "examples": [
403 "https://api.openai.com/v1"
404 ]
405 },
406 "type": {
407 "type": "string",
408 "enum": [
409 "openai",
410 "anthropic",
411 "gemini",
412 "azure",
413 "vertexai"
414 ],
415 "description": "Provider type that determines the API format",
416 "default": "openai"
417 },
418 "api_key": {
419 "type": "string",
420 "description": "API key for authentication with the provider",
421 "examples": [
422 "$OPENAI_API_KEY"
423 ]
424 },
425 "disable": {
426 "type": "boolean",
427 "description": "Whether this provider is disabled",
428 "default": false
429 },
430 "system_prompt_prefix": {
431 "type": "string",
432 "description": "Custom prefix to add to system prompts for this provider"
433 },
434 "extra_headers": {
435 "additionalProperties": {
436 "type": "string"
437 },
438 "type": "object",
439 "description": "Additional HTTP headers to send with requests"
440 },
441 "extra_body": {
442 "type": "object",
443 "description": "Additional fields to include in request bodies"
444 },
445 "models": {
446 "items": {
447 "$ref": "#/$defs/Model"
448 },
449 "type": "array",
450 "description": "List of models available from this provider"
451 }
452 },
453 "additionalProperties": false,
454 "type": "object"
455 },
456 "SelectedModel": {
457 "properties": {
458 "model": {
459 "type": "string",
460 "description": "The model ID as used by the provider API",
461 "examples": [
462 "gpt-4o"
463 ]
464 },
465 "provider": {
466 "type": "string",
467 "description": "The model provider ID that matches a key in the providers config",
468 "examples": [
469 "openai"
470 ]
471 },
472 "reasoning_effort": {
473 "type": "string",
474 "enum": [
475 "low",
476 "medium",
477 "high"
478 ],
479 "description": "Reasoning effort level for OpenAI models that support it"
480 },
481 "max_tokens": {
482 "type": "integer",
483 "maximum": 200000,
484 "minimum": 1,
485 "description": "Maximum number of tokens for model responses",
486 "examples": [
487 4096
488 ]
489 },
490 "think": {
491 "type": "boolean",
492 "description": "Enable thinking mode for Anthropic models that support reasoning"
493 }
494 },
495 "additionalProperties": false,
496 "type": "object",
497 "required": [
498 "model",
499 "provider"
500 ]
501 },
502 "TUIOptions": {
503 "properties": {
504 "compact_mode": {
505 "type": "boolean",
506 "description": "Enable compact mode for the TUI interface",
507 "default": false
508 },
509 "diff_mode": {
510 "type": "string",
511 "enum": [
512 "unified",
513 "split"
514 ],
515 "description": "Diff mode for the TUI interface"
516 },
517 "completions": {
518 "$ref": "#/$defs/Completions",
519 "description": "Completions UI options"
520 }
521 },
522 "additionalProperties": false,
523 "type": "object",
524 "required": [
525 "completions"
526 ]
527 },
528 "ToolLs": {
529 "properties": {
530 "max_depth": {
531 "type": "integer",
532 "description": "Maximum depth for the ls tool",
533 "default": 0,
534 "examples": [
535 10
536 ]
537 },
538 "max_items": {
539 "type": "integer",
540 "description": "Maximum number of items to return for the ls tool",
541 "default": 1000,
542 "examples": [
543 100
544 ]
545 }
546 },
547 "additionalProperties": false,
548 "type": "object"
549 },
550 "Tools": {
551 "properties": {
552 "ls": {
553 "$ref": "#/$defs/ToolLs"
554 }
555 },
556 "additionalProperties": false,
557 "type": "object",
558 "required": [
559 "ls"
560 ]
561 }
562 }
563}