@outfitter/cli 0.3.0 → 0.4.1

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 (269) hide show
  1. package/README.md +48 -4
  2. package/dist/actions.js +0 -2
  3. package/dist/cli.d.ts +1 -1
  4. package/dist/cli.js +1 -2
  5. package/dist/{render → colors}/colors.d.ts +1 -1
  6. package/dist/{render → colors}/colors.js +2 -6
  7. package/dist/colors/index.d.ts +1 -1
  8. package/dist/colors/index.js +3 -4
  9. package/dist/command.d.ts +2 -2
  10. package/dist/command.js +11 -2
  11. package/dist/completion.d.ts +36 -0
  12. package/dist/completion.js +91 -0
  13. package/dist/flags.d.ts +167 -0
  14. package/dist/flags.js +31 -0
  15. package/dist/index.d.ts +4 -4
  16. package/dist/index.js +5 -4
  17. package/dist/input.d.ts +3 -26
  18. package/dist/input.js +1 -31
  19. package/dist/output.d.ts +2 -2
  20. package/dist/output.js +0 -1
  21. package/dist/pagination.d.ts +1 -1
  22. package/dist/pagination.js +0 -2
  23. package/dist/query.d.ts +50 -0
  24. package/dist/query.js +51 -0
  25. package/dist/shared/@outfitter/cli-b2zk8fb3.js +357 -0
  26. package/dist/shared/@outfitter/{cli-d9ad0rqj.js → cli-jbj78ac5.js} +1 -6
  27. package/dist/shared/@outfitter/{cli-e6yv2764.d.ts → cli-k0yvzn6d.d.ts} +1 -1
  28. package/dist/shared/@outfitter/{cli-ttt7r0j7.d.ts → cli-md9347gn.d.ts} +155 -13
  29. package/dist/shared/@outfitter/{cli-5g6rkv3d.js → cli-rk9zagkm.js} +24 -32
  30. package/dist/shared/@outfitter/{cli-4h4rpdra.js → cli-zahqsaby.js} +32 -10
  31. package/dist/terminal/detection.js +1 -5
  32. package/dist/terminal/index.js +1 -6
  33. package/dist/{shared/@outfitter/cli-4cb5g831.d.ts → text.d.ts} +1 -1
  34. package/dist/{shared/@outfitter/cli-mwxsh3sr.js → text.js} +15 -14
  35. package/dist/types.d.ts +2 -2
  36. package/dist/types.js +0 -2
  37. package/dist/verbs.d.ts +50 -0
  38. package/dist/verbs.js +61 -0
  39. package/package.json +50 -204
  40. package/dist/borders/index.d.ts +0 -3
  41. package/dist/borders/index.js +0 -13
  42. package/dist/box/index.d.ts +0 -4
  43. package/dist/box/index.js +0 -13
  44. package/dist/demo/index.d.ts +0 -78
  45. package/dist/demo/index.js +0 -148
  46. package/dist/demo/registry.d.ts +0 -7
  47. package/dist/demo/registry.js +0 -28
  48. package/dist/demo/renderers/borders.d.ts +0 -7
  49. package/dist/demo/renderers/borders.js +0 -17
  50. package/dist/demo/renderers/box.d.ts +0 -7
  51. package/dist/demo/renderers/box.js +0 -18
  52. package/dist/demo/renderers/colors.d.ts +0 -7
  53. package/dist/demo/renderers/colors.js +0 -18
  54. package/dist/demo/renderers/indicators.d.ts +0 -7
  55. package/dist/demo/renderers/indicators.js +0 -17
  56. package/dist/demo/renderers/list.d.ts +0 -7
  57. package/dist/demo/renderers/list.js +0 -19
  58. package/dist/demo/renderers/markdown.d.ts +0 -7
  59. package/dist/demo/renderers/markdown.js +0 -18
  60. package/dist/demo/renderers/progress.d.ts +0 -7
  61. package/dist/demo/renderers/progress.js +0 -17
  62. package/dist/demo/renderers/spinner.d.ts +0 -7
  63. package/dist/demo/renderers/spinner.js +0 -19
  64. package/dist/demo/renderers/table.d.ts +0 -7
  65. package/dist/demo/renderers/table.js +0 -19
  66. package/dist/demo/renderers/text.d.ts +0 -7
  67. package/dist/demo/renderers/text.js +0 -16
  68. package/dist/demo/renderers/tree.d.ts +0 -7
  69. package/dist/demo/renderers/tree.js +0 -18
  70. package/dist/demo/section.d.ts +0 -5
  71. package/dist/demo/section.js +0 -23
  72. package/dist/demo/templates.d.ts +0 -4
  73. package/dist/demo/templates.js +0 -10
  74. package/dist/demo/types.d.ts +0 -3
  75. package/dist/demo/types.js +0 -8
  76. package/dist/list/index.d.ts +0 -3
  77. package/dist/list/index.js +0 -9
  78. package/dist/preset/full.d.ts +0 -14
  79. package/dist/preset/full.js +0 -41
  80. package/dist/preset/standard.d.ts +0 -11
  81. package/dist/preset/standard.js +0 -30
  82. package/dist/prompt/confirm.d.ts +0 -4
  83. package/dist/prompt/confirm.js +0 -9
  84. package/dist/prompt/group.d.ts +0 -4
  85. package/dist/prompt/group.js +0 -9
  86. package/dist/prompt/index.d.ts +0 -7
  87. package/dist/prompt/index.js +0 -32
  88. package/dist/prompt/select.d.ts +0 -4
  89. package/dist/prompt/select.js +0 -11
  90. package/dist/prompt/text.d.ts +0 -4
  91. package/dist/prompt/text.js +0 -11
  92. package/dist/prompt/types.d.ts +0 -3
  93. package/dist/prompt/types.js +0 -8
  94. package/dist/prompt/validators.d.ts +0 -2
  95. package/dist/prompt/validators.js +0 -8
  96. package/dist/render/borders.d.ts +0 -2
  97. package/dist/render/borders.js +0 -15
  98. package/dist/render/box.d.ts +0 -3
  99. package/dist/render/box.js +0 -23
  100. package/dist/render/date.d.ts +0 -2
  101. package/dist/render/date.js +0 -12
  102. package/dist/render/format-relative.d.ts +0 -2
  103. package/dist/render/format-relative.js +0 -8
  104. package/dist/render/format.d.ts +0 -2
  105. package/dist/render/format.js +0 -10
  106. package/dist/render/heading.d.ts +0 -3
  107. package/dist/render/heading.js +0 -14
  108. package/dist/render/index.d.ts +0 -32
  109. package/dist/render/index.js +0 -235
  110. package/dist/render/indicators.d.ts +0 -2
  111. package/dist/render/indicators.js +0 -16
  112. package/dist/render/json.d.ts +0 -2
  113. package/dist/render/json.js +0 -10
  114. package/dist/render/layout.d.ts +0 -5
  115. package/dist/render/layout.js +0 -25
  116. package/dist/render/list.d.ts +0 -2
  117. package/dist/render/list.js +0 -8
  118. package/dist/render/markdown.d.ts +0 -2
  119. package/dist/render/markdown.js +0 -10
  120. package/dist/render/progress.d.ts +0 -2
  121. package/dist/render/progress.js +0 -8
  122. package/dist/render/separator.d.ts +0 -3
  123. package/dist/render/separator.js +0 -14
  124. package/dist/render/shapes.d.ts +0 -2
  125. package/dist/render/shapes.js +0 -35
  126. package/dist/render/spinner.d.ts +0 -2
  127. package/dist/render/spinner.js +0 -12
  128. package/dist/render/stack.d.ts +0 -3
  129. package/dist/render/stack.js +0 -38
  130. package/dist/render/table.d.ts +0 -3
  131. package/dist/render/table.js +0 -12
  132. package/dist/render/text.d.ts +0 -2
  133. package/dist/render/text.js +0 -27
  134. package/dist/render/tree.d.ts +0 -2
  135. package/dist/render/tree.js +0 -10
  136. package/dist/render/types.d.ts +0 -2
  137. package/dist/shared/@outfitter/cli-0djg8q91.js +0 -7
  138. package/dist/shared/@outfitter/cli-0w242qtv.d.ts +0 -48
  139. package/dist/shared/@outfitter/cli-1g8tt31a.d.ts +0 -119
  140. package/dist/shared/@outfitter/cli-1kwbnt86.d.ts +0 -45
  141. package/dist/shared/@outfitter/cli-1sb3xvnw.js +0 -95
  142. package/dist/shared/@outfitter/cli-1vy0vtga.js +0 -135
  143. package/dist/shared/@outfitter/cli-2g8bx1aq.d.ts +0 -50
  144. package/dist/shared/@outfitter/cli-33e97cjs.d.ts +0 -42
  145. package/dist/shared/@outfitter/cli-3b7ed3rm.d.ts +0 -97
  146. package/dist/shared/@outfitter/cli-3hk2xf3c.js +0 -82
  147. package/dist/shared/@outfitter/cli-3hp8qwx3.js +0 -11
  148. package/dist/shared/@outfitter/cli-47yw5h6a.js +0 -7
  149. package/dist/shared/@outfitter/cli-4b6tbp68.d.ts +0 -36
  150. package/dist/shared/@outfitter/cli-4fcz51qa.js +0 -70
  151. package/dist/shared/@outfitter/cli-4x6pqnez.js +0 -20
  152. package/dist/shared/@outfitter/cli-4zk2y4a2.d.ts +0 -61
  153. package/dist/shared/@outfitter/cli-60b5xh1r.js +0 -20
  154. package/dist/shared/@outfitter/cli-6bztk73z.d.ts +0 -51
  155. package/dist/shared/@outfitter/cli-6fxffp8k.js +0 -1
  156. package/dist/shared/@outfitter/cli-6hg0sg2d.d.ts +0 -93
  157. package/dist/shared/@outfitter/cli-6r3m2knf.js +0 -62
  158. package/dist/shared/@outfitter/cli-6ty1nvws.js +0 -179
  159. package/dist/shared/@outfitter/cli-7n610r63.js +0 -20
  160. package/dist/shared/@outfitter/cli-7na6p4fs.d.ts +0 -59
  161. package/dist/shared/@outfitter/cli-83jwvj1t.d.ts +0 -17
  162. package/dist/shared/@outfitter/cli-85fg2vr5.js +0 -123
  163. package/dist/shared/@outfitter/cli-8bwaw3pz.js +0 -7
  164. package/dist/shared/@outfitter/cli-8hngbjyr.d.ts +0 -164
  165. package/dist/shared/@outfitter/cli-8j5k6mr3.js +0 -71
  166. package/dist/shared/@outfitter/cli-8xsmsbbd.d.ts +0 -223
  167. package/dist/shared/@outfitter/cli-914d47mt.js +0 -20
  168. package/dist/shared/@outfitter/cli-9bcm4zhf.d.ts +0 -87
  169. package/dist/shared/@outfitter/cli-9khk3cbq.d.ts +0 -190
  170. package/dist/shared/@outfitter/cli-a4q87517.d.ts +0 -64
  171. package/dist/shared/@outfitter/cli-aem6v4c8.js +0 -146
  172. package/dist/shared/@outfitter/cli-b0tzqgnf.d.ts +0 -132
  173. package/dist/shared/@outfitter/cli-b5c2k0d7.js +0 -39
  174. package/dist/shared/@outfitter/cli-b5epywry.js +0 -1
  175. package/dist/shared/@outfitter/cli-bc17qeh2.js +0 -19
  176. package/dist/shared/@outfitter/cli-bcmcaz1b.js +0 -23
  177. package/dist/shared/@outfitter/cli-bv09nme3.d.ts +0 -56
  178. package/dist/shared/@outfitter/cli-c6pbxpw0.d.ts +0 -112
  179. package/dist/shared/@outfitter/cli-c8fqdaes.js +0 -117
  180. package/dist/shared/@outfitter/cli-c8q4f71g.js +0 -144
  181. package/dist/shared/@outfitter/cli-c9knfqn5.d.ts +0 -30
  182. package/dist/shared/@outfitter/cli-cf1xexgn.d.ts +0 -53
  183. package/dist/shared/@outfitter/cli-cf2s94s1.d.ts +0 -42
  184. package/dist/shared/@outfitter/cli-cwgj6mcs.js +0 -214
  185. package/dist/shared/@outfitter/cli-d8ahdd9d.js +0 -272
  186. package/dist/shared/@outfitter/cli-dbyteh27.d.ts +0 -24
  187. package/dist/shared/@outfitter/cli-e5ms1y0x.d.ts +0 -91
  188. package/dist/shared/@outfitter/cli-en6zn6sj.js +0 -1
  189. package/dist/shared/@outfitter/cli-evx7qcp1.d.ts +0 -300
  190. package/dist/shared/@outfitter/cli-f6fsaayd.js +0 -94
  191. package/dist/shared/@outfitter/cli-fakncnjp.d.ts +0 -106
  192. package/dist/shared/@outfitter/cli-ffa0jwb7.js +0 -122
  193. package/dist/shared/@outfitter/cli-h20jc0bs.d.ts +0 -66
  194. package/dist/shared/@outfitter/cli-h3jz0bxz.js +0 -48
  195. package/dist/shared/@outfitter/cli-h4wpzb3f.js +0 -67
  196. package/dist/shared/@outfitter/cli-hda6mc28.js +0 -126
  197. package/dist/shared/@outfitter/cli-hnpbqmc8.d.ts +0 -328
  198. package/dist/shared/@outfitter/cli-j19a91ck.js +0 -30
  199. package/dist/shared/@outfitter/cli-jejfypgf.js +0 -85
  200. package/dist/shared/@outfitter/cli-jp0k3qd9.js +0 -279
  201. package/dist/shared/@outfitter/cli-k76e7173.js +0 -128
  202. package/dist/shared/@outfitter/cli-kc3ffp1v.d.ts +0 -23
  203. package/dist/shared/@outfitter/cli-kk5hnndk.d.ts +0 -128
  204. package/dist/shared/@outfitter/cli-ktqme80d.js +0 -7
  205. package/dist/shared/@outfitter/cli-mq0jp15z.js +0 -1
  206. package/dist/shared/@outfitter/cli-n0c33vba.js +0 -25
  207. package/dist/shared/@outfitter/cli-n17gt1dz.js +0 -19
  208. package/dist/shared/@outfitter/cli-n9dbh0hp.js +0 -51
  209. package/dist/shared/@outfitter/cli-ndem6tz8.js +0 -63
  210. package/dist/shared/@outfitter/cli-nj4nqy1h.d.ts +0 -24
  211. package/dist/shared/@outfitter/cli-nkns8p4r.js +0 -61
  212. package/dist/shared/@outfitter/cli-p3dqm1vd.js +0 -22
  213. package/dist/shared/@outfitter/cli-pndwprz8.js +0 -118
  214. package/dist/shared/@outfitter/cli-pvrwv6rb.js +0 -352
  215. package/dist/shared/@outfitter/cli-py02m79x.d.ts +0 -20
  216. package/dist/shared/@outfitter/cli-qj83y5wj.d.ts +0 -71
  217. package/dist/shared/@outfitter/cli-regjbef6.d.ts +0 -26
  218. package/dist/shared/@outfitter/cli-s1tx5kha.d.ts +0 -59
  219. package/dist/shared/@outfitter/cli-sam2sq50.js +0 -37
  220. package/dist/shared/@outfitter/cli-snxj55n6.js +0 -43
  221. package/dist/shared/@outfitter/cli-symyxb0z.js +0 -20
  222. package/dist/shared/@outfitter/cli-tvw1xrdj.js +0 -20
  223. package/dist/shared/@outfitter/cli-v1tzwxkt.js +0 -32
  224. package/dist/shared/@outfitter/cli-vd60dj65.js +0 -1
  225. package/dist/shared/@outfitter/cli-vfcrskfj.d.ts +0 -41
  226. package/dist/shared/@outfitter/cli-vstbkzky.d.ts +0 -74
  227. package/dist/shared/@outfitter/cli-vtg0sqk2.d.ts +0 -54
  228. package/dist/shared/@outfitter/cli-x4cavvc0.js +0 -1
  229. package/dist/shared/@outfitter/cli-xep6v2c0.js +0 -52
  230. package/dist/shared/@outfitter/cli-xg5y5fhk.js +0 -86
  231. package/dist/shared/@outfitter/cli-y7k1t81k.js +0 -30
  232. package/dist/shared/@outfitter/cli-yfyzy95c.js +0 -67
  233. package/dist/shared/@outfitter/cli-z78mkrc7.js +0 -59
  234. package/dist/shared/@outfitter/cli-znc47004.js +0 -134
  235. package/dist/shared/@outfitter/cli-zx598p8q.d.ts +0 -26
  236. package/dist/streaming/ansi.d.ts +0 -2
  237. package/dist/streaming/ansi.js +0 -8
  238. package/dist/streaming/index.d.ts +0 -4
  239. package/dist/streaming/index.js +0 -17
  240. package/dist/streaming/spinner.d.ts +0 -3
  241. package/dist/streaming/spinner.js +0 -10
  242. package/dist/streaming/writer.d.ts +0 -2
  243. package/dist/streaming/writer.js +0 -9
  244. package/dist/table/index.d.ts +0 -4
  245. package/dist/table/index.js +0 -13
  246. package/dist/theme/context.d.ts +0 -9
  247. package/dist/theme/context.js +0 -14
  248. package/dist/theme/create.d.ts +0 -8
  249. package/dist/theme/create.js +0 -12
  250. package/dist/theme/index.d.ts +0 -17
  251. package/dist/theme/index.js +0 -42
  252. package/dist/theme/presets/bold.d.ts +0 -8
  253. package/dist/theme/presets/bold.js +0 -12
  254. package/dist/theme/presets/default.d.ts +0 -8
  255. package/dist/theme/presets/default.js +0 -11
  256. package/dist/theme/presets/index.d.ts +0 -12
  257. package/dist/theme/presets/index.js +0 -24
  258. package/dist/theme/presets/minimal.d.ts +0 -8
  259. package/dist/theme/presets/minimal.js +0 -12
  260. package/dist/theme/presets/rounded.d.ts +0 -8
  261. package/dist/theme/presets/rounded.js +0 -12
  262. package/dist/theme/resolve.d.ts +0 -8
  263. package/dist/theme/resolve.js +0 -11
  264. package/dist/theme/types.d.ts +0 -7
  265. package/dist/theme/types.js +0 -1
  266. package/dist/tree/index.d.ts +0 -3
  267. package/dist/tree/index.js +0 -11
  268. /package/dist/shared/@outfitter/{cli-ykxn7rb2.d.ts → cli-xppg982q.d.ts} +0 -0
  269. /package/dist/{render/types.js → shared/@outfitter/cli-zw75pdk8.js} +0 -0
