@wirecat/cli-template 0.15.0 → 0.16.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 (149) hide show
  1. package/.github/workflows/ci.yml +17 -0
  2. package/AGENTS.md +56 -2
  3. package/CHANGELOG.md +36 -0
  4. package/README.md +12 -4
  5. package/biome.json +2 -2
  6. package/contracts/mcp-tools.json +2 -2
  7. package/dist/bin/clidev.js +2 -2
  8. package/dist/bundle/{chunk-LU4A2T7Y.js → all-profiles-FS7AEOE7.js} +8 -5
  9. package/dist/bundle/{anthropic-ICTW7CNQ.js → anthropic-5RN7BGDI.js} +3 -3
  10. package/dist/bundle/{app-server-OW5LT5XV.js → app-server-WGTKZQKJ.js} +28 -29
  11. package/dist/bundle/{bun-sqlite-JE6FJFQT.js → bun-sqlite-WK2IGBGD.js} +2 -2
  12. package/dist/bundle/{chunk-AS2PJNQ2.js → chunk-2MWNE4L3.js} +1 -1
  13. package/dist/bundle/{chunk-2DAXUNTS.js → chunk-5HHIPDNW.js} +1 -1
  14. package/dist/bundle/{chunk-YOJLIVGO.js → chunk-5KAYQKBK.js} +1 -1
  15. package/dist/bundle/{chunk-62JRF2JA.js → chunk-6WOJIAYA.js} +1 -1
  16. package/dist/bundle/chunk-7EUX7AZV.js +141 -0
  17. package/dist/bundle/{chunk-7F5VMLVK.js → chunk-ADFSSIV4.js} +1 -1
  18. package/dist/bundle/{chunk-U6QD3J3F.js → chunk-ATHZEV2Z.js} +2 -2
  19. package/dist/bundle/{chunk-7UPBPE3Z.js → chunk-BPMKAZSS.js} +8 -8
  20. package/dist/bundle/{chunk-DZLHY4IA.js → chunk-C3GNOEJP.js} +1 -1
  21. package/dist/bundle/{chunk-PIJUGF5F.js → chunk-CTBHQRX6.js} +1 -1
  22. package/dist/bundle/{chunk-LFLSV353.js → chunk-DEHBTFIC.js} +1 -1
  23. package/dist/bundle/{chunk-NVNUUHT5.js → chunk-EA3TMI4A.js} +8 -8
  24. package/dist/bundle/{chunk-5GTMQTQH.js → chunk-EILS4BTQ.js} +16 -18
  25. package/dist/bundle/{chunk-EX2FV7YJ.js → chunk-ENDBOYQR.js} +14 -14
  26. package/dist/bundle/{chunk-6AW4DDK4.js → chunk-ETJXPB6A.js} +1 -1
  27. package/dist/bundle/{chunk-LATYBJ4T.js → chunk-FMO6F5Q2.js} +1 -1
  28. package/dist/bundle/{chunk-VVGPAHUN.js → chunk-HTYLT6ME.js} +23 -7
  29. package/dist/bundle/{chunk-F34HGYWF.js → chunk-JFXWLQ2L.js} +1 -1
  30. package/dist/bundle/{chunk-KLFYY7KC.js → chunk-JJZCPBH3.js} +6 -6
  31. package/dist/bundle/{chunk-G7W53MQP.js → chunk-LRHX62ZF.js} +2 -2
  32. package/dist/bundle/{chunk-SOYOOU2D.js → chunk-MBBOINK4.js} +2 -2
  33. package/dist/bundle/{chunk-NRZV7K4M.js → chunk-MEXT6XDP.js} +2 -2
  34. package/dist/bundle/{chunk-R2JKPHH5.js → chunk-NVPWZF67.js} +1 -1
  35. package/dist/bundle/{chunk-45244QQ6.js → chunk-OF56L2JU.js} +2 -2
  36. package/dist/bundle/{chunk-4MU2UM4C.js → chunk-OGTRPW2K.js} +3 -3
  37. package/dist/bundle/{chunk-VXOR76ZL.js → chunk-ORV4EGNC.js} +1 -1
  38. package/dist/bundle/{chunk-TJJ2XSJP.js → chunk-QGOOPPEW.js} +2 -2
  39. package/dist/bundle/{chunk-NH6LZ3H3.js → chunk-RFJKNFVF.js} +3 -3
  40. package/dist/bundle/{chunk-R5RYPD23.js → chunk-RYOAQCVJ.js} +1 -1
  41. package/dist/bundle/{chunk-66VMJGV6.js → chunk-SKBRW5U3.js} +1 -1
  42. package/dist/bundle/{chunk-NG7MOJBT.js → chunk-TXHCL75B.js} +43 -6
  43. package/dist/bundle/{chunk-FC53WQHG.js → chunk-VPCXYY46.js} +1 -1
  44. package/dist/bundle/{chunk-IOJ2DTCY.js → chunk-WDWP5N6M.js} +2 -0
  45. package/dist/bundle/{chunk-NVGOHYTE.js → chunk-WM5AMTRY.js} +4 -4
  46. package/dist/bundle/{chunk-MWUHBEDN.js → chunk-YNROUY3R.js} +10 -10
  47. package/dist/bundle/{chunk-DQIBGCF3.js → chunk-Z5NL6YNU.js} +2 -2
  48. package/dist/bundle/{chunk-GHF72SHT.js → chunk-ZSY4WAGI.js} +28 -21
  49. package/dist/bundle/clidev.js +3 -3
  50. package/dist/bundle/{command-contract-3MPKXBVL.js → command-contract-ZDU73EPH.js} +9 -9
  51. package/dist/bundle/{decode-NXB5UKMO.js → decode-QMLOGZ6R.js} +2 -2
  52. package/dist/bundle/{embed-IKZ24BMC.js → embed-PIR2LJR2.js} +4 -4
  53. package/dist/bundle/{embedder-GMQ24DOQ.js → embedder-6KBRPAEQ.js} +4 -4
  54. package/dist/bundle/{first-run-PURIGDLD.js → first-run-JO3CMY3Z.js} +7 -7
  55. package/dist/bundle/{first-screen-B2CF2CET.js → first-screen-3T5IXTFL.js} +10 -10
  56. package/dist/bundle/{node-sqlite-73Z4SFOA.js → node-sqlite-LIK6OYNF.js} +2 -2
  57. package/dist/bundle/{oauth-EVTPAMZP.js → oauth-7FVF7HQQ.js} +4 -4
  58. package/dist/bundle/{open-46WZAPJ3.js → open-CRZDEATN.js} +2 -2
  59. package/dist/bundle/{openai-GWRDAHDU.js → openai-WAJ6WREQ.js} +11 -32
  60. package/dist/bundle/{program-37NVH5YJ.js → program-ZFFFPBRS.js} +2251 -291
  61. package/dist/bundle/{prompt-IVEYRLS5.js → prompt-QQIVHO3M.js} +3 -3
  62. package/dist/bundle/{recognize-WVEKHODM.js → recognize-4KLBZDEC.js} +2 -2
  63. package/dist/bundle/{remote-4K5VPMC7.js → remote-BABMZTHA.js} +5 -5
  64. package/dist/bundle/{rerank-V24UJZYJ.js → rerank-P3IQQJIL.js} +4 -4
  65. package/dist/bundle/{chunk-EMHCXXNJ.js → serve-25SSAKRZ.js} +6 -4
  66. package/dist/bundle/server-G4GCDMYI.js +52 -0
  67. package/dist/bundle/{chunk-KJ3UADR3.js → server-P4XUYY5A.js} +27 -7
  68. package/dist/bundle/{state-ZPYGECVP.js → state-QCQALQBJ.js} +3 -3
  69. package/dist/bundle/{store-6JQCLPQF.js → store-ZECPRGGH.js} +7 -7
  70. package/dist/bundle/store-maintenance-command-ECUO5G6L.js +42 -0
  71. package/dist/commands/comments.d.ts +3 -0
  72. package/dist/commands/comments.d.ts.map +1 -0
  73. package/dist/commands/comments.js +114 -0
  74. package/dist/commands/comments.js.map +1 -0
  75. package/dist/commands/session.d.ts +3 -0
  76. package/dist/commands/session.d.ts.map +1 -0
  77. package/dist/commands/session.js +96 -0
  78. package/dist/commands/session.js.map +1 -0
  79. package/dist/context.d.ts +83 -0
  80. package/dist/context.d.ts.map +1 -0
  81. package/dist/context.js +58 -0
  82. package/dist/context.js.map +1 -0
  83. package/dist/program.d.ts.map +1 -1
  84. package/dist/program.js +24 -4
  85. package/dist/program.js.map +1 -1
  86. package/dist/sample/comments.d.ts +61 -0
  87. package/dist/sample/comments.d.ts.map +1 -0
  88. package/dist/sample/comments.js +39 -0
  89. package/dist/sample/comments.js.map +1 -0
  90. package/dist/sample/transport.d.ts +42 -0
  91. package/dist/sample/transport.d.ts.map +1 -0
  92. package/dist/sample/transport.js +152 -0
  93. package/dist/sample/transport.js.map +1 -0
  94. package/dist/token.d.ts +16 -0
  95. package/dist/token.d.ts.map +1 -0
  96. package/dist/token.js +32 -0
  97. package/dist/token.js.map +1 -0
  98. package/dist/version.d.ts +1 -1
  99. package/dist/version.js +1 -1
  100. package/docs/commands.md +234 -12
  101. package/docs/configuration.md +1 -1
  102. package/docs/dev/reference-clis.md +3 -2
  103. package/docs/dev/test-matrix.md +36 -5
  104. package/docs/index.md +4 -3
  105. package/docs/security.md +4 -2
  106. package/kit/dist/new.js +6 -3
  107. package/lint/overrides.json +9 -1
  108. package/package.json +3 -4
  109. package/scripts/test-matrix-untested.ts +19 -0
  110. package/skills/clidev-cli/SKILL.md +1 -1
  111. package/src/commands/comments.ts +167 -0
  112. package/src/commands/session.ts +144 -0
  113. package/src/comments.test.ts +258 -0
  114. package/src/context.ts +78 -0
  115. package/src/mcp.test.ts +71 -76
  116. package/src/program.test.ts +9 -16
  117. package/src/program.ts +28 -4
  118. package/src/sample/comments.ts +51 -0
  119. package/src/sample/transport.test.ts +117 -0
  120. package/src/sample/transport.ts +184 -0
  121. package/src/testing/fake-comments.ts +167 -0
  122. package/src/testing/harness.ts +51 -0
  123. package/src/token.ts +42 -0
  124. package/src/version.ts +1 -1
  125. package/dist/bundle/all-profiles-NVB2HT2S.js +0 -24
  126. package/dist/bundle/chunk-GUFPQZUA.js +0 -48
  127. package/dist/bundle/chunk-NL2DQPT7.js +0 -2
  128. package/dist/bundle/mcp-ASNYBQ5B.js +0 -152
  129. package/dist/bundle/mcp-EY2NUYDQ.js +0 -82
  130. package/dist/bundle/serve-PJWSOV7F.js +0 -19
  131. package/dist/bundle/server-3TPCEZ6P.js +0 -40
  132. package/dist/bundle/server-GQX5MZTT.js +0 -53
  133. package/dist/bundle/store-maintenance-command-ND4ADMGC.js +0 -42
  134. package/dist/commands/doctor.d.ts +0 -77
  135. package/dist/commands/doctor.d.ts.map +0 -1
  136. package/dist/commands/doctor.js +0 -74
  137. package/dist/commands/doctor.js.map +0 -1
  138. package/dist/commands/mcp.d.ts +0 -3
  139. package/dist/commands/mcp.d.ts.map +0 -1
  140. package/dist/commands/mcp.js +0 -97
  141. package/dist/commands/mcp.js.map +0 -1
  142. package/dist/mcp.d.ts +0 -29
  143. package/dist/mcp.d.ts.map +0 -1
  144. package/dist/mcp.js +0 -98
  145. package/dist/mcp.js.map +0 -1
  146. package/src/commands/doctor.ts +0 -86
  147. package/src/commands/mcp.ts +0 -130
  148. package/src/mcp-http.test.ts +0 -172
  149. package/src/mcp.ts +0 -140
