schema.json 17 KB

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