@maincode-ai/matilda-code 0.21.12 → 0.21.13-nightly.20261027.e00306cd3
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.
- package/chunks/agent-H5JE3RJQ.js +3 -0
- package/chunks/agent-headless-H2JZZ7UV.js +3 -0
- package/chunks/{askUserQuestion-2QI4NSFJ.js → askUserQuestion-L3WDL2T4.js} +3 -3
- package/chunks/ca-UBWUTZVZ.js +25 -0
- package/chunks/chunk-4CVGYUEL.js +3 -0
- package/chunks/{chunk-RNKDFE2S.js → chunk-5B2QERWR.js} +1 -1
- package/chunks/chunk-62GTGPTP.js +8 -0
- package/chunks/chunk-6365AZBW.js +56 -0
- package/chunks/chunk-6PFK4XTH.js +207 -0
- package/chunks/chunk-7ZODGQO6.js +4 -0
- package/chunks/chunk-DB5LMKXU.js +31 -0
- package/chunks/chunk-EYZPVR7N.js +13 -0
- package/chunks/chunk-FKHUEFMK.js +8 -0
- package/chunks/{chunk-6T2GIM76.js → chunk-GILXFDEG.js} +1 -1
- package/chunks/{chunk-VTGICC67.js → chunk-GKEUZTOB.js} +1 -1
- package/chunks/chunk-GSRXW64P.js +120 -0
- package/chunks/chunk-GT6MSEK4.js +3 -0
- package/chunks/chunk-HEJO7OBH.js +3 -0
- package/chunks/chunk-HPO2YWG4.js +78 -0
- package/chunks/chunk-I3CV4LOD.js +8 -0
- package/chunks/{chunk-DOOFGSRV.js → chunk-J3AMKDX6.js} +1 -1
- package/chunks/chunk-JU7QTSKS.js +14 -0
- package/chunks/chunk-LBQNFSZ2.js +9 -0
- package/chunks/chunk-LOB42ODE.js +9 -0
- package/chunks/chunk-LVDDFAK4.js +89 -0
- package/chunks/{chunk-27Q5KW3A.js → chunk-NK2QMGCC.js} +13 -13
- package/chunks/{chunk-YRQP3SLC.js → chunk-O7VPFJ3R.js} +1 -1
- package/chunks/chunk-OBE5S4GG.js +9 -0
- package/chunks/{chunk-CZGZ3KK7.js → chunk-ONANBLIE.js} +1 -1
- package/chunks/chunk-QXSBPCBA.js +8 -0
- package/chunks/chunk-TUKNB5CQ.js +33 -0
- package/chunks/chunk-UM6CLO7D.js +7 -0
- package/chunks/chunk-V4D3LER3.js +2615 -0
- package/chunks/{chunk-HYVP4472.js → chunk-V6UPUMP3.js} +1 -1
- package/chunks/chunk-VUJRLLGL.js +8 -0
- package/chunks/{chunk-MCQUPLRE.js → chunk-WTU6GSZH.js} +1 -1
- package/chunks/chunk-XBTBZHRC.js +8 -0
- package/chunks/{chunk-WV3IUPZS.js → chunk-YTB3OFTT.js} +1 -1
- package/chunks/chunk-ZQKABJBB.js +8 -0
- package/chunks/chunk-ZSGBDQXU.js +11 -0
- package/chunks/{computer-use-WKDNUTLD.js → computer-use-N6KGNST6.js} +1 -1
- package/chunks/{cron-create-F2LXM2OA.js → cron-create-4XBY5RVI.js} +1 -1
- package/chunks/cron-delete-BH4VP3LX.js +3 -0
- package/chunks/cron-list-XXRFKNGM.js +5 -0
- package/chunks/de-LEEHWWJ2.js +25 -0
- package/chunks/{devtools-5JRKK3E7.js → devtools-7YNCRYZV.js} +1 -1
- package/chunks/{chunk-OOEH6ZSV.js → dist-UWUWLWTO.js} +2 -2
- package/chunks/{edit-QQNJZ55P.js → edit-6ULTLTJQ.js} +1 -1
- package/chunks/{en-EJLDYIBM.js → en-LNOIHFSQ.js} +4 -4
- package/chunks/{enter-worktree-5X5SAMBJ.js → enter-worktree-V2VANZYJ.js} +1 -1
- package/chunks/enterPlanMode-75H54S3Z.js +18 -0
- package/chunks/{exit-worktree-SRKZBEYF.js → exit-worktree-KPB32K6P.js} +1 -1
- package/chunks/{exitPlanMode-WSPTGGVN.js → exitPlanMode-K7JRP22Y.js} +2 -2
- package/chunks/fr-4TA2AIU6.js +25 -0
- package/chunks/{getMachineId-bsd-ZYBNK2JG.js → getMachineId-bsd-ETKQTB6C.js} +1 -1
- package/chunks/{getMachineId-darwin-CM2MQGUI.js → getMachineId-darwin-AKNRWOWB.js} +1 -1
- package/chunks/{getMachineId-linux-SYE2KMCW.js → getMachineId-linux-2QSD7FTP.js} +1 -1
- package/chunks/{getMachineId-unsupported-6IHVG2XO.js → getMachineId-unsupported-UXSV7I24.js} +1 -1
- package/chunks/{getMachineId-win-S3J3JSUM.js → getMachineId-win-4MTFXGP3.js} +1 -1
- package/chunks/glob-ACAIHWST.js +22 -0
- package/chunks/{goal-tools-C6BSBHCF.js → goal-tools-VPFXBI6M.js} +3 -3
- package/chunks/{grep-MVCOBUYW.js → grep-R4K75RXS.js} +1 -1
- package/chunks/{ja-GGNJR7AR.js → ja-VXDMQKRW.js} +5 -5
- package/chunks/keychain-token-storage-7VYNARRB.js +3 -0
- package/chunks/ls-4ZEICYPK.js +15 -0
- package/chunks/{lsp-DYDK6XCS.js → lsp-4US2RIIV.js} +1 -1
- package/chunks/mcp-client-ZKQFYCFN.js +3 -0
- package/chunks/monitor-KSNFIY54.js +32 -0
- package/chunks/{multipart-parser-JI75T2O5.js → multipart-parser-FKHYAVGR.js} +1 -1
- package/chunks/notebook-edit-655ZNV6Q.js +17 -0
- package/chunks/openaiContentGenerator-BG3OM453.js +52 -0
- package/chunks/pt-WEIMCOKI.js +25 -0
- package/chunks/read-file-4VSUKSRB.js +3 -0
- package/chunks/ripGrep-PNALN2GG.js +3 -0
- package/chunks/ru-WFLK34ZL.js +25 -0
- package/chunks/scheduler-AVYCIBEK.js +8 -0
- package/chunks/send-message-ND2SRKX5.js +8 -0
- package/chunks/shell-GUHQNOMZ.js +3 -0
- package/chunks/{skill-HZPFEAPF.js → skill-AB2X2DTC.js} +1 -1
- package/chunks/src-LZEU4AYF.js +5 -0
- package/chunks/symbol-search-VICSUEZH.js +19 -0
- package/chunks/{syntheticOutput-432LXITX.js → syntheticOutput-Z7DQKMRI.js} +1 -1
- package/chunks/task-create-BQ73FRTH.js +3 -0
- package/chunks/{task-detach-XMSJ3HBM.js → task-detach-JCHSLUOR.js} +1 -1
- package/chunks/task-list-6ESRFO5F.js +9 -0
- package/chunks/{task-stop-NTS62FLG.js → task-stop-74H2CPAJ.js} +1 -1
- package/chunks/{task-update-AR26UFYZ.js → task-update-R3BN6KPQ.js} +1 -1
- package/chunks/{team-create-PYXFVIR5.js → team-create-UTKRPUPZ.js} +3 -3
- package/chunks/team-delete-PCCGTLGL.js +8 -0
- package/chunks/todoWrite-BZI75DFV.js +3 -0
- package/chunks/{tool-search-RKZDSRYS.js → tool-search-FJ5MAPQ6.js} +1 -1
- package/chunks/{web-fetch-VW3SVDQ6.js → web-fetch-DEUGZQZS.js} +17 -17
- package/chunks/{web-search-XQUIZARL.js → web-search-PUUIEFJO.js} +3 -3
- package/chunks/{workflow-YXNXDRWZ.js → workflow-CBADL3IM.js} +2 -2
- package/chunks/write-file-QGCL2AJL.js +15 -0
- package/cli.js +644 -679
- package/examples/starter/README.md +0 -3
- package/locales/ca.js +1 -37
- package/locales/de.js +1 -42
- package/locales/en.js +1 -43
- package/locales/fr.js +1 -39
- package/locales/ja.js +1 -42
- package/locales/pt.js +1 -42
- package/locales/ru.js +1 -42
- package/package.json +2 -2
- package/sandbox-macos-permissive-closed.sb +0 -1
- package/sandbox-macos-permissive-open.sb +0 -1
- package/sandbox-macos-permissive-proxied.sb +1 -2
- package/sandbox-macos-restrictive-closed.sb +14 -2
- package/sandbox-macos-restrictive-open.sb +14 -2
- package/sandbox-macos-restrictive-proxied.sb +15 -3
- package/bundled/mainy/SKILL.md +0 -157
- package/bundled/mainy/docs/_meta.ts +0 -32
- package/bundled/mainy/docs/common-workflow.md +0 -571
- package/bundled/mainy/docs/configuration/_meta.ts +0 -7
- package/bundled/mainy/docs/configuration/auth.md +0 -82
- package/bundled/mainy/docs/configuration/matilda-ignore.md +0 -55
- package/bundled/mainy/docs/configuration/model-providers.md +0 -598
- package/bundled/mainy/docs/configuration/settings.md +0 -790
- package/bundled/mainy/docs/configuration/themes.md +0 -199
- package/bundled/mainy/docs/configuration/trusted-folders.md +0 -67
- package/bundled/mainy/docs/extension/_meta.ts +0 -9
- package/bundled/mainy/docs/extension/extension-releasing.md +0 -204
- package/bundled/mainy/docs/extension/getting-started-extensions.md +0 -299
- package/bundled/mainy/docs/extension/introduction.md +0 -338
- package/bundled/mainy/docs/features/_meta.ts +0 -27
- package/bundled/mainy/docs/features/approval-mode.md +0 -388
- package/bundled/mainy/docs/features/arena.md +0 -219
- package/bundled/mainy/docs/features/auto-mode.md +0 -308
- package/bundled/mainy/docs/features/channels/_meta.ts +0 -8
- package/bundled/mainy/docs/features/channels/dingtalk.md +0 -134
- package/bundled/mainy/docs/features/channels/feishu.md +0 -186
- package/bundled/mainy/docs/features/channels/overview.md +0 -336
- package/bundled/mainy/docs/features/channels/plugins.md +0 -87
- package/bundled/mainy/docs/features/channels/telegram.md +0 -120
- package/bundled/mainy/docs/features/channels/weixin.md +0 -106
- package/bundled/mainy/docs/features/code-review.md +0 -291
- package/bundled/mainy/docs/features/commands.md +0 -528
- package/bundled/mainy/docs/features/dual-output.md +0 -627
- package/bundled/mainy/docs/features/followup-suggestions.md +0 -109
- package/bundled/mainy/docs/features/headless.md +0 -448
- package/bundled/mainy/docs/features/hooks.md +0 -1306
- package/bundled/mainy/docs/features/language.md +0 -171
- package/bundled/mainy/docs/features/lsp.md +0 -496
- package/bundled/mainy/docs/features/markdown-rendering.md +0 -183
- package/bundled/mainy/docs/features/mcp.md +0 -423
- package/bundled/mainy/docs/features/memory.md +0 -185
- package/bundled/mainy/docs/features/sandbox.md +0 -249
- package/bundled/mainy/docs/features/scheduled-tasks.md +0 -139
- package/bundled/mainy/docs/features/skills.md +0 -347
- package/bundled/mainy/docs/features/status-line.md +0 -397
- package/bundled/mainy/docs/features/structured-output.md +0 -309
- package/bundled/mainy/docs/features/sub-agents.md +0 -737
- package/bundled/mainy/docs/features/tips.md +0 -54
- package/bundled/mainy/docs/features/token-caching.md +0 -29
- package/bundled/mainy/docs/features/tool-use-summaries.md +0 -178
- package/bundled/mainy/docs/features/worktree.md +0 -345
- package/bundled/mainy/docs/ide-integration/_meta.ts +0 -4
- package/bundled/mainy/docs/ide-integration/ide-companion-spec.md +0 -182
- package/bundled/mainy/docs/ide-integration/ide-integration.md +0 -144
- package/bundled/mainy/docs/integration-github-action.md +0 -241
- package/bundled/mainy/docs/integration-jetbrains.md +0 -81
- package/bundled/mainy/docs/integration-vscode.md +0 -39
- package/bundled/mainy/docs/integration-zed.md +0 -72
- package/bundled/mainy/docs/matilda-serve-deploy-local.md +0 -221
- package/bundled/mainy/docs/matilda-serve.md +0 -661
- package/bundled/mainy/docs/overview.md +0 -64
- package/bundled/mainy/docs/quickstart.md +0 -234
- package/bundled/mainy/docs/reference/_meta.ts +0 -3
- package/bundled/mainy/docs/reference/keyboard-shortcuts.md +0 -91
- package/bundled/mainy/docs/support/Uninstall.md +0 -65
- package/bundled/mainy/docs/support/_meta.ts +0 -6
- package/bundled/mainy/docs/support/tos-privacy.md +0 -94
- package/bundled/mainy/docs/support/troubleshooting.md +0 -127
- package/chunks/agent-WM63A6NK.js +0 -3
- package/chunks/agent-headless-QIUBDKPW.js +0 -3
- package/chunks/anthropicContentGenerator-VKFTAIU3.js +0 -39
- package/chunks/ca-I2HEEIL7.js +0 -25
- package/chunks/chunk-2HTPVSGT.js +0 -3
- package/chunks/chunk-2MOGYHWM.js +0 -8
- package/chunks/chunk-3IRGBRSP.js +0 -113
- package/chunks/chunk-3YLXGE6T.js +0 -8
- package/chunks/chunk-47XR7IMP.js +0 -8
- package/chunks/chunk-4F4DA5UI.js +0 -8
- package/chunks/chunk-4J6DC24J.js +0 -59
- package/chunks/chunk-4Q2SNBUH.js +0 -18
- package/chunks/chunk-5C2RJ5RR.js +0 -37
- package/chunks/chunk-6E766NPX.js +0 -31
- package/chunks/chunk-6EQMZNIY.js +0 -8
- package/chunks/chunk-6GBNB5Z2.js +0 -3
- package/chunks/chunk-6Z2MV7ZY.js +0 -186
- package/chunks/chunk-BVOCFLC4.js +0 -56
- package/chunks/chunk-CSJTA7NE.js +0 -101
- package/chunks/chunk-DC7LAFZZ.js +0 -8
- package/chunks/chunk-DE3HKC2W.js +0 -9
- package/chunks/chunk-EQGA7LH7.js +0 -30
- package/chunks/chunk-FPO57O66.js +0 -39
- package/chunks/chunk-FWDMPRKU.js +0 -3
- package/chunks/chunk-G7R2XEEF.js +0 -7
- package/chunks/chunk-GOJCMVJJ.js +0 -8
- package/chunks/chunk-GTVCJCHR.js +0 -8
- package/chunks/chunk-JCE3JAVC.js +0 -25
- package/chunks/chunk-JRECUFB3.js +0 -2630
- package/chunks/chunk-KHHJYBR5.js +0 -9
- package/chunks/chunk-LJR4RZZ2.js +0 -3
- package/chunks/chunk-LUNDTQ3G.js +0 -8
- package/chunks/chunk-M53RP3YP.js +0 -31
- package/chunks/chunk-MO2HXJG5.js +0 -9
- package/chunks/chunk-MTMU7JYZ.js +0 -11
- package/chunks/chunk-O44XK65C.js +0 -8
- package/chunks/chunk-OA56BXPD.js +0 -3
- package/chunks/chunk-PA6532AY.js +0 -6
- package/chunks/chunk-PGXQZVLX.js +0 -8
- package/chunks/chunk-QKYGQLWC.js +0 -8
- package/chunks/chunk-QN6Y6NPA.js +0 -3
- package/chunks/chunk-QVCGLQCI.js +0 -32
- package/chunks/chunk-S3CWEVTS.js +0 -15
- package/chunks/chunk-SDTWBD62.js +0 -8
- package/chunks/chunk-T2T2UEPY.js +0 -4
- package/chunks/chunk-TISQNFB5.js +0 -3
- package/chunks/chunk-U347OO7S.js +0 -9
- package/chunks/chunk-UIRBHC5X.js +0 -3
- package/chunks/chunk-VI74YQQO.js +0 -8
- package/chunks/chunk-VYZOOSMP.js +0 -30
- package/chunks/chunk-WC2VTVCE.js +0 -27
- package/chunks/chunk-WVY2P6WH.js +0 -26
- package/chunks/chunk-WZ75OGYY.js +0 -14
- package/chunks/chunk-XMZIY7XX.js +0 -13
- package/chunks/chunk-YJAKOETP.js +0 -22
- package/chunks/chunk-YV3PUOBU.js +0 -65
- package/chunks/contextCommand-DAB3HOHY.js +0 -3
- package/chunks/cron-delete-DE6Q2S2L.js +0 -3
- package/chunks/cron-list-IAQEJVV7.js +0 -5
- package/chunks/de-AQXFJYZI.js +0 -25
- package/chunks/dist-7UYRLSLE.js +0 -3
- package/chunks/dist-ME6647DQ.js +0 -195
- package/chunks/dist-P6SLWL5V.js +0 -42
- package/chunks/dist-VG3ZDJ2A.js +0 -28
- package/chunks/dist-YTCHM57U.js +0 -23
- package/chunks/enterPlanMode-HP35SPLN.js +0 -18
- package/chunks/fileFromPath-7UCWPD4W.js +0 -3
- package/chunks/fr-6TDHK7F2.js +0 -25
- package/chunks/geminiContentGenerator-RJ73DQAP.js +0 -8
- package/chunks/glob-QQ6LGKDX.js +0 -22
- package/chunks/keychain-token-storage-KQK6MNOJ.js +0 -3
- package/chunks/ls-JYJXFSXN.js +0 -15
- package/chunks/matildaAgentContentGenerator-YUYS4336.js +0 -8
- package/chunks/matildaContentGenerator-O4Z2QPCP.js +0 -8
- package/chunks/matildaOAuth2-7COTQQR2.js +0 -3
- package/chunks/mcp-client-RXVQU5VI.js +0 -3
- package/chunks/monitor-77KXDXPR.js +0 -32
- package/chunks/notebook-edit-TKJD2EQZ.js +0 -17
- package/chunks/openaiContentGenerator-2EALAM3U.js +0 -3
- package/chunks/pt-D6L2QTDM.js +0 -25
- package/chunks/read-file-3KUAH6ND.js +0 -3
- package/chunks/ripGrep-U2PLKXMY.js +0 -3
- package/chunks/ru-BNJCHDYO.js +0 -25
- package/chunks/scheduler-J7VU2V5Y.js +0 -8
- package/chunks/send-message-P3SMWNEE.js +0 -8
- package/chunks/serve-FXH6EBQ6.js +0 -1015
- package/chunks/shell-PXR2AXDD.js +0 -3
- package/chunks/src-RFAEPLY7.js +0 -3
- package/chunks/src-WZTRMETQ.js +0 -5
- package/chunks/symbol-search-EAIZPWN7.js +0 -19
- package/chunks/task-create-Z3QRCMX4.js +0 -3
- package/chunks/task-list-GXAJW3JP.js +0 -9
- package/chunks/team-delete-OMYVUAQU.js +0 -8
- package/chunks/todoWrite-5NZ7CHTC.js +0 -3
- package/chunks/write-file-XDDLTGSG.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
|