package/docs/commands.md CHANGED
@@ -53,15 +53,165 @@ clidev commands info [path]
53
53
 
54
54
  **Example:** `clidev commands info commands`
55
55
 
56
+ ## `clidev session`
57
+
58
+ keep this profile's Example Comments token in the OS keyring
59
+
60
+ ### `clidev session start`
61
+
62
+ sign this profile in: the Example Comments API token is asked hidden or read from stdin, never taken as an argument, checked against the service, and only then kept in the keyring, or in a private file
63
+
64
+ **Changes something on this computer only.**
65
+
66
+ ```sh
67
+ clidev session start [options]
68
+ ```
69
+
70
+ | Option | What it does |
71
+ |---|---|
72
+ | `--credential-storage <storage>` | where the token is kept: keyring, which falls back to a private file by itself, or file. Default: `keyring`. |
73
+
74
+ **Returns:** sign in to Example Comments with an API token
75
+
76
+ **Example:** `clidev personal session start`, `clidev personal session start --credential-storage file`
77
+
78
+ ### `clidev session status`
79
+
80
+ show where this profile's token comes from: CLIDEV_TOKEN, the keyring or a file, never the token; --check asks Example Comments whose token it is
81
+
82
+ ```sh
83
+ clidev session status [options]
84
+ ```
85
+
86
+ | Option | What it does |
87
+ |---|---|
88
+ | `--check` | ask Example Comments whether the token still works, and whose it is. |
89
+
90
+ **Returns:** show where this profile's token comes from; never the token
91
+
92
+ **Example:** `clidev personal session status`, `clidev personal session status --check --json`
93
+
94
+ ### `clidev session end`
95
+
96
+ forget this profile's token on this computer; the token itself stays valid in Example Comments
97
+
98
+ **Changes something on this computer only.**
99
+
100
+ ```sh
101
+ clidev session end
102
+ ```
103
+
104
+ **Returns:** forget this profile's token on this computer
105
+
106
+ **Example:** `clidev personal session end`
107
+
108
+ ### `clidev session list`
109
+
110
+ list the profiles on this computer and whether each has a token; picks none
111
+
112
+ ```sh
113
+ clidev session list
114
+ ```
115
+
116
+ **Returns:** list the profiles here and whether each is signed in
117
+
118
+ **Example:** `clidev session list`, `clidev session list --json`
119
+
120
+ ## `clidev comments`
121
+
122
+ read and write comments in Example Comments, the sample service
123
+
124
+ ### `clidev comments list`
125
+
126
+ list the comments in Example Comments, newest first
127
+
128
+ ```sh
129
+ clidev comments list [query] [options]
130
+ ```
131
+
132
+ | Argument | | What it is |
133
+ |---|---|---|
134
+ | `query` | optional | field:value terms that narrow the list — the fields are below. |
135
+
136
+ | Option | What it does |
137
+ |---|---|
138
+ | `--limit <n>` | how many to show. |
139
+ | `--page <n>` | which page, starting at 1. |
140
+ | `--all` | every row, no paging. |
141
+
142
+ **Returns:** comment — id, text, author, created_at; every field: clidev commands info comments list
143
+
144
+ **Example:** `clidev personal comments list`, `clidev personal comments list author:u2 --json=id,text`
145
+
146
+ ### `clidev comments show`
147
+
148
+ show one comment in Example Comments
149
+
150
+ ```sh
151
+ clidev comments show <id>
152
+ ```
153
+
154
+ | Argument | | What it is |
155
+ |---|---|---|
156
+ | `id` | required | the comment's id, as list prints it. |
157
+
158
+ **Returns:** comment — id, text, author, created_at; every field: clidev commands info comments show
159
+
160
+ **Example:** `clidev personal comments show c1`, `clidev personal comments show c1 --json`
161
+
162
+ ### `clidev comments create`
163
+
164
+ post a comment in Example Comments
165
+
166
+ **Changes something in the service.**
167
+
168
+ ```sh
169
+ clidev comments create [options]
170
+ ```
171
+
172
+ | Option | What it does |
173
+ |---|---|
174
+ | `--text <text>` | the comment's text. |
175
+
176
+ **Returns:** post a comment in Example Comments
177
+
178
+ **Example:** `clidev personal comments create --text "Looks good to me"`, `clidev personal comments create --text "Looks good to me" --dry-run`
179
+
180
+ ### `clidev comments update`
181
+
182
+ change the text of your comment in Example Comments
183
+
184
+ **Changes something in the service.**
185
+
186
+ ```sh
187
+ clidev comments update <id> [options]
188
+ ```
189
+
190
+ | Argument | | What it is |
191
+ |---|---|---|
192
+ | `id` | required | the comment's id, as list prints it. |
193
+
194
+ | Option | What it does |
195
+ |---|---|
196
+ | `--text <text>` | the new text. |
197
+
198
+ **Returns:** change the text of your comment in Example Comments
199
+
200
+ **Example:** `clidev personal comments update c1 --text "Looks good now"`
201
+
56
202
  ## `clidev doctor`
