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