@maincode-ai/matilda-code 0.21.13 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/chunks/agent-IUINB66G.js +3 -0
  2. package/chunks/agent-headless-YA2RKYEZ.js +3 -0
  3. package/chunks/{askUserQuestion-BNSWGD26.js → askUserQuestion-RZYBOPLR.js} +3 -3
  4. package/chunks/ca-JKEHLTNL.js +23 -0
  5. package/chunks/chunk-225CZWD7.js +89 -0
  6. package/chunks/{chunk-MEV5XQI2.js → chunk-2XSB5XHX.js} +1 -1
  7. package/chunks/chunk-453BANK3.js +8 -0
  8. package/chunks/{chunk-6M5G5FBH.js → chunk-4UGPARBR.js} +1 -1
  9. package/chunks/{chunk-RNKDFE2S.js → chunk-5B2QERWR.js} +1 -1
  10. package/chunks/chunk-5ETLURI6.js +3 -0
  11. package/chunks/chunk-6NXVLJ3X.js +56 -0
  12. package/chunks/{chunk-QZI2ZGZY.js → chunk-7B65UIHB.js} +1 -1
  13. package/chunks/{chunk-27Q5KW3A.js → chunk-7E2YCGHS.js} +13 -13
  14. package/chunks/{chunk-DHDD5YJC.js → chunk-ARAB5QTM.js} +69 -69
  15. package/chunks/chunk-DUB7JMQV.js +13 -0
  16. package/chunks/chunk-G3F3ZCH2.js +9 -0
  17. package/chunks/chunk-GT6MSEK4.js +3 -0
  18. package/chunks/chunk-HEJO7OBH.js +3 -0
  19. package/chunks/{chunk-6T2GIM76.js → chunk-IHWAOFCQ.js} +1 -1
  20. package/chunks/chunk-ILHNCXBC.js +8 -0
  21. package/chunks/chunk-J3ZCE3TA.js +8 -0
  22. package/chunks/{chunk-AOOZREGV.js → chunk-LBQNFSZ2.js} +1 -1
  23. package/chunks/{chunk-5OHGYMKP.js → chunk-LM6OIN4B.js} +1 -1
  24. package/chunks/{chunk-EZDV7A76.js → chunk-LMZBADPW.js} +1 -1
  25. package/chunks/chunk-MGRXOZAG.js +8 -0
  26. package/chunks/chunk-NBLBE7PE.js +2609 -0
  27. package/chunks/chunk-POGNX7U3.js +31 -0
  28. package/chunks/chunk-PQZ6HKKW.js +80 -0
  29. package/chunks/chunk-QXSBPCBA.js +8 -0
  30. package/chunks/chunk-RHSUTILA.js +9 -0
  31. package/chunks/{chunk-P5TG5CON.js → chunk-RPXRN7E6.js} +1 -1
  32. package/chunks/chunk-TUKNB5CQ.js +33 -0
  33. package/chunks/chunk-UM6CLO7D.js +7 -0
  34. package/chunks/chunk-V2VUANFI.js +120 -0
  35. package/chunks/chunk-V4VILMIK.js +14 -0
  36. package/chunks/chunk-ZSGBDQXU.js +11 -0
  37. package/chunks/{computer-use-J4GAM4M6.js → computer-use-PBCWDTJR.js} +1 -1
  38. package/chunks/{cron-create-IDWSZENI.js → cron-create-PHQ43NYA.js} +1 -1
  39. package/chunks/cron-delete-7RCQIU2U.js +3 -0
  40. package/chunks/cron-list-KKNLLMNN.js +5 -0
  41. package/chunks/de-GMGNR5CZ.js +23 -0
  42. package/chunks/{devtools-XRQ4YJ5S.js → devtools-7YNCRYZV.js} +1 -1
  43. package/chunks/{chunk-OOEH6ZSV.js → dist-UWUWLWTO.js} +2 -2
  44. package/chunks/{edit-X2S2ZXRN.js → edit-ELHNQB5E.js} +1 -1
  45. package/chunks/en-3NQMLVKW.js +23 -0
  46. package/chunks/{enter-worktree-TUCGNCLO.js → enter-worktree-UZIBOBV3.js} +1 -1
  47. package/chunks/enterPlanMode-UHY3DZXE.js +18 -0
  48. package/chunks/{exit-worktree-7FLITFZI.js → exit-worktree-HLG4PDMX.js} +1 -1
  49. package/chunks/{exitPlanMode-O5UUJ3GM.js → exitPlanMode-V4HYNH3J.js} +2 -2
  50. package/chunks/fr-WS3EBB36.js +23 -0
  51. package/chunks/{getMachineId-bsd-ZYBNK2JG.js → getMachineId-bsd-ETKQTB6C.js} +1 -1
  52. package/chunks/{getMachineId-darwin-CM2MQGUI.js → getMachineId-darwin-AKNRWOWB.js} +1 -1
  53. package/chunks/{getMachineId-linux-SYE2KMCW.js → getMachineId-linux-2QSD7FTP.js} +1 -1
  54. package/chunks/{getMachineId-unsupported-6IHVG2XO.js → getMachineId-unsupported-UXSV7I24.js} +1 -1
  55. package/chunks/{getMachineId-win-S3J3JSUM.js → getMachineId-win-4MTFXGP3.js} +1 -1
  56. package/chunks/glob-C5CTWXLP.js +22 -0
  57. package/chunks/{goal-tools-YQOA6OKU.js → goal-tools-BGIWEJ3K.js} +3 -3
  58. package/chunks/{grep-VAB2VSXM.js → grep-BEFTGKHW.js} +1 -1
  59. package/chunks/ja-GBCDQ43R.js +23 -0
  60. package/chunks/keychain-token-storage-FEJZYJBB.js +3 -0
  61. package/chunks/ls-XH55NAD3.js +15 -0
  62. package/chunks/{lsp-NGLDRHZU.js → lsp-BKDCR37G.js} +1 -1
  63. package/chunks/mcp-client-GAQG7MCT.js +3 -0
  64. package/chunks/monitor-NSVUUKCM.js +32 -0
  65. package/chunks/{multipart-parser-JI75T2O5.js → multipart-parser-FKHYAVGR.js} +1 -1
  66. package/chunks/notebook-edit-AXKYC64C.js +17 -0
  67. package/chunks/openaiContentGenerator-66YY6CIM.js +47 -0
  68. package/chunks/pt-VID6J2CM.js +23 -0
  69. package/chunks/read-file-YFJMLS7V.js +3 -0
  70. package/chunks/ripGrep-BEHEB23R.js +3 -0
  71. package/chunks/ru-EB6V6EAN.js +23 -0
  72. package/chunks/scheduler-GKQOREMS.js +8 -0
  73. package/chunks/send-message-GJSEMAZB.js +8 -0
  74. package/chunks/shell-J5Q2UEXH.js +3 -0
  75. package/chunks/{skill-ETQM5NI3.js → skill-3RWNSUNE.js} +1 -1
  76. package/chunks/src-LZEU4AYF.js +5 -0
  77. package/chunks/symbol-search-4VM6J5Y4.js +19 -0
  78. package/chunks/{syntheticOutput-WZDPECYS.js → syntheticOutput-O7LEF3AM.js} +1 -1
  79. package/chunks/task-create-N4IRJBTF.js +3 -0
  80. package/chunks/{task-detach-TBAVUOTC.js → task-detach-RGNQUX3H.js} +1 -1
  81. package/chunks/task-list-Z7JUB4QK.js +9 -0
  82. package/chunks/{task-stop-HDSARSJ6.js → task-stop-L2OWK2PJ.js} +1 -1
  83. package/chunks/{task-update-MW2VT2XV.js → task-update-H5AXVXDS.js} +1 -1
  84. package/chunks/{team-create-VMYNLZCC.js → team-create-FWTIQ2FT.js} +2 -2
  85. package/chunks/team-delete-D45ALROH.js +8 -0
  86. package/chunks/todoWrite-LCQOQBI7.js +3 -0
  87. package/chunks/{tool-search-WX6FOE35.js → tool-search-X6UUCSPU.js} +1 -1
  88. package/chunks/{web-fetch-CKYBHGLF.js → web-fetch-244KUWSX.js} +17 -17
  89. package/chunks/web-search-YRZ3BZ3X.js +26 -0
  90. package/chunks/{workflow-WBSRQG3N.js → workflow-EP4AFR24.js} +2 -2
  91. package/chunks/write-file-EXWGRN4Q.js +15 -0
  92. package/cli.js +641 -678
  93. package/examples/starter/README.md +0 -3
  94. package/locales/ca.js +3 -87
  95. package/locales/de.js +3 -91
  96. package/locales/en.js +3 -91
  97. package/locales/fr.js +3 -88
  98. package/locales/ja.js +3 -92
  99. package/locales/pt.js +3 -92
  100. package/locales/ru.js +3 -91
  101. package/package.json +2 -2
  102. package/sandbox-macos-permissive-proxied.sb +1 -1
  103. package/sandbox-macos-restrictive-closed.sb +14 -1
  104. package/sandbox-macos-restrictive-open.sb +14 -1
  105. package/sandbox-macos-restrictive-proxied.sb +15 -2
  106. package/bundled/mainy/SKILL.md +0 -157
  107. package/bundled/mainy/docs/_meta.ts +0 -32
  108. package/bundled/mainy/docs/common-workflow.md +0 -571
  109. package/bundled/mainy/docs/configuration/_meta.ts +0 -7
  110. package/bundled/mainy/docs/configuration/auth.md +0 -82
  111. package/bundled/mainy/docs/configuration/matilda-ignore.md +0 -55
  112. package/bundled/mainy/docs/configuration/model-providers.md +0 -516
  113. package/bundled/mainy/docs/configuration/settings.md +0 -818
  114. package/bundled/mainy/docs/configuration/themes.md +0 -199
  115. package/bundled/mainy/docs/configuration/trusted-folders.md +0 -67
  116. package/bundled/mainy/docs/extension/_meta.ts +0 -9
  117. package/bundled/mainy/docs/extension/extension-releasing.md +0 -204
  118. package/bundled/mainy/docs/extension/getting-started-extensions.md +0 -299
  119. package/bundled/mainy/docs/extension/introduction.md +0 -338
  120. package/bundled/mainy/docs/features/_meta.ts +0 -27
  121. package/bundled/mainy/docs/features/approval-mode.md +0 -388
  122. package/bundled/mainy/docs/features/arena.md +0 -219
  123. package/bundled/mainy/docs/features/auto-mode.md +0 -308
  124. package/bundled/mainy/docs/features/channels/_meta.ts +0 -5
  125. package/bundled/mainy/docs/features/channels/overview.md +0 -328
  126. package/bundled/mainy/docs/features/channels/plugins.md +0 -87
  127. package/bundled/mainy/docs/features/channels/telegram.md +0 -120
  128. package/bundled/mainy/docs/features/code-review.md +0 -291
  129. package/bundled/mainy/docs/features/commands.md +0 -528
  130. package/bundled/mainy/docs/features/dual-output.md +0 -627
  131. package/bundled/mainy/docs/features/followup-suggestions.md +0 -109
  132. package/bundled/mainy/docs/features/headless.md +0 -448
  133. package/bundled/mainy/docs/features/hooks.md +0 -1308
  134. package/bundled/mainy/docs/features/language.md +0 -144
  135. package/bundled/mainy/docs/features/lsp.md +0 -496
  136. package/bundled/mainy/docs/features/markdown-rendering.md +0 -183
  137. package/bundled/mainy/docs/features/mcp.md +0 -423
  138. package/bundled/mainy/docs/features/memory.md +0 -185
  139. package/bundled/mainy/docs/features/sandbox.md +0 -249
  140. package/bundled/mainy/docs/features/scheduled-tasks.md +0 -139
  141. package/bundled/mainy/docs/features/skills.md +0 -347
  142. package/bundled/mainy/docs/features/status-line.md +0 -397
  143. package/bundled/mainy/docs/features/structured-output.md +0 -309
  144. package/bundled/mainy/docs/features/sub-agents.md +0 -737
  145. package/bundled/mainy/docs/features/tips.md +0 -54
  146. package/bundled/mainy/docs/features/token-caching.md +0 -29
  147. package/bundled/mainy/docs/features/tool-use-summaries.md +0 -178
  148. package/bundled/mainy/docs/features/worktree.md +0 -343
  149. package/bundled/mainy/docs/ide-integration/_meta.ts +0 -4
  150. package/bundled/mainy/docs/ide-integration/ide-companion-spec.md +0 -182
  151. package/bundled/mainy/docs/ide-integration/ide-integration.md +0 -144
  152. package/bundled/mainy/docs/integration-github-action.md +0 -241
  153. package/bundled/mainy/docs/integration-jetbrains.md +0 -81
  154. package/bundled/mainy/docs/integration-vscode.md +0 -39
  155. package/bundled/mainy/docs/integration-zed.md +0 -72
  156. package/bundled/mainy/docs/matilda-serve-deploy-local.md +0 -221
  157. package/bundled/mainy/docs/matilda-serve.md +0 -661
  158. package/bundled/mainy/docs/overview.md +0 -64
  159. package/bundled/mainy/docs/quickstart.md +0 -234
  160. package/bundled/mainy/docs/reference/_meta.ts +0 -3
  161. package/bundled/mainy/docs/reference/keyboard-shortcuts.md +0 -91
  162. package/bundled/mainy/docs/support/Uninstall.md +0 -65
  163. package/bundled/mainy/docs/support/_meta.ts +0 -6
  164. package/bundled/mainy/docs/support/tos-privacy.md +0 -94
  165. package/bundled/mainy/docs/support/troubleshooting.md +0 -127
  166. package/chunks/agent-SRAIVZEE.js +0 -3
  167. package/chunks/agent-headless-XRDOZESG.js +0 -3
  168. package/chunks/anthropicContentGenerator-LLDIKDMQ.js +0 -39
  169. package/chunks/ca-NPYL24ME.js +0 -25
  170. package/chunks/chunk-27HUYW23.js +0 -22
  171. package/chunks/chunk-2HTPVSGT.js +0 -3
  172. package/chunks/chunk-3B2HABK7.js +0 -30
  173. package/chunks/chunk-3MTZTNAU.js +0 -101
  174. package/chunks/chunk-3YLXGE6T.js +0 -8
  175. package/chunks/chunk-47XR7IMP.js +0 -8
  176. package/chunks/chunk-4F4DA5UI.js +0 -8
  177. package/chunks/chunk-4Q2SNBUH.js +0 -18
  178. package/chunks/chunk-6EQMZNIY.js +0 -8
  179. package/chunks/chunk-6I6VGTKD.js +0 -8
  180. package/chunks/chunk-DC7LAFZZ.js +0 -8
  181. package/chunks/chunk-DE3HKC2W.js +0 -9
  182. package/chunks/chunk-FWDMPRKU.js +0 -3
  183. package/chunks/chunk-G7R2XEEF.js +0 -7
  184. package/chunks/chunk-GOJCMVJJ.js +0 -8
  185. package/chunks/chunk-GTVCJCHR.js +0 -8
  186. package/chunks/chunk-IJEGHQ7Z.js +0 -32
  187. package/chunks/chunk-JCE3JAVC.js +0 -25
  188. package/chunks/chunk-KHHJYBR5.js +0 -9
  189. package/chunks/chunk-LUNDTQ3G.js +0 -8
  190. package/chunks/chunk-LWARA7JY.js +0 -37
  191. package/chunks/chunk-M53RP3YP.js +0 -31
  192. package/chunks/chunk-MTMU7JYZ.js +0 -11
  193. package/chunks/chunk-O44XK65C.js +0 -8
  194. package/chunks/chunk-OA56BXPD.js +0 -3
  195. package/chunks/chunk-PEKAUGYV.js +0 -2621
  196. package/chunks/chunk-PGUG43HG.js +0 -24
  197. package/chunks/chunk-PGXQZVLX.js +0 -8
  198. package/chunks/chunk-QKYGQLWC.js +0 -8
  199. package/chunks/chunk-QN6Y6NPA.js +0 -3
  200. package/chunks/chunk-RI54U73U.js +0 -56
  201. package/chunks/chunk-RPFSFS7Z.js +0 -39
  202. package/chunks/chunk-SDTWBD62.js +0 -8
  203. package/chunks/chunk-SOEIVSM5.js +0 -113
  204. package/chunks/chunk-SVSY6AWS.js +0 -59
  205. package/chunks/chunk-T2T2UEPY.js +0 -4
  206. package/chunks/chunk-TISQNFB5.js +0 -3
  207. package/chunks/chunk-TWJLOEAI.js +0 -31
  208. package/chunks/chunk-VI74YQQO.js +0 -8
  209. package/chunks/chunk-VYZOOSMP.js +0 -30
  210. package/chunks/chunk-W4QSMIWO.js +0 -9
  211. package/chunks/chunk-WC2VTVCE.js +0 -27
  212. package/chunks/chunk-YV3PUOBU.js +0 -65
  213. package/chunks/chunk-ZX34M2GF.js +0 -14
  214. package/chunks/contextCommand-5F5M7NA4.js +0 -3
  215. package/chunks/cron-delete-NQCDZDUI.js +0 -3
  216. package/chunks/cron-list-Z4XMC3TO.js +0 -5
  217. package/chunks/de-34YZHGC6.js +0 -25
  218. package/chunks/dist-7UYRLSLE.js +0 -3
  219. package/chunks/dist-PH6JW7XD.js +0 -42
  220. package/chunks/en-QLGMD6OS.js +0 -25
  221. package/chunks/enterPlanMode-SQEZAAIR.js +0 -18
  222. package/chunks/fileFromPath-7UCWPD4W.js +0 -3
  223. package/chunks/fr-EDNBQACJ.js +0 -25
  224. package/chunks/geminiContentGenerator-FIZFLPU3.js +0 -8
  225. package/chunks/glob-GSFTYAS2.js +0 -22
  226. package/chunks/ja-LV4RLM3M.js +0 -25
  227. package/chunks/keychain-token-storage-KQK6MNOJ.js +0 -3
  228. package/chunks/ls-IZJ3CKZY.js +0 -15
  229. package/chunks/matildaAgentContentGenerator-QQHPCFJ5.js +0 -8
  230. package/chunks/matildaContentGenerator-W7Z33ONU.js +0 -8
  231. package/chunks/matildaOAuth2-7COTQQR2.js +0 -3
  232. package/chunks/mcp-client-DXUNIEIB.js +0 -3
  233. package/chunks/monitor-4PFIGAGG.js +0 -32
  234. package/chunks/notebook-edit-MWJYAATJ.js +0 -17
  235. package/chunks/openaiContentGenerator-NDVJL6QL.js +0 -3
  236. package/chunks/pt-5SQ4DGL7.js +0 -25
  237. package/chunks/read-file-WPZKPXWA.js +0 -3
  238. package/chunks/ripGrep-7LZDZFTX.js +0 -3
  239. package/chunks/ru-7K24S53N.js +0 -25
  240. package/chunks/scheduler-DK2MVKXX.js +0 -8
  241. package/chunks/send-message-TCPX5UDU.js +0 -8
  242. package/chunks/serve-GSZPJI2O.js +0 -1026
  243. package/chunks/shell-PRS47PDP.js +0 -3
  244. package/chunks/src-UB7DZRYK.js +0 -3
  245. package/chunks/src-WZTRMETQ.js +0 -5
  246. package/chunks/symbol-search-HARHZ5AH.js +0 -19
  247. package/chunks/task-create-XRNIDT4T.js +0 -3
  248. package/chunks/task-list-Z6BDZZID.js +0 -9
  249. package/chunks/team-delete-F7QDC2TE.js +0 -8
  250. package/chunks/todoWrite-SCF5M24M.js +0 -3
  251. package/chunks/web-search-67DFNS5V.js +0 -26
  252. package/chunks/write-file-S5FAX4JJ.js +0 -15