57
203
 
58
- check this installation: version, paths, config, profiles; no keyring or network
204
+ the state this installation is in, without connecting unless --online
59
205
 
60
206
  ```sh
61
- clidev doctor
207
+ clidev doctor [options]
62
208
  ```
63
209
 
64
- **Returns:** check this installation: version, paths, config, profiles; no keyring or network
210
+ | Option | What it does |
211
+ |---|---|
212
+ | `--online` | also connect once and read the account; sends nothing. |
213
+
214
+ **Returns:** the state this installation is in, without connecting unless --online
65
215
 
66
216
  **Example:** `clidev doctor`, `clidev doctor --json`
67
217
 
@@ -117,11 +267,11 @@ clidev skill status
117
267
 
118
268
  ## `clidev mcp`
119
269
 
120
- serve this profile's commands to an agent over MCP — `claude mcp add clidev -- clidev personal mcp serve`
270
+ serve this profile to an agent over MCP and set it up — `claude mcp add clidev -- clidev <profile> mcp serve`
121
271
 
122
272
  ### `clidev mcp serve`
123
273
 
124
- serve this profile's commands to an agent over MCP, on stdin and stdout, writes included; the profile's permissions decide — `claude mcp add clidev -- clidev personal mcp serve`
274
+ serve this profile to an agent over MCP, on stdin and stdout — `claude mcp add clidev -- clidev <profile> mcp serve`; `clidev mcp serve --profiles a,b` or `--profiles all` serves those profiles from one server and each tool asks which
125
275
 
