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