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