126
276
  **Changes something in the service.**
127
277
 
@@ -131,27 +281,33 @@ clidev mcp serve [options]
131
281
 
132
282
  | Option | What it does |
133
283
  |---|---|
284
+ | `--permission <key=level>` | make a permission stricter for this server only, like comments.create=deny; it never loosens the profile; repeat for more keys. |
285
+ | `--profiles <names\|all>` | serve several profiles from one server instead of one: names, comma-separated, or all for every profile. |
134
286
  | `--http` | serve over HTTP on 127.0.0.1 for ChatGPT and Claude in the browser, behind your tunnel; the profile's permissions decide. |
135
287
  | `--port <port>` | the local port for --http (default 8765). |
136
- | `--public-url <url>` | the tunnel's https address the browser apps use, e.g. https://<name>.ts.net. |
288
+ | `--public-url <url>` | the tunnel's https address the browser apps use, e.g. https://<name>.ts.net or https://<name>.ts.net/tg. |
137
289
 
138
290
  **Returns:** serve this profile's commands to an AI agent
139
291
 
140
- **Example:** `clidev personal mcp serve`, `clidev personal mcp serve --http --public-url https://laptop.example.ts.net`
292
+ **Example:** `clidev personal mcp serve`, `clidev mcp serve --profiles work,personal`, `clidev personal mcp serve --http --public-url https://laptop.example.ts.net`
141
293
 
142
294
  ### `clidev mcp revoke`
143
295
 
144
- forget every login `mcp serve --http` gave a browser app; each must log in again
296
+ forget every login `mcp serve --http` gave a browser app, of this profile or of the server `--profiles` names; each app must log in again
145
297
 
146
298
  **Changes something on this computer only.**
147
299
 
148
300
  ```sh
149
- clidev mcp revoke
301
+ clidev mcp revoke [options]
150
302
  ```
151
303
 
