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