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