304
+ | Option | What it does |
305
+ |---|---|
306
+ | `--profiles <names\|all>` | serve several profiles from one server instead of one: names, comma-separated, or all for every profile. |
307
+
152
308
  **Returns:** forget every login given to a browser app
153
309
 
154
- **Example:** `clidev personal mcp revoke`
310
+ **Example:** `clidev personal mcp revoke`, `clidev mcp revoke --profiles all`
155
311
 
156
312
  ### `clidev mcp server`
157
313
 
@@ -171,6 +327,8 @@ clidev mcp server start [options]
171
327
  |---|---|
172
328
  | `--port <port>` | the local port (default 8765). |
173
329
  | `--public-url <url>` | the tunnel's https address the browser apps use, e.g. https://<name>.ts.net or https://<name>.ts.net/tg. |
330
+ | `--permission <key=level>` | make a permission stricter for this server only; repeat for more keys. |
331
+ | `--profiles <names\|all>` | the server of several profiles that `mcp serve --profiles` serves: names, comma-separated, or all. |
174
332
 
175
333
  **Returns:** start the HTTP MCP server in the background
176
334
 
@@ -183,9 +341,13 @@ stop `mcp serve --http` — only one that `mcp server start` started
183
341
  **Changes something on this computer only.**
184
342
 
185
343
  ```sh
186
- clidev mcp server stop
344
+ clidev mcp server stop [options]
187
345
  ```
188
346
 
347
+ | Option | What it does |
348
+ |---|---|
349
+ | `--profiles <names\|all>` | the server of several profiles that `mcp serve --profiles` serves: names, comma-separated, or all. |
350
+
189
351
  **Returns:** stop the background HTTP MCP server
190
352
 
191
353
  **Example:** `clidev personal mcp server stop`
@@ -195,13 +357,73 @@ clidev mcp server stop
195
357
  whether `mcp serve --http` runs, on which port and address, the login code for a new browser app, and the apps logged in
196
358
 
197
359
  ```sh
198
- clidev mcp server status
360
+ clidev mcp server status [options]
199
361
  ```
200
362
 
363
+ | Option | What it does |
364
+ |---|---|
365
+ | `--profiles <names\|all>` | the server of several profiles that `mcp serve --profiles` serves: names, comma-separated, or all. |
366
+
201
367
  **Returns:** whether the HTTP MCP server runs, its login code and the apps logged in
202
368
 
203
369
  **Example:** `clidev personal mcp server status --json`
204
370
 
371
+ ### `clidev mcp config`
372
+
373
+ print the mcpServers entry for Claude Desktop, Cursor and others, with full paths; writes nothing
374
+
375
+ ```sh
376
+ clidev mcp config [options]
377
+ ```
378
+
379
+ | Option | What it does |
380
+ |---|---|
381
+ | `--permission <key=level>` | make a permission stricter for this server only, like comments.create=deny; it never loosens the profile; repeat for more keys. |
382
+ | `--profiles <names\|all>` | serve several profiles from one server instead of one: names, comma-separated, or all for every profile. |
383
+
384
+ **Returns:** print the local MCP configuration of this profile, or of those --profiles names
385
+
386
+ **Example:** `clidev personal mcp config`, `clidev mcp config --profiles all`
387
+
388
+ ### `clidev mcp add`
389
+
390
+ add this profile's local MCP server to Codex or Claude Code
391
+
392
+ **Changes something on this computer only.**
393
+
394
+ ```sh
395
+ clidev mcp add <client> [options]
396
+ ```
397
+
398
+ | Argument | | What it is |
399
+ |---|---|---|
400
+ | `client` | required | codex or claude-code. |
401
+
402
+ | Option | What it does |
403
+ |---|---|
404
+ | `--allow-writes` | acknowledge that this profile offers writing tools. |
405
+ | `--permission <key=level>` | make a permission stricter for this server only, like comments.create=deny; it never loosens the profile; repeat for more keys. |
406
+
407
+ **Returns:** add this profile's local MCP server to Codex or Claude Code
408
+
409
+ **Example:** `clidev personal mcp add codex --allow-writes`
410
+
411
+ ### `clidev mcp check`
412
+
413
+ check this profile's local MCP handshake and tool list
414
+
415
+ ```sh
416
+ clidev mcp check [options]
417
+ ```
418
+
419
+ | Option | What it does |
420
+ |---|---|
421
+ | `--permission <key=level>` | make a permission stricter for this server only, like comments.create=deny; it never loosens the profile; repeat for more keys. |
422
+
423
+ **Returns:** check this profile's local MCP handshake and tool list
424
+
425
+ **Example:** `clidev personal mcp check`
426
+
205
427
  ## `clidev upgrade`
206
428
 
207
429
  upgrade clidev with the package manager that installed it; --check only looks
@@ -21,6 +21,6 @@ the permissions say.
21
21
 
22
22
  A command that fails is kept as a run, for `clidev runs list` and `runs show`. A command you add that does its work
23
23
  in `context.run` is kept when it succeeds too, unless `record` is `false` (then only failures) or it ran with
24
- `--no-record`. The skeleton's own commands only read local files and open no run. `record_input` decides whether a run
24
+ `--no-record`. `comments` and `session status --check` do their work in a run, so `--record` keeps them. `record_input` decides whether a run
25
25
  keeps the words you typed; it is `true` unless you set it to `false`. Secrets are masked either way; see
