schema.json 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  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. "Attribution": {
  7. "properties": {
  8. "co_authored_by": {
  9. "type": "boolean",
  10. "description": "Add Co-Authored-By trailer to commit messages",
  11. "default": true
  12. },
  13. "generated_with": {
  14. "type": "boolean",
  15. "description": "Add Generated with Crush line to commit messages and issues and PRs",
  16. "default": true
  17. }
  18. },
  19. "additionalProperties": false,
  20. "type": "object"
  21. },
  22. "Completions": {
  23. "properties": {
  24. "max_depth": {
  25. "type": "integer",
  26. "description": "Maximum depth for the ls tool",
  27. "default": 0,
  28. "examples": [
  29. 10
  30. ]
  31. },
  32. "max_items": {
  33. "type": "integer",
  34. "description": "Maximum number of items to return for the ls tool",
  35. "default": 1000,
  36. "examples": [
  37. 100
  38. ]
  39. }
  40. },
  41. "additionalProperties": false,
  42. "type": "object"
  43. },
  44. "Config": {
  45. "properties": {
  46. "$schema": {
  47. "type": "string"
  48. },
  49. "models": {
  50. "additionalProperties": {
  51. "$ref": "#/$defs/SelectedModel"
  52. },
  53. "type": "object",
  54. "description": "Model configurations for different model types"
  55. },
  56. "providers": {
  57. "additionalProperties": {
  58. "$ref": "#/$defs/ProviderConfig"
  59. },
  60. "type": "object",
  61. "description": "AI provider configurations"
  62. },
  63. "mcp": {
  64. "$ref": "#/$defs/MCPs",
  65. "description": "Model Context Protocol server configurations"
  66. },
  67. "lsp": {
  68. "$ref": "#/$defs/LSPs",
  69. "description": "Language Server Protocol configurations"
  70. },
  71. "options": {
  72. "$ref": "#/$defs/Options",
  73. "description": "General application options"
  74. },
  75. "permissions": {
  76. "$ref": "#/$defs/Permissions",
  77. "description": "Permission settings for tool usage"
  78. },
  79. "tools": {
  80. "$ref": "#/$defs/Tools",
  81. "description": "Tool configurations"
  82. }
  83. },
  84. "additionalProperties": false,
  85. "type": "object",
  86. "required": [
  87. "tools"
  88. ]
  89. },
  90. "LSPConfig": {
  91. "properties": {
  92. "disabled": {
  93. "type": "boolean",
  94. "description": "Whether this LSP server is disabled",
  95. "default": false
  96. },
  97. "command": {
  98. "type": "string",
  99. "description": "Command to execute for the LSP server",
  100. "examples": [
  101. "gopls"
  102. ]
  103. },
  104. "args": {
  105. "items": {
  106. "type": "string"
  107. },
  108. "type": "array",
  109. "description": "Arguments to pass to the LSP server command"
  110. },
  111. "env": {
  112. "additionalProperties": {
  113. "type": "string"
  114. },
  115. "type": "object",
  116. "description": "Environment variables to set to the LSP server command"
  117. },
  118. "filetypes": {
  119. "items": {
  120. "type": "string",
  121. "examples": [
  122. "go",
  123. "mod",
  124. "rs",
  125. "c",
  126. "js",
  127. "ts"
  128. ]
  129. },
  130. "type": "array",
  131. "description": "File types this LSP server handles"
  132. },
  133. "root_markers": {
  134. "items": {
  135. "type": "string",
  136. "examples": [
  137. "go.mod",
  138. "package.json",
  139. "Cargo.toml"
  140. ]
  141. },
  142. "type": "array",
  143. "description": "Files or directories that indicate the project root"
  144. },
  145. "init_options": {
  146. "type": "object",
  147. "description": "Initialization options passed to the LSP server during initialize request"
  148. },
  149. "options": {
  150. "type": "object",
  151. "description": "LSP server-specific settings passed during initialization"
  152. }
  153. },
  154. "additionalProperties": false,
  155. "type": "object",
  156. "required": [
  157. "command"
  158. ]
  159. },
  160. "LSPs": {
  161. "additionalProperties": {
  162. "$ref": "#/$defs/LSPConfig"
  163. },
  164. "type": "object"
  165. },
  166. "MCPConfig": {
  167. "properties": {
  168. "command": {
  169. "type": "string",
  170. "description": "Command to execute for stdio MCP servers",
  171. "examples": [
  172. "npx"
  173. ]
  174. },
  175. "env": {
  176. "additionalProperties": {
  177. "type": "string"
  178. },
  179. "type": "object",
  180. "description": "Environment variables to set for the MCP server"
  181. },
  182. "args": {
  183. "items": {
  184. "type": "string"
  185. },
  186. "type": "array",
  187. "description": "Arguments to pass to the MCP server command"
  188. },
  189. "type": {
  190. "type": "string",
  191. "enum": [
  192. "stdio",
  193. "sse",
  194. "http"
  195. ],
  196. "description": "Type of MCP connection",
  197. "default": "stdio"
  198. },
  199. "url": {
  200. "type": "string",
  201. "format": "uri",
  202. "description": "URL for HTTP or SSE MCP servers",
  203. "examples": [
  204. "http://localhost:3000/mcp"
  205. ]
  206. },
  207. "disabled": {
  208. "type": "boolean",
  209. "description": "Whether this MCP server is disabled",
  210. "default": false
  211. },
  212. "timeout": {
  213. "type": "integer",
  214. "description": "Timeout in seconds for MCP server connections",
  215. "default": 15,
  216. "examples": [
  217. 30,
  218. 60,
  219. 120
  220. ]
  221. },
  222. "headers": {
  223. "additionalProperties": {
  224. "type": "string"
  225. },
  226. "type": "object",
  227. "description": "HTTP headers for HTTP/SSE MCP servers"
  228. }
  229. },
  230. "additionalProperties": false,
  231. "type": "object",
  232. "required": [
  233. "type"
  234. ]
  235. },
  236. "MCPs": {
  237. "additionalProperties": {
  238. "$ref": "#/$defs/MCPConfig"
  239. },
  240. "type": "object"
  241. },
  242. "Model": {
  243. "properties": {
  244. "id": {
  245. "type": "string"
  246. },
  247. "name": {
  248. "type": "string"
  249. },
  250. "cost_per_1m_in": {
  251. "type": "number"
  252. },
  253. "cost_per_1m_out": {
  254. "type": "number"
  255. },
  256. "cost_per_1m_in_cached": {
  257. "type": "number"
  258. },
  259. "cost_per_1m_out_cached": {
  260. "type": "number"
  261. },
  262. "context_window": {
  263. "type": "integer"
  264. },
  265. "default_max_tokens": {
  266. "type": "integer"
  267. },
  268. "can_reason": {
  269. "type": "boolean"
  270. },
  271. "reasoning_levels": {
  272. "items": {
  273. "type": "string"
  274. },
  275. "type": "array"
  276. },
  277. "default_reasoning_effort": {
  278. "type": "string"
  279. },
  280. "supports_attachments": {
  281. "type": "boolean"
  282. },
  283. "options": {
  284. "$ref": "#/$defs/ModelOptions"
  285. }
  286. },
  287. "additionalProperties": false,
  288. "type": "object",
  289. "required": [
  290. "id",
  291. "name",
  292. "cost_per_1m_in",
  293. "cost_per_1m_out",
  294. "cost_per_1m_in_cached",
  295. "cost_per_1m_out_cached",
  296. "context_window",
  297. "default_max_tokens",
  298. "can_reason",
  299. "supports_attachments",
  300. "options"
  301. ]
  302. },
  303. "ModelOptions": {
  304. "properties": {
  305. "temperature": {
  306. "type": "number"
  307. },
  308. "top_p": {
  309. "type": "number"
  310. },
  311. "top_k": {
  312. "type": "integer"
  313. },
  314. "frequency_penalty": {
  315. "type": "number"
  316. },
  317. "presence_penalty": {
  318. "type": "number"
  319. },
  320. "provider_options": {
  321. "type": "object"
  322. }
  323. },
  324. "additionalProperties": false,
  325. "type": "object"
  326. },
  327. "Options": {
  328. "properties": {
  329. "context_paths": {
  330. "items": {
  331. "type": "string",
  332. "examples": [
  333. ".cursorrules",
  334. "CRUSH.md"
  335. ]
  336. },
  337. "type": "array",
  338. "description": "Paths to files containing context information for the AI"
  339. },
  340. "tui": {
  341. "$ref": "#/$defs/TUIOptions",
  342. "description": "Terminal user interface options"
  343. },
  344. "debug": {
  345. "type": "boolean",
  346. "description": "Enable debug logging",
  347. "default": false
  348. },
  349. "debug_lsp": {
  350. "type": "boolean",
  351. "description": "Enable debug logging for LSP servers",
  352. "default": false
  353. },
  354. "disable_auto_summarize": {
  355. "type": "boolean",
  356. "description": "Disable automatic conversation summarization",
  357. "default": false
  358. },
  359. "data_directory": {
  360. "type": "string",
  361. "description": "Directory for storing application data (relative to working directory)",
  362. "default": ".crush",
  363. "examples": [
  364. ".crush"
  365. ]
  366. },
  367. "disabled_tools": {
  368. "items": {
  369. "type": "string"
  370. },
  371. "type": "array",
  372. "description": "Tools to disable"
  373. },
  374. "disable_provider_auto_update": {
  375. "type": "boolean",
  376. "description": "Disable providers auto-update",
  377. "default": false
  378. },
  379. "attribution": {
  380. "$ref": "#/$defs/Attribution",
  381. "description": "Attribution settings for generated content"
  382. },
  383. "disable_metrics": {
  384. "type": "boolean",
  385. "description": "Disable sending metrics",
  386. "default": false
  387. }
  388. },
  389. "additionalProperties": false,
  390. "type": "object",
  391. "required": [
  392. "disabled_tools"
  393. ]
  394. },
  395. "Permissions": {
  396. "properties": {
  397. "allowed_tools": {
  398. "items": {
  399. "type": "string",
  400. "examples": [
  401. "bash",
  402. "view"
  403. ]
  404. },
  405. "type": "array",
  406. "description": "List of tools that don't require permission prompts"
  407. }
  408. },
  409. "additionalProperties": false,
  410. "type": "object"
  411. },
  412. "ProviderConfig": {
  413. "properties": {
  414. "id": {
  415. "type": "string",
  416. "description": "Unique identifier for the provider",
  417. "examples": [
  418. "openai"
  419. ]
  420. },
  421. "name": {
  422. "type": "string",
  423. "description": "Human-readable name for the provider",
  424. "examples": [
  425. "OpenAI"
  426. ]
  427. },
  428. "base_url": {
  429. "type": "string",
  430. "format": "uri",
  431. "description": "Base URL for the provider's API",
  432. "examples": [
  433. "https://api.openai.com/v1"
  434. ]
  435. },
  436. "type": {
  437. "type": "string",
  438. "enum": [
  439. "openai",
  440. "anthropic",
  441. "gemini",
  442. "azure",
  443. "vertexai"
  444. ],
  445. "description": "Provider type that determines the API format",
  446. "default": "openai"
  447. },
  448. "api_key": {
  449. "type": "string",
  450. "description": "API key for authentication with the provider",
  451. "examples": [
  452. "$OPENAI_API_KEY"
  453. ]
  454. },
  455. "disable": {
  456. "type": "boolean",
  457. "description": "Whether this provider is disabled",
  458. "default": false
  459. },
  460. "system_prompt_prefix": {
  461. "type": "string",
  462. "description": "Custom prefix to add to system prompts for this provider"
  463. },
  464. "extra_headers": {
  465. "additionalProperties": {
  466. "type": "string"
  467. },
  468. "type": "object",
  469. "description": "Additional HTTP headers to send with requests"
  470. },
  471. "extra_body": {
  472. "type": "object",
  473. "description": "Additional fields to include in request bodies"
  474. },
  475. "provider_options": {
  476. "type": "object",
  477. "description": "Additional provider-specific options for this provider"
  478. },
  479. "models": {
  480. "items": {
  481. "$ref": "#/$defs/Model"
  482. },
  483. "type": "array",
  484. "description": "List of models available from this provider"
  485. }
  486. },
  487. "additionalProperties": false,
  488. "type": "object"
  489. },
  490. "SelectedModel": {
  491. "properties": {
  492. "model": {
  493. "type": "string",
  494. "description": "The model ID as used by the provider API",
  495. "examples": [
  496. "gpt-4o"
  497. ]
  498. },
  499. "provider": {
  500. "type": "string",
  501. "description": "The model provider ID that matches a key in the providers config",
  502. "examples": [
  503. "openai"
  504. ]
  505. },
  506. "reasoning_effort": {
  507. "type": "string",
  508. "enum": [
  509. "low",
  510. "medium",
  511. "high"
  512. ],
  513. "description": "Reasoning effort level for OpenAI models that support it"
  514. },
  515. "think": {
  516. "type": "boolean",
  517. "description": "Enable thinking mode for Anthropic models that support reasoning"
  518. },
  519. "max_tokens": {
  520. "type": "integer",
  521. "maximum": 200000,
  522. "minimum": 1,
  523. "description": "Maximum number of tokens for model responses",
  524. "examples": [
  525. 4096
  526. ]
  527. },
  528. "temperature": {
  529. "type": "number",
  530. "maximum": 1,
  531. "minimum": 0,
  532. "description": "Sampling temperature",
  533. "examples": [
  534. 0.7
  535. ]
  536. },
  537. "top_p": {
  538. "type": "number",
  539. "maximum": 1,
  540. "minimum": 0,
  541. "description": "Top-p (nucleus) sampling parameter",
  542. "examples": [
  543. 0.9
  544. ]
  545. },
  546. "top_k": {
  547. "type": "integer",
  548. "description": "Top-k sampling parameter"
  549. },
  550. "frequency_penalty": {
  551. "type": "number",
  552. "description": "Frequency penalty to reduce repetition"
  553. },
  554. "presence_penalty": {
  555. "type": "number",
  556. "description": "Presence penalty to increase topic diversity"
  557. },
  558. "provider_options": {
  559. "type": "object",
  560. "description": "Additional provider-specific options for the model"
  561. }
  562. },
  563. "additionalProperties": false,
  564. "type": "object",
  565. "required": [
  566. "model",
  567. "provider"
  568. ]
  569. },
  570. "TUIOptions": {
  571. "properties": {
  572. "compact_mode": {
  573. "type": "boolean",
  574. "description": "Enable compact mode for the TUI interface",
  575. "default": false
  576. },
  577. "diff_mode": {
  578. "type": "string",
  579. "enum": [
  580. "unified",
  581. "split"
  582. ],
  583. "description": "Diff mode for the TUI interface"
  584. },
  585. "completions": {
  586. "$ref": "#/$defs/Completions",
  587. "description": "Completions UI options"
  588. }
  589. },
  590. "additionalProperties": false,
  591. "type": "object",
  592. "required": [
  593. "completions"
  594. ]
  595. },
  596. "ToolLs": {
  597. "properties": {
  598. "max_depth": {
  599. "type": "integer",
  600. "description": "Maximum depth for the ls tool",
  601. "default": 0,
  602. "examples": [
  603. 10
  604. ]
  605. },
  606. "max_items": {
  607. "type": "integer",
  608. "description": "Maximum number of items to return for the ls tool",
  609. "default": 1000,
  610. "examples": [
  611. 100
  612. ]
  613. }
  614. },
  615. "additionalProperties": false,
  616. "type": "object"
  617. },
  618. "Tools": {
  619. "properties": {
  620. "ls": {
  621. "$ref": "#/$defs/ToolLs"
  622. }
  623. },
  624. "additionalProperties": false,
  625. "type": "object",
  626. "required": [
  627. "ls"
  628. ]
  629. }
  630. }
  631. }