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