26
26
  [Security](security.md).
@@ -1,7 +1,8 @@
1
1
  # Reference CLIs
2
2
 
3
- The template has no sample code. The agent that builds a new CLI learns from the WireCat CLI closest to it, picked by
4
- the first question of the [design interview](skills/design-interview/SKILL.md):
3
+ How a command reaches a service, signs in, writes and is tested, the agent learns from the template's sample (see
4
+ "The sample" in `AGENTS.md`). The domain, the store and its commands it learns from the WireCat CLI closest to it,
5
+ picked by the first question of the [design interview](skills/design-interview/SKILL.md):
5
6
 
6
7
  | Category | Learn from |
7
8
  | --- | --- |
@@ -7,28 +7,59 @@ ran it · ⛔ not tested offline, with the reason and where it is checked instea
7
7
  Measured from the test run (`coverage/argv.jsonl`), not searched for — see
8
8
  [TESTING.md](TESTING.md) for how, and for the states and failures that cut across commands.
9
9
 
10
- **54 ✅ · 6 ⛔ · 0 ❌** — 21 commands, 39 options.
10
+ **71 ✅ · 20 ⛔ · 0 ❌** — 32 commands, 59 options.
11
11
 
12
12
  | Command | Option | | Note |
13
13
  |---|---|---|---|
14
14
  | `commands` | | ✅ | |
15
15
  | `commands info` | | ✅ | |
16
+ | `session start` | | ✅ | |
17
+ | `session start` | `--credential-storage` | ✅ | |
18
+ | `session status` | | ✅ | |
19
+ | `session status` | `--check` | ✅ | |
20
+ | `session end` | | ✅ | |
21
+ | `session list` | | ✅ | |
22
+ | `comments list` | | ✅ | |
23
+ | `comments list` | `--limit` | ✅ | |
24
+ | `comments list` | `--page` | ✅ | |
25
+ | `comments list` | `--all` | ✅ | |
26
+ | `comments show` | | ✅ | |
27
+ | `comments create` | | ✅ | |
28
+ | `comments create` | `--text` | ✅ | |
29
+ | `comments update` | | ✅ | |
30
+ | `comments update` | `--text` | ✅ | |
16
31
  | `doctor` | | ✅ | |
32
+ | `doctor` | `--online` | ✅ | |
17
33
  | `skill show` | | ✅ | |
18
34
  | `skill show` | `--for` | ✅ | |
19
35
  | `skill install` | | ✅ | |
20
36
  | `skill install` | `--for` | ✅ | |
21
37
  | `skill status` | | ✅ | |
22
38
  | `mcp serve` | | ✅ | |
23
- | `mcp serve` | `--http` | ✅ | |
24
- | `mcp serve` | `--port` | ✅ | |
25
- | `mcp serve` | `--public-url` | ✅ | |
39
+ | `mcp serve` | `--permission` | ✅ | |
40
+ | `mcp serve` | `--profiles` | ✅ | |
41
+ | `mcp serve` | `--http` | ⛔ | starts an HTTP server or a background process that runs until stopped; cli-core's appMcpCommand; its app-mcp-command and mcp-server-command tests drive it, and src/mcp.test.ts runs this CLI's own server, config, revoke and refusals |
42
+ | `mcp serve` | `--port` | ⛔ | starts an HTTP server or a background process that runs until stopped; cli-core's appMcpCommand; its app-mcp-command and mcp-server-command tests drive it, and src/mcp.test.ts runs this CLI's own server, config, revoke and refusals |
43
+ | `mcp serve` | `--public-url` | ⛔ | starts an HTTP server or a background process that runs until stopped; cli-core's appMcpCommand; its app-mcp-command and mcp-server-command tests drive it, and src/mcp.test.ts runs this CLI's own server, config, revoke and refusals |
26
44
  | `mcp revoke` | | ✅ | |
45
+ | `mcp revoke` | `--profiles` | ⛔ | cli-core's appMcpCommand; its app-mcp-command and mcp-server-command tests drive it, and src/mcp.test.ts runs this CLI's own server, config, revoke and refusals |
27
46
  | `mcp server start` | | ⛔ | starts a detached `mcp serve --http` from the built entry; cli-core tests mcpServerCommand, and the background run was checked by hand against dist/ |
28
47
  | `mcp server start` | `--port` | ⛔ | starts a detached `mcp serve --http` from the built entry; cli-core tests mcpServerCommand, and the background run was checked by hand against dist/ |
29
48
  | `mcp server start` | `--public-url` | ⛔ | starts a detached `mcp serve --http` from the built entry; cli-core tests mcpServerCommand, and the background run was checked by hand against dist/ |
49
+ | `mcp server start` | `--permission` | ⛔ | starts a detached `mcp serve --http` from the built entry; cli-core tests mcpServerCommand, and the background run was checked by hand against dist/ |
50
+ | `mcp server start` | `--profiles` | ⛔ | starts a detached `mcp serve --http` from the built entry; cli-core tests mcpServerCommand, and the background run was checked by hand against dist/ |
30
51
  | `mcp server stop` | | ⛔ | stops the detached server that `mcp server start` wrote a pid file for; cli-core tests mcpServerCommand, and no live scenario starts a server to stop |
