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