package/README.md CHANGED
@@ -36,7 +36,7 @@ if (cursor) {
36
36
 
37
37
  Output data to the console with automatic mode selection.
38
38
 
39
- Defaults to human-friendly output for TTY, JSON for non-TTY. Override via `mode` option or `OUTFITTER_JSON`/`OUTFITTER_JSONL` environment variables.
39
+ Defaults to human-friendly output. Override via `mode` option or `OUTFITTER_JSON`/`OUTFITTER_JSONL` environment variables.
40
40
 
41
41
  ```typescript
42
42
  import { output } from "@outfitter/cli/output";
@@ -278,10 +278,10 @@ if (result.isOk()) {
278
278
 
279
279
  #### `confirmDestructive(options)`
280
280
 
281
- Prompt for confirmation before destructive operations. Respects `--yes` flag for non-interactive mode.
281
+ > **Moved to `@outfitter/tui`** -- This function is now exported from `@outfitter/tui/confirm`. Update your imports accordingly.
282
282
 
283
283
  ```typescript
284
- import { confirmDestructive } from "@outfitter/cli/input";
284
+ import { confirmDestructive } from "@outfitter/tui/confirm";
285
285
 
286
286
  const result = await confirmDestructive({
287
287
  message: "Delete 5 notes?",
@@ -361,6 +361,31 @@ if (flags.reset) {
361
361
  }
362
362
  ```
363
363
 
364
+ ## Conventions
365
+
366
+ Composable flag presets provide typed, reusable CLI flag definitions. See the [full conventions guide](../../docs/CLI-CONVENTIONS.md) for the complete catalog.
367
+
368
+ ```typescript
369
+ import { composePresets, verbosePreset, cwdPreset, forcePreset } from "@outfitter/cli/flags";
370
+ import { outputModePreset } from "@outfitter/cli/query";
371
+
372
+ const preset = composePresets(verbosePreset(), cwdPreset(), forcePreset());
373
+
374
+ command("deploy")
375
+ .preset(preset)
376
+ .action(async ({ flags }) => {
377
+ const { verbose, cwd, force } = preset.resolve(flags);
378
+ // All typed, all composable
379
+ });
380
+ ```
381
+
382
+ **Available presets:** `verbosePreset`, `cwdPreset`, `dryRunPreset`, `forcePreset`, `interactionPreset`, `strictPreset`, `colorPreset`, `projectionPreset`, `paginationPreset`, `timeWindowPreset`, `executionPreset`, `outputModePreset`, `jqPreset`
383
+
384
+ **Additional modules:**
385
+ - `@outfitter/cli/verbs` — Standard verb families (`create`, `modify`, `remove`, `list`, `show`)
386
+ - `@outfitter/cli/query` — Output mode and jq expression presets
387
+ - `@outfitter/cli/completion` — Shell completion script generation
388
+
364
389
  ## Configuration
365
390
 
366
391
  ### Environment Variables
@@ -395,13 +420,28 @@ const isVerbose = resolveVerbose();
395
420
  const isVerbose = resolveVerbose(cliFlags.verbose);
396
421
  ```
397
422
 
423
+ ### JSON Output
424
+
425
+ `createCLI()` registers a global `--json` flag that bridges to `OUTFITTER_JSON=1` via a `preAction` hook. This means `output()` auto-detects JSON mode — no manual `if (json)` branching needed:
426
+
427
+ ```typescript
428
+ // No need for this:
429
+ if (opts.json) output(data, { mode: "json" });
430
+ else output(data);
431
+
432
+ // Just use output() directly — it reads OUTFITTER_JSON:
433
+ output(data);
434
+ ```
435
+
436
+ The bridge uses `optsWithGlobals()` so global and subcommand `--json` flags both work and coalesce into a single env var. Subcommands should **not** define their own `--json` — use the global flag. If they do, both coalesce safely.
437
+
398
438
  ### Output Mode Priority
399
439
 
400
440
  1. Explicit `mode` option in `output()` call
401
441
  2. `OUTFITTER_JSONL=1` environment variable (highest env priority)
402
442
  3. `OUTFITTER_JSON=1` environment variable
403
443
  4. `OUTFITTER_JSON=0` or `OUTFITTER_JSONL=0` forces human mode
404
- 5. TTY detection: `json` for non-TTY, `human` for TTY
444
+ 5. Default fallback: `human`
405
445
 
406
446
  ## Error Handling
407
447
 
@@ -444,6 +484,10 @@ import type { CollectIdsOptions, ExpandFileOptions, ParseGlobOptions } from "@ou
444
484
  import type { PaginationState, CursorOptions } from "@outfitter/cli/pagination";
445
485
  ```
446
486
 
487
+ ## Upgrading
488
+
489
+ Run `outfitter update --guide` for version-specific migration instructions, or check the [migration docs](https://github.com/outfitter-dev/outfitter/tree/main/plugins/outfitter/shared/migrations) for detailed upgrade steps.
490
+
447
491
  ## License
448
492
 
449
493
  MIT
package/dist/actions.js CHANGED
@@ -1,6 +1,4 @@
1
1
  // @bun
2
- import"./shared/@outfitter/cli-v1tzwxkt.js";
3
-
4
2
  // packages/cli/src/actions.ts
5
3
  import {
6
4
  createContext as createHandlerContext,
package/dist/cli.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CLI, CLIConfig } from "./shared/@outfitter/cli-ttt7r0j7";
1
+ import { CLI, CLIConfig } from "./shared/@outfitter/cli-md9347gn";
2
2
  /**
3
3
  * Create a new CLI instance with the given configuration.
4
4
  *
package/dist/cli.js CHANGED
@@ -1,8 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  createCLI
4
- } from "./shared/@outfitter/cli-4h4rpdra.js";
5
- import"./shared/@outfitter/cli-v1tzwxkt.js";
4
+ } from "./shared/@outfitter/cli-zahqsaby.js";
6
5
  export {
7
6
  createCLI
8
7
  };
@@ -1,2 +1,2 @@
1
- import { ANSI, ColorName, Theme, TokenOptions, Tokens, applyColor, createTheme, createTokens, resolveTokenColorEnabled } from "../shared/@outfitter/cli-ykxn7rb2";
1
+ import { ANSI, ColorName, Theme, TokenOptions, Tokens, applyColor, createTheme, createTokens, resolveTokenColorEnabled } from "../shared/@outfitter/cli-xppg982q";
2
2
  export { resolveTokenColorEnabled, createTokens, createTheme, applyColor, Tokens, TokenOptions, Theme, ColorName, ANSI };
@@ -4,13 +4,9 @@ import {
4
4
  applyColor,
5
5
  createTheme,
6
6
  createTokens,
7
- init_colors,
8
7
  resolveTokenColorEnabled
9
- } from "../shared/@outfitter/cli-5g6rkv3d.js";
10
- import"../shared/@outfitter/cli-d9ad0rqj.js";
11
- import"../shared/@outfitter/cli-v1tzwxkt.js";
12
- init_colors();
13
-
8
+ } from "../shared/@outfitter/cli-rk9zagkm.js";
9
+ import"../shared/@outfitter/cli-jbj78ac5.js";
14
10
  export {
15
11
  resolveTokenColorEnabled,
16
12
  createTokens,
@@ -1,3 +1,3 @@
1
1
  import "../shared/@outfitter/cli-qz47jk6d";
2
- import { ANSI, ColorName, Theme, TokenOptions, Tokens, applyColor, createTheme, createTokens, resolveTokenColorEnabled } from "../shared/@outfitter/cli-ykxn7rb2";
2
+ import { ANSI, ColorName, Theme, TokenOptions, Tokens, applyColor, createTheme, createTokens, resolveTokenColorEnabled } from "../shared/@outfitter/cli-xppg982q";
3
3
  export { resolveTokenColorEnabled, createTokens, createTheme, applyColor, Tokens, TokenOptions, Theme, ColorName, ANSI };
@@ -1,14 +1,13 @@
1
1
  // @bun
2
- import"../shared/@outfitter/cli-47yw5h6a.js";
2
+ import"../shared/@outfitter/cli-zw75pdk8.js";
3
3
  import {
4
4
  ANSI,
5
5
  applyColor,
6
6
  createTheme,
7
7
  createTokens,
8
8
  resolveTokenColorEnabled
9
- } from "../shared/@outfitter/cli-5g6rkv3d.js";
10
- import"../shared/@outfitter/cli-d9ad0rqj.js";
11
- import"../shared/@outfitter/cli-v1tzwxkt.js";
9
+ } from "../shared/@outfitter/cli-rk9zagkm.js";
10
+ import"../shared/@outfitter/cli-jbj78ac5.js";
12
11
  export {
13
12
  resolveTokenColorEnabled,
14
13
  createTokens,
package/dist/command.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CLI, CLIConfig, CommandAction, CommandBuilder, CommandConfig, CommandFlags } from "./shared/@outfitter/cli-ttt7r0j7";
1
+ import { CLI, CLIConfig, CommandAction, CommandBuilder, CommandConfig, CommandFlags, FlagPreset } from "./shared/@outfitter/cli-md9347gn";
2
2
  /**
3
3
  * Create a CLI instance with a portable return type from this module.
4
4
  */
@@ -40,4 +40,4 @@ declare function createCLI(config: CLIConfig): CLI;
40
40
  * ```
41
41
  */
42
42
  declare function command(name: string): CommandBuilder;
43
- export { createCLI, command, CommandFlags, CommandConfig, CommandBuilder, CommandAction, CLIConfig, CLI };
43
+ export { createCLI, command, FlagPreset, CommandFlags, CommandConfig, CommandBuilder, CommandAction, CLIConfig, CLI };
package/dist/command.js CHANGED
@@ -1,8 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  createCLI
4
- } from "./shared/@outfitter/cli-4h4rpdra.js";
5
- import"./shared/@outfitter/cli-v1tzwxkt.js";
4
+ } from "./shared/@outfitter/cli-zahqsaby.js";
6
5
 
7
6
  // packages/cli/src/command.ts
8
7
  import { Command } from "commander";
@@ -48,6 +47,16 @@ class CommandBuilderImpl {
48
47
  this.command.alias(alias);
49
48
  return this;
50
49
  }
50
+ preset(preset) {
51
+ for (const opt of preset.options) {
52
+ if (opt.required) {
53
+ this.command.requiredOption(opt.flags, opt.description, opt.defaultValue);
54
+ } else {
55
+ this.command.option(opt.flags, opt.description, opt.defaultValue);
56
+ }
57
+ }
58
+ return this;
59
+ }
51
60
  action(handler) {
52
61
  this.command.action(async (...args) => {
53
62
  const command = args.at(-1);
@@ -0,0 +1,36 @@
1
+ import { Command } from "commander";
2
+ /**
3
+ * Configuration for the completion command.
4
+ */
5
+ interface CompletionConfig {
6
+ /** Supported shells (default: bash, zsh, fish) */
7
+ readonly shells?: readonly ("bash" | "zsh" | "fish")[];
8
+ /** Program name for completion scripts (inferred from CLI name if not provided) */
9
+ readonly programName?: string;
10
+ }
11
+ /**
12
+ * Generate a completion script for the given shell.
13
+ *
14
+ * @param shell - Target shell
15
+ * @param programName - CLI program name
16
+ * @returns The completion script string, or undefined for unsupported shells
17
+ */
18
+ declare function generateCompletion(shell: string, programName: string): string | undefined;
19
+ /**
20
+ * Create a `completion <shell>` command that outputs install-ready
21
+ * completion scripts.
22
+ *
23
+ * @param config - Optional configuration
24
+ * @returns A Commander command instance
25
+ *
26
+ * @example
27
+ * ```typescript
28
+ * import { createCLI } from "@outfitter/cli";
29
+ * import { createCompletionCommand } from "@outfitter/cli/completion";
30
+ *
31
+ * const cli = createCLI({ name: "mycli", version: "1.0.0" });
32
+ * cli.register(createCompletionCommand({ programName: "mycli" }));
33
+ * ```
34
+ */
35
+ declare function createCompletionCommand(config?: CompletionConfig): Command;
36
+ export { generateCompletion, createCompletionCommand, CompletionConfig };
@@ -0,0 +1,91 @@
1
+ // @bun
2
+ // packages/cli/src/completion.ts
3
+ import { Command } from "commander";
4
+ var SHELL_SAFE_PROGRAM_NAME = /^[A-Za-z0-9._-]+$/;
5
+ function assertSafeProgramName(programName) {
6
+ if (SHELL_SAFE_PROGRAM_NAME.test(programName))
7
+ return;
8
+ throw new Error(`Invalid program name for shell completion: "${programName}".` + " Must match /^[A-Za-z0-9._-]+$/.");
9
+ }
10
+ function toShellIdentifier(programName) {
11
+ assertSafeProgramName(programName);
12
+ return programName.replaceAll(/[^A-Za-z0-9_]/g, "_");
13
+ }
14
+ function generateBashCompletion(programName) {
15
+ assertSafeProgramName(programName);
16
+ const shellIdentifier = toShellIdentifier(programName);
17
+ return `# bash completion for ${programName}
18
+ # Add to ~/.bashrc or ~/.bash_profile:
19
+ # eval "$(${programName} completion bash)"
20
+
21
+ _${shellIdentifier}_completions() {
22
+ local cur
23
+ cur="\${COMP_WORDS[COMP_CWORD]}"
24
+
25
+ COMPREPLY=( $(compgen -W "$(${programName} --help 2>/dev/null | grep -oE '^ [a-z][-a-z]*' | tr -d ' ')" -- "\${cur}") )
26
+ }
27
+
28
+ complete -F _${shellIdentifier}_completions ${programName}
29
+ `;
30
+ }
31
+ function generateZshCompletion(programName) {
32
+ assertSafeProgramName(programName);
33
+ const shellIdentifier = toShellIdentifier(programName);
34
+ return `#compdef ${programName}
35
+ # zsh completion for ${programName}
36
+ # Add to ~/.zshrc:
37
+ # eval "$(${programName} completion zsh)"
38
+
39
+ _${shellIdentifier}() {
40
+ local -a commands
41
+ commands=($(${programName} --help 2>/dev/null | grep -oE '^ [a-z][-a-z]*' | tr -d ' '))
42
+
43
+ _arguments \\
44
+ '1:command:compadd -a commands' \\
45
+ '*::arg:->args'
46
+ }
47
+
48
+ compdef _${shellIdentifier} ${programName}
49
+ `;
50
+ }
51
+ function generateFishCompletion(programName) {
52
+ assertSafeProgramName(programName);
53
+ return `# fish completion for ${programName}
54
+ # Add to ~/.config/fish/completions/${programName}.fish:
55
+ # ${programName} completion fish > ~/.config/fish/completions/${programName}.fish
56
+
57
+ complete -c ${programName} -f
58
+ complete -c ${programName} -n "__fish_use_subcommand" -a "(${programName} --help 2>/dev/null | string match -r '^ [a-z][-a-z]*' | string trim)"
59
+ `;
60
+ }
61
+ var GENERATORS = {
62
+ bash: generateBashCompletion,
63
+ zsh: generateZshCompletion,
64
+ fish: generateFishCompletion
65
+ };
66
+ function generateCompletion(shell, programName) {
67
+ const generator = Object.hasOwn(GENERATORS, shell) ? GENERATORS[shell] : undefined;
68
+ return generator?.(programName);
69
+ }
70
+ function createCompletionCommand(config) {
71
+ const shells = config?.shells ?? ["bash", "zsh", "fish"];
72
+ const shellSet = new Set(shells);
73
+ const cmd = new Command("completion").description(`Generate shell completion script (${shells.join(", ")})`).argument("<shell>", `Shell type (${shells.join(", ")})`).action((shell) => {
74
+ if (!shellSet.has(shell)) {
75
+ cmd.error(`error: unsupported shell '${shell}'. Supported: ${shells.join(", ")}`);
76
+ return;
77
+ }
78
+ const generator = GENERATORS[shell];
79
+ if (generator) {
80
+ const programName = config?.programName ?? cmd.parent?.name() ?? "program";
81
+ assertSafeProgramName(programName);
82
+ const script = generator(programName);
83
+ process.stdout.write(script);
84
+ }
85
+ });
86
+ return cmd;
87
+ }
88
+ export {
89
+ generateCompletion,
90
+ createCompletionCommand
91
+ };
@@ -0,0 +1,167 @@
1
+ import { ColorFlags, ColorMode, ComposedPreset, ExecutionFlags, ExecutionPresetConfig, FlagPreset, FlagPresetConfig, InteractionFlags, PaginationFlags, PaginationPresetConfig, ProjectionFlags, StrictFlags, TimeWindowFlags, TimeWindowPresetConfig } from "./shared/@outfitter/cli-md9347gn";
2
+ /**
3
+ * Create a typed flag preset.
4
+ *
5
+ * @param config - Preset configuration with id, options, and resolver
6
+ * @returns A flag preset that can be applied to commands or composed
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * const myPreset = createPreset({
11
+ * id: "output-format",
12
+ * options: [{ flags: "--format <type>", description: "Output format" }],
13
+ * resolve: (flags) => ({
14
+ * format: String(flags["format"] ?? "text"),
15
+ * }),
16
+ * });
17
+ * ```
18
+ */
19
+ declare function createPreset<TResolved extends Record<string, unknown>>(config: FlagPresetConfig<TResolved>): FlagPreset<TResolved>;
20
+ type ResolvedType<T> = T extends FlagPreset<infer R> ? R : never;
21
+ type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
22
+ /**
23
+ * Resolves the merged type from a tuple of presets.
24
+ * Falls back to Record<string, unknown> when the tuple is empty
25
+ * (since UnionToIntersection<never> produces unknown).
26
+ */
27
+ type MergedPresetResult<TPresets extends readonly FlagPreset<Record<string, unknown>>[]> = UnionToIntersection<ResolvedType<TPresets[number]>> extends Record<string, unknown> ? UnionToIntersection<ResolvedType<TPresets[number]>> : Record<string, unknown>;
28
+ /**
29
+ * Compose multiple presets into one, deduplicating by id (first wins).
30
+ *
31
+ * @param presets - Presets to compose together
32
+ * @returns A single preset merging all options and resolvers
33
+ *
34
+ * @example
35
+ * ```typescript
36
+ * const composed = composePresets(
37
+ * verbosePreset(),
38
+ * cwdPreset(),
39
+ * forcePreset(),
40
+ * );
41
+ * // composed.resolve({ verbose: true, cwd: "/tmp", force: false })
42
+ * // => { verbose: true, cwd: "/tmp", force: false }
43
+ * ```
44
+ */
45
+ declare function composePresets<TPresets extends readonly FlagPreset<Record<string, unknown>>[]>(...presets: TPresets): ComposedPreset<MergedPresetResult<TPresets>>;
46
+ /**
47
+ * Verbose output flag preset.
48
+ *
49
+ * Adds: `-v, --verbose`
50
+ * Resolves: `{ verbose: boolean }`
51
+ */
52
+ declare function verbosePreset(): FlagPreset<{
53
+ verbose: boolean;
54
+ }>;
55
+ /**
56
+ * Working directory flag preset.
57
+ *
58
+ * Adds: `--cwd <path>`
59
+ * Resolves: `{ cwd: string }` (defaults to `process.cwd()`)
60
+ */
61
+ declare function cwdPreset(): FlagPreset<{
62
+ cwd: string;
63
+ }>;
64
+ /**
65
+ * Dry-run flag preset.
66
+ *
67
+ * Adds: `--dry-run`
68
+ * Resolves: `{ dryRun: boolean }`
69
+ */
70
+ declare function dryRunPreset(): FlagPreset<{
71
+ dryRun: boolean;
72
+ }>;
73
+ /**
74
+ * Force flag preset.
75
+ *
76
+ * Adds: `-f, --force`
77
+ * Resolves: `{ force: boolean }`
78
+ */
79
+ declare function forcePreset(): FlagPreset<{
80
+ force: boolean;
81
+ }>;
82
+ /**
83
+ * Interaction mode flag preset.
84
+ *
85
+ * Adds: `--non-interactive`, `--no-input`, `-y, --yes`
86
+ * Resolves: `{ interactive: boolean, yes: boolean }`
87
+ *
88
+ * `interactive` defaults to `true` and is set to `false` when
89
+ * `--non-interactive` or `--no-input` is passed. The two flags
90
+ * are synonyms for user convenience.
91
+ */
92
+ declare function interactionPreset(): FlagPreset<InteractionFlags>;
93
+ /**
94
+ * Strict mode flag preset.
95
+ *
96
+ * Adds: `--strict`
97
+ * Resolves: `{ strict: boolean }`
98
+ */
99
+ declare function strictPreset(): FlagPreset<StrictFlags>;
100
+ /**
101
+ * Color mode flag preset.
102
+ *
103
+ * Adds: `--color [mode]`, `--no-color`
104
+ * Resolves: `{ color: "auto" | "always" | "never" }`
105
+ *
106
+ * Commander's `--no-color` negation sets `flags["color"]` to `false`,
107
+ * which resolves to `"never"`. Invalid values default to `"auto"`.
108
+ *
109
+ * This preset resolves the user's *intent*. Consumers should compose
110
+ * with terminal detection (`supportsColor()`, `resolveColorEnv()`)
111
+ * to determine actual color output behavior.
112
+ */
113
+ declare function colorPreset(): FlagPreset<ColorFlags>;
114
+ /**
115
+ * Projection flag preset.
116
+ *
117
+ * Adds: `--fields <fields>`, `--exclude-fields <fields>`, `--count`
118
+ * Resolves: `{ fields: string[] | undefined, excludeFields: string[] | undefined, count: boolean }`
119
+ *
120
+ * Fields are parsed as comma-separated strings with whitespace trimming.
121
+ * `undefined` when not provided (not empty array) to distinguish
122
+ * "not specified" from "empty".
123
+ *
124
+ * Conflict between `--fields` and `--exclude-fields` is a handler
125
+ * concern (documented, not enforced).
126
+ */
127
+ declare function projectionPreset(): FlagPreset<ProjectionFlags>;
128
+ /**
129
+ * Time-window flag preset.
130
+ *
131
+ * Adds: `--since <date>`, `--until <date>`
132
+ * Resolves: `{ since: Date | undefined, until: Date | undefined }`
133
+ *
134
+ * Accepts ISO 8601 dates (`2024-01-15`) or relative durations
135
+ * (`7d`, `24h`, `30m`, `2w`). Durations are past-relative
136
+ * (subtracted from now).
137
+ *
138
+ * Returns `undefined` for unparseable values (does not throw).
139
+ * When `config.maxRange` is set and both bounds are provided,
140
+ * ranges above the limit are treated as invalid.
141
+ */
142
+ declare function timeWindowPreset(config?: TimeWindowPresetConfig): FlagPreset<TimeWindowFlags>;
143
+ /**
144
+ * Execution flag preset.
145
+ *
146
+ * Adds: `--timeout <ms>`, `--retries <n>`, `--offline`
147
+ * Resolves: `{ timeout: number | undefined, retries: number, offline: boolean }`
148
+ *
149
+ * Timeout is parsed as a positive integer in milliseconds.
150
+ * Retries are parsed as a non-negative integer, clamped to maxRetries.
151
+ */
152
+ declare function executionPreset(config?: ExecutionPresetConfig): FlagPreset<ExecutionFlags>;
153
+ /**
154
+ * Pagination flag preset.
155
+ *
156
+ * Adds: `-l, --limit <n>`, `--next`, `--reset`
157
+ * Resolves: `{ limit: number, next: boolean, reset: boolean }`
158
+ *
159
+ * Limit is parsed as an integer, clamped to maxLimit, and defaults
160
+ * to defaultLimit on invalid input. Mutual exclusivity of --next
161
+ * and --reset is a handler concern (not enforced here).
162
+ *
163
+ * Integrates with loadCursor/saveCursor/clearCursor from
164
+ * `@outfitter/cli/pagination`.
165
+ */
166
+ declare function paginationPreset(config?: PaginationPresetConfig): FlagPreset<PaginationFlags>;
167
+ export { verbosePreset, timeWindowPreset, strictPreset, projectionPreset, paginationPreset, interactionPreset, forcePreset, executionPreset, dryRunPreset, cwdPreset, createPreset, composePresets, colorPreset, TimeWindowPresetConfig, TimeWindowFlags, StrictFlags, ProjectionFlags, PaginationPresetConfig, PaginationFlags, InteractionFlags, FlagPresetConfig, FlagPreset, ExecutionPresetConfig, ExecutionFlags, ComposedPreset, ColorMode, ColorFlags };
package/dist/flags.js ADDED
@@ -0,0 +1,31 @@
1
+ // @bun
2
+ import {
3
+ colorPreset,
4
+ composePresets,
5
+ createPreset,
6
+ cwdPreset,
7
+ dryRunPreset,
8
+ executionPreset,
9
+ forcePreset,
10
+ interactionPreset,
11
+ paginationPreset,
12
+ projectionPreset,
13
+ strictPreset,
14
+ timeWindowPreset,
15
+ verbosePreset
16
+ } from "./shared/@outfitter/cli-b2zk8fb3.js";
17
+ export {
18
+ verbosePreset,
19
+ timeWindowPreset,
20
+ strictPreset,
21
+ projectionPreset,
22
+ paginationPreset,
23
+ interactionPreset,
24
+ forcePreset,
25
+ executionPreset,
26
+ dryRunPreset,
27
+ cwdPreset,
28
+ createPreset,
29
+ composePresets,
30
+ colorPreset
31
+ };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./shared/@outfitter/cli-qz47jk6d";
2
- import { ANSI, Theme, Tokens, createTheme } from "./shared/@outfitter/cli-ykxn7rb2";
3
- import { output } from "./shared/@outfitter/cli-e6yv2764";
4
- import { OutputMode } from "./shared/@outfitter/cli-ttt7r0j7";
5
- export { output, createTheme, Tokens, Theme, OutputMode, ANSI };
2
+ import { ANSI, Theme, Tokens, createTheme } from "./shared/@outfitter/cli-xppg982q";
3
+ import { exitWithError, output } from "./shared/@outfitter/cli-k0yvzn6d";
4
+ import { OutputMode } from "./shared/@outfitter/cli-md9347gn";
5
+ export { output, exitWithError, createTheme, Tokens, Theme, OutputMode, ANSI };
package/dist/index.js CHANGED
@@ -1,16 +1,17 @@
1
1
  // @bun
2
- import"./shared/@outfitter/cli-47yw5h6a.js";
2
+ import"./shared/@outfitter/cli-zw75pdk8.js";
3
3
  import {
4
4
  ANSI,
5
5
  createTheme
6
- } from "./shared/@outfitter/cli-5g6rkv3d.js";
7
- import"./shared/@outfitter/cli-d9ad0rqj.js";
6
+ } from "./shared/@outfitter/cli-rk9zagkm.js";
7
+ import"./shared/@outfitter/cli-jbj78ac5.js";
8
8
  import {
9
+ exitWithError,
9
10
  output
10
11
  } from "./shared/@outfitter/cli-7wp5nj0s.js";
11
- import"./shared/@outfitter/cli-v1tzwxkt.js";
12
12
  export {
13
13
  output,
14
+ exitWithError,
14
15
  createTheme,
15
16
  ANSI
16
17
  };
package/dist/input.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { CollectIdsOptions, ConfirmDestructiveOptions, ExpandFileOptions, FilterExpression, KeyValuePair, NormalizeIdOptions, ParseGlobOptions, Range, SortCriteria } from "./shared/@outfitter/cli-ttt7r0j7";
2
- import { CancelledError, ValidationError } from "@outfitter/contracts";
1
+ import { CollectIdsOptions, ExpandFileOptions, FilterExpression, KeyValuePair, NormalizeIdOptions, ParseGlobOptions, Range, SortCriteria } from "./shared/@outfitter/cli-md9347gn";
2
+ import { ValidationError } from "@outfitter/contracts";
3
3
  import { Result } from "better-result";
4
4
  /**
5
5
  * Collect IDs from various input formats.
@@ -138,27 +138,4 @@ declare function parseSortSpec(input: string): Result<SortCriteria[], InstanceTy
138
138
  * ```
139
139
  */
140
140
  declare function normalizeId(input: string, options?: NormalizeIdOptions): Result<string, InstanceType<typeof ValidationError>>;
141
- /**
142
- * Prompt for confirmation before destructive operations.
143
- *
144
- * Respects --yes flag for non-interactive mode.
145
- *
146
- * @param options - Confirmation options
147
- * @returns Whether the user confirmed
148
- *
149
- * @example
150
- * ```typescript
151
- * const confirmed = await confirmDestructive({
152
- * message: "Delete 5 notes?",
153
- * bypassFlag: flags.yes,
154
- * itemCount: 5,
155
- * });
156
- *
157
- * if (confirmed.isErr()) {
158
- * // User cancelled
159
- * process.exit(0);
160
- * }
161
- * ```
162
- */
163
- declare function confirmDestructive(options: ConfirmDestructiveOptions): Promise<Result<boolean, InstanceType<typeof CancelledError>>>;
164
- export { parseSortSpec, parseRange, parseKeyValue, parseGlob, parseFilter, normalizeId, expandFileArg, confirmDestructive, collectIds };
141
+ export { parseSortSpec, parseRange, parseKeyValue, parseGlob, parseFilter, normalizeId, expandFileArg, collectIds };
package/dist/input.js CHANGED
@@ -1,11 +1,7 @@
1
1
  // @bun
2
- import {
3
- __require
4
- } from "./shared/@outfitter/cli-v1tzwxkt.js";
5
-
6
2
  // packages/cli/src/input.ts
7
3
  import path from "path";
8
- import { CancelledError, ValidationError } from "@outfitter/contracts";
4
+ import { ValidationError } from "@outfitter/contracts";
9
5
  import { Err, Ok } from "better-result";
10
6
  function isSecurePath(filePath, allowAbsolute = false) {
11
7
  if (filePath.includes("\x00")) {
@@ -400,31 +396,6 @@ function normalizeId(input, options) {
400
396
  }
401
397
  return new Ok(normalized);
402
398
  }
403
- async function confirmDestructive(options) {
404
- const { message, bypassFlag = false, itemCount } = options;
405
- if (bypassFlag) {
406
- return new Ok(true);
407
- }
408
- const isTTY = process.stdout.isTTY;
409
- const isDumbTerminal = process.env["TERM"] === "dumb";
410
- if (!isTTY || isDumbTerminal) {
411
- return new Err(new CancelledError({
412
- message: "Cannot prompt for confirmation in non-interactive mode. Use --yes to bypass."
413
- }));
414
- }
415
- let promptMessage = message;
416
- if (itemCount !== undefined) {
417
- promptMessage = `${message} (${itemCount} items)`;
418
- }
419
- const { confirm, isCancel } = await import("@clack/prompts");
420
- const response = await confirm({ message: promptMessage });
421
- if (isCancel(response) || response === false) {
422
- return new Err(new CancelledError({
423
- message: "Operation cancelled by user."
424
- }));
425
- }
426
- return new Ok(true);
427
- }
428
399
  export {
429
400
  parseSortSpec,
430
401
  parseRange,
@@ -433,6 +404,5 @@ export {
433
404
  parseFilter,
434
405
  normalizeId,
435
406
  expandFileArg,
436
- confirmDestructive,
437
407
  collectIds
438
408
  };
package/dist/output.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { exitWithError, output, resolveVerbose } from "./shared/@outfitter/cli-e6yv2764";
2
- import "./shared/@outfitter/cli-ttt7r0j7";
1
+ import { exitWithError, output, resolveVerbose } from "./shared/@outfitter/cli-k0yvzn6d";
2
+ import "./shared/@outfitter/cli-md9347gn";
3
3
  export { resolveVerbose, output, exitWithError };
package/dist/output.js CHANGED
@@ -4,7 +4,6 @@ import {
4
4
  output,
5
5
  resolveVerbose
6
6
  } from "./shared/@outfitter/cli-7wp5nj0s.js";
7
- import"./shared/@outfitter/cli-v1tzwxkt.js";
8
7
  export {
9
8
  resolveVerbose,
10
9
  output,