31
- | `mcp server status` | | ✅ | |
52
+ | `mcp server stop` | `--profiles` | ⛔ | stops the detached server that `mcp server start` wrote a pid file for; cli-core tests mcpServerCommand, and no live scenario starts a server to stop |
53
+ | `mcp server status` | | ⛔ | starts an HTTP server or a background process that runs until stopped; cli-core's appMcpCommand; its app-mcp-command and mcp-server-command tests drive it, and src/mcp.test.ts runs this CLI's own server, config, revoke and refusals |
54
+ | `mcp server status` | `--profiles` | ⛔ | starts an HTTP server or a background process that runs until stopped; cli-core's appMcpCommand; its app-mcp-command and mcp-server-command tests drive it, and src/mcp.test.ts runs this CLI's own server, config, revoke and refusals |
55
+ | `mcp config` | | ✅ | |
56
+ | `mcp config` | `--permission` | ✅ | |
57
+ | `mcp config` | `--profiles` | ✅ | |
58
+ | `mcp add` | | ⛔ | writes Codex's or Claude Code's own MCP settings; cli-core's appMcpCommand; its app-mcp-command and mcp-server-command tests drive it, and src/mcp.test.ts runs this CLI's own server, config, revoke and refusals |
59
+ | `mcp add` | `--allow-writes` | ⛔ | writes Codex's or Claude Code's own MCP settings; cli-core's appMcpCommand; its app-mcp-command and mcp-server-command tests drive it, and src/mcp.test.ts runs this CLI's own server, config, revoke and refusals |
60
+ | `mcp add` | `--permission` | ⛔ | writes Codex's or Claude Code's own MCP settings; cli-core's appMcpCommand; its app-mcp-command and mcp-server-command tests drive it, and src/mcp.test.ts runs this CLI's own server, config, revoke and refusals |
61
+ | `mcp check` | | ⛔ | starts the installed CLI as a child process, as the agent would; cli-core's appMcpCommand; its app-mcp-command and mcp-server-command tests drive it, and src/mcp.test.ts runs this CLI's own server, config, revoke and refusals |
62
+ | `mcp check` | `--permission` | ⛔ | starts the installed CLI as a child process, as the agent would; cli-core's appMcpCommand; its app-mcp-command and mcp-server-command tests drive it, and src/mcp.test.ts runs this CLI's own server, config, revoke and refusals |
32
63
  | `upgrade` | | ✅ | |
33
64
  | `upgrade` | `--check` | ✅ | |
34
65
  | `config show` | | ✅ | |
package/docs/index.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # clidev
2
2
 
3
- `clidev` is a WireCat command-line tool for the terminal, for scripts and for AI agents. It does not connect to a
4
- service yet.
3
+ `clidev` is a WireCat command-line tool for the terminal, for scripts and for AI agents. Its one service is a sample,
4
+ Example Comments, made up to show how a command reaches a service; its address never resolves.
5
5
 
6
- It has the commands every WireCat CLI shares: `doctor`, `commands`, `config`, `skill`, `mcp`, `runs` and `upgrade`.
6
+ It has the commands every WireCat CLI shares: `doctor`, `commands`, `config`, `skill`, `mcp`, `runs` and `upgrade`,
7
+ and the sample's `session` and `comments`.
7
8
  Start with [installation](installation.md), then [usage](usage.md).
package/docs/security.md CHANGED
@@ -3,8 +3,10 @@
3
3
  What WireCat CLIs share — the keyring, permissions, MCP and what never reaches a log — is on the