@@ -1,109 +0,0 @@
1
- # Followup Suggestions
2
-
3
- Matilda Code can predict what you want to type next and show it as ghost text in the input area. This feature uses an LLM call to analyze the conversation context and generate a natural next step suggestion.
4
-
5
- This feature works end-to-end in the CLI. In the WebUI, the hook and UI plumbing are available, but host applications must trigger suggestion generation and wire the followup state for suggestions to appear.
6
-
7
- ## How It Works
8
-
9
- After Matilda Code finishes responding, a suggestion appears as dimmed text in the input area after a short delay (~300ms). For example, after fixing a bug, you might see:
10
-
11
- ```
12
- > run the tests
13
- ```
14
-
15
- The suggestion is generated by sending the conversation history to the model, which predicts what you would naturally type next. If the response contains an explicit tip (e.g., `Tip: type post comments to publish findings`), the suggested action is extracted automatically.
16
-
17
- ## Accepting Suggestions
18
-
19
- | Key | Action |
20
- | ------------- | ------------------------------------------------ |
21
- | `Tab` | Accept the suggestion and fill it into the input |
22
- | `Enter` | Accept the suggestion and submit it immediately |
23
- | `Right Arrow` | Accept the suggestion and fill it into the input |
24
- | Any typing | Dismiss the suggestion and type normally |
25
-
26
- ## When Suggestions Appear
27
-
28
- Suggestions are generated when all of the following conditions are met:
29
-
30
- - The model has completed its response (not during streaming)
31
- - At least 2 model turns have occurred in the conversation
32
- - There are no errors in the most recent response
33
- - No confirmation dialogs are pending (e.g., shell confirmation, permissions)
34
- - The approval mode is not set to `plan`
35
- - The feature is enabled in settings (disabled by default — set `ui.enableFollowupSuggestions` to `true` to turn it on)
36
-
37
- Suggestions will not appear in non-interactive mode (e.g., headless/SDK mode).
38
-
39
- Suggestions are automatically dismissed when:
40
-
41
- - You start typing
42
- - A new model turn begins
43
- - The suggestion is accepted
44
-
45
- ## Fast Model
46
-
47
- By default, suggestions use the same model as your main conversation. For faster and cheaper suggestions, configure a dedicated fast model:
48
-
49
- ### Via command
50
-
51
- ```
52
- /model --fast matilda3-coder-flash
53
- ```
54
-
55
- Or use `/model --fast` (without a model name) to open a selection dialog.
56
-
57
- ### Via settings.json
58
-
59
- ```json
60
- {
61
- "fastModel": "matilda3-coder-flash"
62
- }
63
- ```
64
-
65
- The fast model is used for prompt suggestions and speculative execution. When not configured, the main conversation model is used as fallback.
66
-
67
- Thinking/reasoning mode is automatically disabled for all background tasks (suggestion generation and speculation), regardless of your main model's thinking configuration. This avoids wasting tokens on internal reasoning that isn't needed for these tasks.
68
-
69
- ## Configuration
70
-
71
- These settings can be configured in `settings.json`:
72
-
73
- | Setting | Type | Default | Description |
74
- | ------------------------------ | ------- | ------- | ------------------------------------------------------------------ |
75
- | `ui.enableFollowupSuggestions` | boolean | `false` | Enable or disable followup suggestions |
76
- | `ui.enableCacheSharing` | boolean | `true` | Use cache-aware forked queries to reduce cost (experimental) |
77
- | `ui.enableSpeculation` | boolean | `false` | Speculatively execute suggestions before submission (experimental) |
78
- | `fastModel` | string | `""` | Model for prompt suggestions and speculative execution |
79
-
80
- ### Example
81
-
82
- ```json
83
- {
84
- "fastModel": "matilda3-coder-flash",
85
- "ui": {
86
- "enableFollowupSuggestions": true,
87
- "enableCacheSharing": true
88
- }
89
- }
90
- ```
91
-
92
- ## Monitoring
93
-
94
- Suggestion model usage appears in `/stats` output, showing tokens consumed by the fast model for suggestion generation.
95
-
96
- The fast model is also shown in `/about` output under "Fast Model".
97
-
98
- ## Suggestion Quality
99
-
100
- Suggestions go through quality filters to ensure they are useful:
101
-
102
- - Must be 2-12 words (CJK: 2-30 characters), under 100 characters total
103
- - Cannot be evaluative ("looks good", "thanks")
104
- - Cannot use AI voice ("Let me...", "I'll...")
105
- - Cannot be multiple sentences or contain formatting (markdown, newlines)
106
- - Cannot be meta-commentary ("nothing to suggest", "silence")
107
- - Cannot be error messages or prefixed labels ("Suggestion: ...")
108
- - Single-word suggestions are only allowed for common commands (yes, commit, push, etc.)
109
- - Slash commands (e.g., `/commit`) are always allowed as single-word suggestions
@@ -1,448 +0,0 @@
1
- # Headless Mode
2
-
3
- Headless mode allows you to run Matilda Code programmatically from command line
4
- scripts and automation tools without any interactive UI. This is ideal for
5
- scripting, automation, CI/CD pipelines, and building AI-powered tools.
6
-
7
- ## Overview
8
-
9
- The headless mode provides a headless interface to Matilda Code that:
10
-
11
- - Accepts prompts via command line arguments or stdin
12
- - Returns structured output (text or JSON)
13
- - Supports file redirection and piping
14
- - Enables automation and scripting workflows
15
- - Provides consistent exit codes for error handling
16
- - Can resume previous sessions scoped to the current project for multi-step automation
17
-
18
- ## Basic Usage
19
-
20
- ### Direct Prompts
21
-
22
- Use the `--prompt` (or `-p`) flag to run in headless mode:
23
-
24
- ```bash
25
- matilda --prompt "What is machine learning?"
26
- ```
27
-
28
- ### Stdin Input
29
-
30
- Pipe input to Matilda Code from your terminal:
31
-
32
- ```bash
33
- echo "Explain this code" | matilda
34
- ```
35
-
36
- ### Combining with File Input
37
-
38
- Read from files and process with Matilda Code:
39
-
40
- ```bash
41
- cat README.md | matilda --prompt "Summarize this documentation"
42
- ```
43
-
44
- ### Resume Previous Sessions (Headless)
45
-
46
- Reuse conversation context from the current project in headless scripts:
47
-
48
- ```bash
49
- # Continue the most recent session for this project and run a new prompt
50
- matilda --continue -p "Run the tests again and summarize failures"
51
-
52
- # Resume a specific session ID directly (no UI)
53
- matilda --resume 123e4567-e89b-12d3-a456-426614174000 -p "Apply the follow-up refactor"
54
-
55
- # Start a fresh session with a caller-chosen ID (must be a valid UUID)
56
- matilda --session-id 123e4567-e89b-12d3-a456-426614174000 -p "Start a tracked run"
57
- ```
58
-
59
- > [!note]
60
- >
61
- > - Session data is project-scoped JSONL under `~/.matilda/projects/<sanitized-cwd>/chats`.
62
- > - Restores conversation history, tool outputs, and chat-compression checkpoints before sending the new prompt.
63
- > - `--session-id` must be a valid UUID (e.g. from `uuidgen`). Non-UUID values are rejected at parse time.
64
-
65
- ## Customize the Main Session Prompt
66
-
67
- You can change the main session system prompt for a single CLI run without editing shared memory files.
68
-
69
- ### Override the Built-in System Prompt
70
-
71
- Use `--system-prompt` to replace Matilda Code's built-in main-session prompt for the current run:
72
-
73
- ```bash
74
- matilda -p "Review this patch" --system-prompt "You are a terse release reviewer. Report only blocking issues."
75
- ```
76
-
77
- ### Append Extra Instructions
78
-
79
- Use `--append-system-prompt` to keep the built-in prompt and add extra instructions for this run:
80
-
81
- ```bash
82
- matilda -p "Review this patch" --append-system-prompt "Be terse and focus on concrete findings."
83
- ```
84
-
85
- You can combine both flags when you want a custom base prompt plus an extra run-specific instruction:
86
-
87
- ```bash
88
- matilda -p "Summarize this repository" \
89
- --system-prompt "You are a migration planner." \
90
- --append-system-prompt "Return exactly three bullets."
91
- ```
92
-
93
- > [!note]
94
- >
95
- > - `--system-prompt` applies only to the current run's main session.
96
- > - Loaded memory and context files such as `MATILDA.md` are still appended after `--system-prompt`.
97
- > - `--append-system-prompt` is applied after the built-in prompt and loaded memory, and can be used together with `--system-prompt`.
98
-
99
- ## Output Formats
100
-
101
- Matilda Code supports multiple output formats for different use cases:
102
-
103
- ### Text Output (Default)
104
-
105
- Standard human-readable output:
106
-
107
- ```bash
108
- matilda -p "What is the capital of France?"
109
- ```
110
-
111
- Response format:
112
-
113
- ```
114
- The capital of France is Paris.
115
- ```
116
-
117
- For long-horizon / redirected runs, assistant text is **streamed to stdout as
118
- it arrives** (not held until the process exits). Tool starts are reported on
119
- **stderr** as `[tool] <name>` so progress is visible without contaminating the
120
- final answer:
121
-
122
- ```bash
123
- matilda -p "Implement the full TASK.md" --max-wall-time 10m --bogan \
124
- > out.txt 2> progress.txt
125
- # progress.txt will show [tool] lines while out.txt grows with the answer
126
- ```
127
-
128
- ### JSON Output
129
-
130
- Returns structured data as a JSON array. All messages are buffered and output together when the session completes. This format is ideal for programmatic processing and automation scripts.
131
-
132
- The JSON output is an array of message objects. The output includes multiple message types: system messages (session initialization), assistant messages (AI responses), and result messages (execution summary).
133
-
134
- #### Example Usage
135
-
136
- ```bash
137
- matilda -p "What is the capital of France?" --output-format json
138
- ```
139
-
140
- Output (at end of execution):
141
-
142
- ```json
143
- [
144
- {
145
- "type": "system",
146
- "subtype": "session_start",
147
- "uuid": "...",
148
- "session_id": "...",
149
- "model": "matilda3-coder-plus",
150
- ...
151
- },
152
- {
153
- "type": "assistant",
154
- "uuid": "...",
155
- "session_id": "...",
156
- "message": {
157
- "id": "...",
158
- "type": "message",
159
- "role": "assistant",
160
- "model": "matilda3-coder-plus",
161
- "content": [
162
- {
163
- "type": "text",
164
- "text": "The capital of France is Paris."
165
- }
166
- ],
167
- "usage": {...}
168
- },
169
- "parent_tool_use_id": null
170
- },
171
- {
172
- "type": "result",
173
- "subtype": "success",
174
- "uuid": "...",
175
- "session_id": "...",
176
- "is_error": false,
177
- "duration_ms": 1234,
178
- "result": "The capital of France is Paris.",
179
- "usage": {...}
180
- }
181
- ]
182
- ```
183
-
184
- ### Stream-JSON Output
185
-
186
- Stream-JSON format emits JSON messages immediately as they occur during execution, enabling real-time monitoring. This format uses line-delimited JSON where each message is a complete JSON object on a single line.
187
-
188
- ```bash
189
- matilda -p "Explain TypeScript" --output-format stream-json
190
- ```
191
-
192
- ### Dual output (`--json-file` / `--json-fd`)
193
-
194
- Headless runs can also emit a **sidecar** stream of structured JSON events
195
- while keeping the primary `--output-format` on stdout. This is useful for
196
- long-horizon / CI monitoring without switching the main output to stream-json.
197
-
198
- ```bash
199
- # Text answer on stdout; full event stream on disk
200
- matilda -p "Implement the feature in TASK.md" \
201
- --output-format text \
202
- --json-file ./logs/events.jsonl \
203
- --max-wall-time 10m \
204
- --bogan
205
-
206
- # Tail progress while the run is in flight
207
- tail -f ./logs/events.jsonl
208
- ```
209
-
210
- - Works in both interactive (TUI) and headless modes.
211
- - Parent directories for `--json-file` are created when missing.
212
- - Mutually exclusive with `--json-fd`.
213
-
214
- Output (streaming as events occur):
215
-
216
- ```json
217
- {"type":"system","subtype":"session_start","uuid":"...","session_id":"..."}
218
- {"type":"assistant","uuid":"...","session_id":"...","message":{...}}
219
- {"type":"result","subtype":"success","uuid":"...","session_id":"..."}
220
- ```
221
-
222
- When combined with `--include-partial-messages`, additional stream events are emitted in real-time (message_start, content_block_delta, etc.) for real-time UI updates.
223
-
224
- ```bash
225
- matilda -p "Write a Python script" --output-format stream-json --include-partial-messages
226
- ```
227
-
228
- ### Input Format
229
-
230
- The `--input-format` parameter controls how Matilda Code consumes input from standard input:
231
-
232
- - **`text`** (default): Standard text input from stdin or command-line arguments
233
- - **`stream-json`**: JSON message protocol via stdin for bidirectional communication
234
-
235
- > **Note:** Stream-json input mode is currently under construction and is intended for SDK integration. It requires `--output-format stream-json` to be set.
236
-
237
- ### File Redirection
238
-
239
- Save output to files or pipe to other commands:
240
-
241
- ```bash
242
- # Save to file
243
- matilda -p "Explain Docker" > docker-explanation.txt
244
- matilda -p "Explain Docker" --output-format json > docker-explanation.json
245
-
246
- # Append to file
247
- matilda -p "Add more details" >> docker-explanation.txt
248
-
249
- # Pipe to other tools
250
- matilda -p "What is Kubernetes?" --output-format json | jq '.response'
251
- matilda -p "Explain microservices" | wc -w
252
- matilda -p "List programming languages" | grep -i "python"
253
-
254
- # Stream-JSON output for real-time processing
255
- matilda -p "Explain Docker" --output-format stream-json | jq '.type'
256
- matilda -p "Write code" --output-format stream-json --include-partial-messages | jq '.event.type'
257
- ```
258
-
259
- ## Configuration Options
260
-
261
- Key command-line options for headless usage:
262
-
263
- | Option | Description | Example |
264
- | ---------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------- |
265
- | `--prompt`, `-p` | Run in headless mode | `matilda -p "query"` |
266
- | `--output-format`, `-o` | Specify output format (text, json, stream-json) | `matilda -p "query" --output-format json` |
267
- | `--input-format` | Specify input format (text, stream-json) | `matilda --input-format text --output-format stream-json` |
268
- | `--include-partial-messages` | Include partial messages in stream-json output | `matilda -p "query" --output-format stream-json --include-partial-messages` |
269
- | `--system-prompt` | Override the main session system prompt for this run | `matilda -p "query" --system-prompt "You are a terse reviewer."` |
270
- | `--append-system-prompt` | Append extra instructions to the main session system prompt for this run | `matilda -p "query" --append-system-prompt "Focus on concrete findings."` |
271
- | `--debug`, `-d` | Enable debug mode | `matilda -p "query" --debug` |
272
- | `--all-files`, `-a` | Include all files in context | `matilda -p "query" --all-files` |
273
- | `--include-directories` | Include additional directories | `matilda -p "query" --include-directories src,docs` |
274
- | `--yolo`, `-y` | Auto-approve all actions | `matilda -p "query" --yolo` |
275
- | `--approval-mode` | Set approval mode | `matilda -p "query" --approval-mode auto_edit` |
276
- | `--continue` | Resume the most recent session for this project | `matilda --continue -p "Pick up where we left off"` |
277
- | `--resume [sessionId]` | Resume a specific session (or choose interactively) | `matilda --resume 123e... -p "Finish the refactor"` |
278
- | `--max-session-turns` | Cap the number of user/model/tool turns in the run | `matilda -p "..." --max-session-turns 30` |
279
- | `--max-wall-time` | Wall-clock budget; accepts `90` (s), `30s`, `5m`, `1h`, `1.5h` | `matilda -p "..." --max-wall-time 10m` |
280
- | `--max-tool-calls` | Cumulative tool-call budget for the run | `matilda -p "..." --max-tool-calls 50` |
281
-
282
- For complete details on all available configuration options, settings files, and environment variables, see the [Configuration Guide](../configuration/settings).
283
-
284
- ## Safety in unattended runs
285
-
286
- Headless / CI runs combined with `--yolo` (or `--approval-mode=yolo`) auto-approve every tool call, including `shell`, `write`, and `edit`. **`--yolo` does not enable a sandbox** — those tools run at the host process's privilege level. When Matilda Code detects this combination with no sandbox configured, it prints a one-line warning to stderr at startup. Suppress the warning with `MATILDA_CODE_SUPPRESS_YOLO_WARNING=1` once you've reviewed the trade-off.
287
-
288
- ### Run-level budgets
289
-
290
- Matilda Code can abort an unattended run when it crosses one of the following thresholds. Each is `-1` (unlimited) by default; setting any one is enough to bound runaway behavior. They are enforced cooperatively against the same `AbortController` that already carries SIGINT, so a budget abort emits a structured `FatalBudgetExceededError` (exit code **55**) — distinct from the turn-cap exit code 53 and SIGINT's 130 so CI scripts can branch on the reason.
291
-
292
- | Flag | Settings key | What it bounds |
293
- | --------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
294
- | `--max-wall-time` | `model.maxWallTimeSeconds` | Wall-clock duration of the whole run. Flag accepts `90` (s), `30s`, `5m`, `1h`, `1.5h` (fractional units supported). Minimum 1s — sub-second values are rejected as typos. Settings is seconds. |
295
- | `--max-tool-calls` | `model.maxToolCalls` | Cumulative top-level tool calls dispatched by the main run loop (counts successes _and_ failures — the model still consumes tokens on errors). See "Scope" below for subagent / structured-output exemptions. |
296
- | `--max-session-turns` | `model.maxSessionTurns` | Number of user/model/tool turns; pre-existing. Exits with code 53 on overrun (distinct from budget exit 55). |
297
-
298
- #### Scope
299
-
300
- - **`--max-tool-calls` counts top-level dispatches only.** When the model calls the `agent` tool, the dispatch counts as **1**; inner tool calls performed by the spawned subagent are **not** counted. A model that funnels work through subagents can do unbounded inner work under a small top-level budget. Combine with `--exclude-tools agent` if you need a tighter cap.
301
- - **`structured_output` is exempt from `--max-tool-calls`.** Under `--json-schema`, the model's terminal `structured_output` call is the "I'm done" contract, not real work — it doesn't count against `--max-tool-calls` so a budget-edge completion isn't aborted as a false positive. The exemption is unconditional (including failed Ajv validations), so a model stuck in a malformed-output retry loop is NOT bounded by `--max-tool-calls`; combine with `--max-session-turns` or `--max-wall-time` to cap retries.
302
- - **`structured_output` is NOT exempt from `--max-session-turns`.** That counter is pre-existing and bumps for every turn including the terminal contract. Size `--max-session-turns` to `N+1` if you want to allow `N` real-work turns under `--json-schema`.
303
- - **Single-shot vs `--input-format stream-json`:** in stream-json input mode the daemon resets the budget counters at the start of every user message; the budget is per-message, not per-process.
304
- - **`matilda serve` / ACP sessions:** the daemon ACP session path does NOT currently consult `--max-wall-time` / `--max-tool-calls` from settings.json. These budgets only apply to single-shot `matilda -p` runs and to `--input-format stream-json` sessions. (`matilda serve` does emit the YOLO-no-sandbox warning at boot if `tools.approvalMode: 'yolo'` is set in settings.)
305
-
306
- ### Recommended combinations
307
-
308
- - **Trusted, isolated environment (ephemeral CI runner, container):** `matilda -p "..." --yolo --max-session-turns N --max-wall-time 10m --output-format json`. Pin a turn budget and a wall-clock budget so a stuck agent can't burn through your CI minutes, and capture `--output-format json` for post-run usage / tool-call auditing.
309
- - **Local machine or shared infra:** also pass `--sandbox` (or set `MATILDA_SANDBOX=1`) so shell / write / edit tools run inside the sandbox image.
310
- - **Long-running CI with retry-on-rate-limit:** combine `MATILDA_CODE_UNATTENDED_RETRY=1` with `--max-wall-time`. The retry env keeps the run alive past transient 429 / 529 responses; the wall-clock budget ensures a persistently-failing provider can't extend the job indefinitely.
311
- - **Bounded auditing / exploration:** for read-only tasks, `--max-tool-calls 25` caps how aggressively the model can grep / read. Combine with `--exclude-tools shell,write,edit` to make the bound meaningful.
312
-
313
- ## Examples
314
-
315
- ### Code review
316
-
317
- ```bash
318
- cat src/auth.py | matilda -p "Review this authentication code for security issues" > security-review.txt
319
- ```
320
-
321
- ### Generate commit messages
322
-
323
- ```bash
324
- result=$(git diff --cached | matilda -p "Write a concise commit message for these changes" --output-format json)
325
- echo "$result" | jq -r '.response'
326
- ```
327
-
328
- ### API documentation
329
-
330
- ```bash
331
- result=$(cat api/routes.js | matilda -p "Generate OpenAPI spec for these routes" --output-format json)
332
- echo "$result" | jq -r '.response' > openapi.json
333
- ```
334
-
335
- ### Batch code analysis
336
-
337
- ```bash
338
- for file in src/*.py; do
339
- echo "Analyzing $file..."
340
- result=$(cat "$file" | matilda -p "Find potential bugs and suggest improvements" --output-format json)
341
- echo "$result" | jq -r '.response' > "reports/$(basename "$file").analysis"
342
- echo "Completed analysis for $(basename "$file")" >> reports/progress.log
343
- done
344
- ```
345
-
346
- ### PR code review
347
-
348
- ```bash
349
- result=$(git diff origin/main...HEAD | matilda -p "Review these changes for bugs, security issues, and code quality" --output-format json)
350
- echo "$result" | jq -r '.response' > pr-review.json
351
- ```
352
-
353
- ### Log analysis
354
-
355
- ```bash
356
- grep "ERROR" /var/log/app.log | tail -20 | matilda -p "Analyze these errors and suggest root cause and fixes" > error-analysis.txt
357
- ```
358
-
359
- ### Release notes generation
360
-
361
- ```bash
362
- result=$(git log --oneline v1.0.0..HEAD | matilda -p "Generate release notes from these commits" --output-format json)
363
- response=$(echo "$result" | jq -r '.response')
364
- echo "$response"
365
- echo "$response" >> CHANGELOG.md
366
- ```
367
-
368
- ### Model and tool usage tracking
369
-
370
- ```bash
371
- result=$(matilda -p "Explain this database schema" --include-directories db --output-format json)
372
- total_tokens=$(echo "$result" | jq -r '.stats.models // {} | to_entries | map(.value.tokens.total) | add // 0')
373
- models_used=$(echo "$result" | jq -r '.stats.models // {} | keys | join(", ") | if . == "" then "none" else . end')
374
- tool_calls=$(echo "$result" | jq -r '.stats.tools.totalCalls // 0')
375
- tools_used=$(echo "$result" | jq -r '.stats.tools.byName // {} | keys | join(", ") | if . == "" then "none" else . end')
376
- echo "$(date): $total_tokens tokens, $tool_calls tool calls ($tools_used) used with models: $models_used" >> usage.log
377
- echo "$result" | jq -r '.response' > schema-docs.md
378
- echo "Recent usage trends:"
379
- tail -5 usage.log
380
- ```
381
-
382
- ## Persistent Retry Mode
383
-
384
- When Matilda Code runs in CI/CD pipelines or as a background daemon, a brief API outage (rate limiting or overload) should not kill a multi-hour task. **Persistent retry mode** makes Matilda Code retry transient API errors indefinitely until the service recovers.
385
-
386
- ### How it works
387
-
388
- - **Transient errors only**: HTTP 429 (Rate Limit) and 529 (Overloaded) are retried indefinitely. Other errors (400, 500, etc.) still fail normally.
389
- - **Exponential backoff with cap**: Retry delays grow exponentially but are capped at **5 minutes** per retry.
390
- - **Heartbeat keepalive**: During long waits, a status line is printed to stderr every **30 seconds** to prevent CI runners from killing the process due to inactivity.
391
- - **Graceful degradation**: Non-transient errors and interactive mode are completely unaffected.
392
-
393
- ### Activation
394
-
395
- Set the `MATILDA_CODE_UNATTENDED_RETRY` environment variable to `true` or `1` (strict match, case-sensitive):
396
-
397
- ```bash
398
- export MATILDA_CODE_UNATTENDED_RETRY=1
399
- ```
400
-
401
- > [!important]
402
- > Persistent retry requires an **explicit opt-in**. `CI=true` alone does **not** activate it — silently turning a fast-fail CI job into an infinite-wait job would be dangerous. Always set `MATILDA_CODE_UNATTENDED_RETRY` explicitly in your pipeline configuration.
403
-
404
- ### Examples
405
-
406
- #### GitHub Actions
407
-
408
- ```yaml
409
- - name: Automated code review
410
- env:
411
- MATILDA_CODE_UNATTENDED_RETRY: '1'
412
- run: |
413
- matilda -p "Review all files in src/ for security issues" \
414
- --output-format json \
415
- --yolo > review.json
416
- ```
417
-
418
- #### Overnight batch processing
419
-
420
- ```bash
421
- export MATILDA_CODE_UNATTENDED_RETRY=1
422
- matilda -p "Migrate all callback-style functions to async/await in src/" --yolo
423
- ```
424
-
425
- #### Background daemon
426
-
427
- ```bash
428
- MATILDA_CODE_UNATTENDED_RETRY=1 nohup matilda -p "Audit all dependencies for known CVEs" \
429
- --output-format json > audit.json 2> audit.log &
430
- ```
431
-
432
- ### Monitoring
433
-
434
- During persistent retry, heartbeat messages are printed to **stderr**:
435
-
436
- ```
437
- [matilda-code] Waiting for API capacity... attempt 3, retry in 45s
438
- [matilda-code] Waiting for API capacity... attempt 3, retry in 15s
439
- ```
440
-
441
- These messages keep CI runners alive and let you monitor progress. They do not appear in stdout, so JSON output piped to other tools remains clean.
442
-
443
- ## Resources
444
-
445
- - [CLI Configuration](../configuration/settings#command-line-arguments) - Complete configuration guide
446
- - [Authentication](../configuration/settings#environment-variables-for-api-access) - Setup authentication
447
- - [Commands](../features/commands) - Interactive commands reference
448
- - [Tutorials](../quickstart) - Step-by-step automation guides