4
4
  [shared security page](https://wirecat.dev/en/docs/security). This page keeps only what is particular to `clidev`.
5
5
 
6
- `clidev` keeps its settings in `config.json` and its state in the folders `clidev doctor` shows. It sends nothing
7
- to any service yet.
6
+ `clidev` keeps its settings in `config.json` and its state in the folders `clidev doctor` shows. Its one service is
7
+ the sample, Example Comments, whose address never resolves. `session start` keeps the service's token in the OS
8
+ keyring, or in a private file where no keyring works; the token goes only into the request's Authorization header,
9
+ never into an address, an answer, a run record or the send journal.
8
10
 
9
11
  `clidev personal mcp serve --http` listens on `127.0.0.1` only, for browser apps that reach it through your own
10
12
  tunnel. Each app logs in with a one-time code, and the server keeps a hash of each login it gives, in the state
package/kit/dist/new.js CHANGED
@@ -113,12 +113,14 @@ export const designDoc = (names, answers) => {
113
113
  "Delete this section once every step is done (WC-DOC-3).",
114
114
  "",
115
115
  "1. If an answer below is missing, ask the owner the [design interview](skills/design-interview/SKILL.md).",
116
- "2. Learn from the reference CLI below: its provider, its store and its commands.",
116
+ '2. Learn how a command reaches a service from the sample (`AGENTS.md`, "The sample"), and the domain, the',
117
+ " store and its commands from the reference CLI below. Build the first command on the sample.",
117
118
  "3. Ask the further questions in the interview that the reference CLI does not answer, and write the answers here.",
118
119
  " Build only after the owner has read this page.",
119
120
  "4. When the first command reaches the service, rewrite `README.md`, `docs/index.md` and the description in",
120
- ` \`package.json\` and \`skills/${names.name}/SKILL.md\` to say what the tool does and who it is for. Rewrite the`,
121
- " MCP server's instructions in `src/mcp.ts` too: name the kinds of outside text the CLI carries (WC-MCP-11).",
121
+ ` \`package.json\` and \`skills/${names.name}/SKILL.md\` to say what the tool does and who it is for. Rewrite`,
122
+ " `appMcpCommand`'s `name` and `untrusted` in `src/program.ts` too: name the kinds of outside text the CLI",
123
+ " carries (WC-MCP-11).",
122
124
  "",
123
125
  "## Answers",
124
126
  "",
@@ -298,6 +300,7 @@ export const runNew = async (cwd, source, args, io) => {
298
300
  "Next:",
299
301
  ` cd ${names.name}`,
300
302
  " pnpm install",
303
+ " pnpm lint:fix",
301
304
  " pnpm ci:quick",
302
305
  " git add -A",
303
306
  ' git commit -m "chore: start from @wirecat/cli-template"',
@@ -1 +1,9 @@
1
- []
1
+ [
2
+ {
3
+ "rule": "list-without-query",
4
+ "target": "session list",
5
+ "reason": "Lists the few profiles on this computer, every one at once by design (WC-ACCT-12), as gcal-cli's session list does; a filter would let a caller narrow it to one and read that as the only profile.",
6
+ "owner": "@WireCatLabs",
7
+ "review_after": "2027-05-06"
8
+ }
9
+ ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecat/cli-template",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "Start a new WireCat CLI: a working skeleton on cli-base and cli-core, copied by new and kept current by upgrade",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Viacheslav Ptsarev",
@@ -86,17 +86,16 @@
86
86
  "kit:docs": "cspell lint --config cspell.json --no-progress --no-summary kit/*.md && rumdl check --config config/wirecat/rumdl.toml kit/*.md"
87
87
  },
88
88
  "dependencies": {
89
- "@modelcontextprotocol/server": "2.4.0",
90
89
  "@wirecat/cli-base": "0.77.1",
91
90
  "@wirecat/cli-core": "0.584.0",
92
- "commander": "15.0.0"
91
+ "commander": "15.0.0",
92
+ "valibot": "1.5.0"
93
93
  },
94
94
  "devDependencies": {
95
95
  "@biomejs/biome": "2.6.3",
96
96
  "@cspell/dict-en-gb": "5.0.38",
97
97
  "@cspell/dict-es-es": "3.0.9",
98
98
  "@cspell/dict-ru_ru": "2.3.4",
99
- "@modelcontextprotocol/client": "2.4.0",
100
99
  "@types/node": "22.20.5",
101
100
  "@vitest/coverage-v8": "5.0.5",
102
101
  "@wirecat/cli-testing": "0.5.3",
@@ -1,3 +1,8 @@
1
+ const SHARED_MCP =
2
+ "cli-core's appMcpCommand; its app-mcp-command and mcp-server-command tests drive it, and src/mcp.test.ts runs " +
3
+ "this CLI's own server, config, revoke and refusals"
4
+ const LONG_RUNNING = `starts an HTTP server or a background process that runs until stopped; ${SHARED_MCP}`
5
+
1
6
  export const UNTESTED: { command: string; option?: string; reason: string }[] = [
2
7
  {
3
8
  command: "",
@@ -31,4 +36,18 @@ export const UNTESTED: { command: string; option?: string; reason: string }[] =
31
36
  reason:
32
37
  "stops the detached server that `mcp server start` wrote a pid file for; cli-core tests mcpServerCommand, and no live scenario starts a server to stop",
33
38
  },
39
+ ...["--http", "--port", "--public-url"].map((option) => ({ command: "mcp serve", option, reason: LONG_RUNNING })),
40
+ { command: "mcp server status", reason: LONG_RUNNING },
41
+ { command: "mcp server status", option: "--profiles", reason: LONG_RUNNING },
42
+ { command: "mcp revoke", option: "--profiles", reason: SHARED_MCP },
43
+ ...[undefined, "--allow-writes", "--permission"].map((option) => ({
44
+ command: "mcp add",
45
+ ...(option ? { option } : {}),
46
+ reason: `writes Codex's or Claude Code's own MCP settings; ${SHARED_MCP}`,
47
+ })),
48
+ ...[undefined, "--permission"].map((option) => ({
49
+ command: "mcp check",
50
+ ...(option ? { option } : {}),
51
+ reason: `starts the installed CLI as a child process, as the agent would; ${SHARED_MCP}`,
52
+ })),
34
53
  ]
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: clidev-cli
3
- description: Use clidev, a WireCat CLI started from cli-template, from an agent — find a command, run it with the owner's profile, read JSON answers. Use when a task needs clidev. It does not connect to a service yet.
3
+ description: Use clidev, a WireCat CLI started from cli-template, from an agent — find a command, run it with the owner's profile, read JSON answers. Use when a task needs clidev. Its one service is a made-up sample, Example Comments.
4
4
  metadata:
5
5
  openclaw:
6
6
  requires: