@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
@@ -1,14 +1,31 @@
1
1
  // @bun
2
2
  import {
3
- init_detection,
4
3
  resolveColorEnv,
5
4
  supportsColor
6
- } from "./cli-d9ad0rqj.js";
7
- import {
8
- __esm
9
- } from "./cli-v1tzwxkt.js";
5
+ } from "./cli-jbj78ac5.js";
10
6
 
11
- // packages/cli/src/render/colors.ts
7
+ // packages/cli/src/colors/colors.ts
8
+ var ANSI = {
9
+ reset: "\x1B[0m",
10
+ bold: "\x1B[1m",
11
+ dim: "\x1B[2m",
12
+ italic: "\x1B[3m",
13
+ underline: "\x1B[4m",
14
+ inverse: "\x1B[7m",
15
+ green: "\x1B[32m",
16
+ yellow: "\x1B[33m",
17
+ red: "\x1B[31m",
18
+ blue: "\x1B[34m",
19
+ cyan: "\x1B[36m",
20
+ magenta: "\x1B[35m",
21
+ white: "\x1B[37m",
22
+ gray: "\x1B[90m",
23
+ brightCyan: "\x1B[96m",
24
+ brightRed: "\x1B[91m",
25
+ brightYellow: "\x1B[93m",
26
+ brightGreen: "\x1B[92m",
27
+ brightBlue: "\x1B[94m"
28
+ };
12
29
  function createTheme() {
13
30
  const colorEnabled = supportsColor();
14
31
  const colorFn = (ansiCode) => (text) => {
@@ -103,30 +120,5 @@ function applyColor(text, color) {
103
120
  const ansiCode = ANSI[color];
104
121
  return `${ansiCode}${text}${ANSI.reset}`;
105
122
  }
106
- var ANSI;
107
- var init_colors = __esm(() => {
108
- init_detection();
109
- ANSI = {
110
- reset: "\x1B[0m",
111
- bold: "\x1B[1m",
112
- dim: "\x1B[2m",
113
- italic: "\x1B[3m",
114
- underline: "\x1B[4m",
115
- inverse: "\x1B[7m",
116
- green: "\x1B[32m",
117
- yellow: "\x1B[33m",
118
- red: "\x1B[31m",
119
- blue: "\x1B[34m",
120
- cyan: "\x1B[36m",
121
- magenta: "\x1B[35m",
122
- white: "\x1B[37m",
123
- gray: "\x1B[90m",
124
- brightCyan: "\x1B[96m",
125
- brightRed: "\x1B[91m",
126
- brightYellow: "\x1B[93m",
127
- brightGreen: "\x1B[92m",
128
- brightBlue: "\x1B[94m"
129
- };
130
- });
131
123
 
132
- export { ANSI, createTheme, resolveTokenColorEnabled, createTokens, applyColor, init_colors };
124
+ export { ANSI, createTheme, resolveTokenColorEnabled, createTokens, applyColor };
@@ -6,33 +6,55 @@ function isCommanderHelp(error) {
6
6
  }
7
7
  function createCLI(config) {
8
8
  const program = new Command;
9
+ let bridgedJsonEnvPrevious;
10
+ let bridgedJsonEnvActive = false;
11
+ const restoreJsonEnvBridge = () => {
12
+ if (!bridgedJsonEnvActive) {
13
+ return;
14
+ }
15
+ if (bridgedJsonEnvPrevious === undefined) {
16
+ process.env["OUTFITTER_JSON"] = undefined;
17
+ } else {
18
+ process.env["OUTFITTER_JSON"] = bridgedJsonEnvPrevious;
19
+ }
20
+ bridgedJsonEnvPrevious = undefined;
21
+ bridgedJsonEnvActive = false;
22
+ };
9
23
  program.name(config.name).version(config.version);
10
24
  if (config.description) {
11
25
  program.description(config.description);
12
26
  }
13
27
  program.option("--json", "Output as JSON", false);
14
- const exit = config.onExit ?? ((code) => process.exit(code));
15
- program.exitOverride((error) => {
16
- if (isCommanderHelp(error)) {
17
- exit(0);
28
+ program.hook("preAction", (thisCommand) => {
29
+ const allOpts = thisCommand.optsWithGlobals();
30
+ if (allOpts["json"] && !bridgedJsonEnvActive) {
31
+ bridgedJsonEnvPrevious = process.env["OUTFITTER_JSON"];
32
+ process.env["OUTFITTER_JSON"] = "1";
33
+ bridgedJsonEnvActive = true;
18
34
  }
19
- if (config.onError) {
20
- config.onError(error);
21
- }
22
- const exitCode = typeof error.exitCode === "number" && Number.isFinite(error.exitCode) ? error.exitCode : 1;
23
- exit(exitCode);
24
35
  });
36
+ program.hook("postAction", () => {
37
+ restoreJsonEnvBridge();
38
+ });
39
+ const exit = config.onExit ?? ((code) => void process.exit(code));
40
+ program.exitOverride();
25
41
  const parse = async (argv) => {
26
42
  try {
27
43
  await program.parseAsync(argv ?? process.argv);
28
44
  } catch (error) {
29
45
  const err = error instanceof Error ? error : new Error(String(error));
46
+ if (isCommanderHelp(err)) {
47
+ await exit(0);
48
+ return;
49
+ }
30
50
  if (config.onError) {
31
51
  config.onError(err);
32
52
  }
33
53
  const errorExitCode = error.exitCode;
34
54
  const exitCode = typeof errorExitCode === "number" ? errorExitCode : 1;
35
- exit(exitCode);
55
+ await exit(exitCode);
56
+ } finally {
57
+ restoreJsonEnvBridge();
36
58
  }
37
59
  };
38
60
  const cli = {
@@ -3,15 +3,11 @@ import {
3
3
  getEnvValue,
4
4
  getTerminalWidth,
5
5
  hasNoColorEnv,
6
- init_detection,
7
6
  isInteractive,
8
7
  resolveColorEnv,
9
8
  resolveForceColorEnv,
10
9
  supportsColor
11
- } from "../shared/@outfitter/cli-d9ad0rqj.js";
12
- import"../shared/@outfitter/cli-v1tzwxkt.js";
13
- init_detection();
14
-
10
+ } from "../shared/@outfitter/cli-jbj78ac5.js";
15
11
  export {
16
12
  supportsColor,
17
13
  resolveForceColorEnv,
@@ -3,16 +3,11 @@ import {
3
3
  getEnvValue,
4
4
  getTerminalWidth,
5
5
  hasNoColorEnv,
6
- init_detection,
7
6
  isInteractive,
8
7
  resolveColorEnv,
9
8
  resolveForceColorEnv,
10
9
  supportsColor
11
- } from "../shared/@outfitter/cli-d9ad0rqj.js";
12
- import"../shared/@outfitter/cli-v1tzwxkt.js";
13
-
14
- // packages/cli/src/terminal/index.ts
15
- init_detection();
10
+ } from "../shared/@outfitter/cli-jbj78ac5.js";
16
11
  export {
17
12
  supportsColor,
18
13
  resolveForceColorEnv,
@@ -144,4 +144,4 @@ declare function pluralize(count: number, singular: string, plural?: string): st
144
144
  * ```
145
145
  */
146
146
  declare function slugify(text: string): string;
147
- export { ANSI_REGEX, stripAnsi, getStringWidth, wrapText, truncateText, padText, pluralize, slugify };
147
+ export { wrapText, truncateText, stripAnsi, slugify, pluralize, padText, getStringWidth, ANSI_REGEX };
@@ -1,13 +1,11 @@
1
1
  // @bun
2
2
  import {
3
- ANSI,
4
- init_colors
5
- } from "./cli-5g6rkv3d.js";
6
- import {
7
- __esm
8
- } from "./cli-v1tzwxkt.js";
3
+ ANSI
4
+ } from "./shared/@outfitter/cli-rk9zagkm.js";
5
+ import"./shared/@outfitter/cli-jbj78ac5.js";
9
6
 
10
- // packages/cli/src/render/text.ts
7
+ // packages/cli/src/text.ts
8
+ var ANSI_REGEX = /\x1b\[[0-9;]*m/g;
11
9
  function stripAnsi(text) {
12
10
  return text.replace(ANSI_REGEX, "");
13
11
  }
@@ -76,10 +74,13 @@ function pluralize(count, singular, plural) {
76
74
  function slugify(text) {
77
75
  return text.toLowerCase().replace(/&/g, "and").replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
78
76
  }
79
- var ANSI_REGEX;
80
- var init_text = __esm(() => {
81
- init_colors();
82
- ANSI_REGEX = /\x1b\[[0-9;]*m/g;
83
- });
84
-
85
- export { ANSI_REGEX, stripAnsi, getStringWidth, wrapText, truncateText, padText, pluralize, slugify, init_text };
77
+ export {
78
+ wrapText,
79
+ truncateText,
80
+ stripAnsi,
81
+ slugify,
82
+ pluralize,
83
+ padText,
84
+ getStringWidth,
85
+ ANSI_REGEX
86
+ };
package/dist/types.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { CLI, CLIConfig, CancelledError, CollectIdsOptions, CommandAction, CommandBuilder, CommandConfig, CommandFlags, ConfirmDestructiveOptions, CursorOptions, DateRange, ErrorCategory, ExpandFileOptions, FilterExpression, KeyValuePair, NormalizeIdOptions, NumericRange, OutputMode, OutputOptions, PaginationState, ParseGlobOptions, Range, Result, SortCriteria, ValidationError } from "./shared/@outfitter/cli-ttt7r0j7";
2
- export { ValidationError, SortCriteria, Result, Range, ParseGlobOptions, PaginationState, OutputOptions, OutputMode, NumericRange, NormalizeIdOptions, KeyValuePair, FilterExpression, ExpandFileOptions, ErrorCategory, DateRange, CursorOptions, ConfirmDestructiveOptions, CommandFlags, CommandConfig, CommandBuilder, CommandAction, CollectIdsOptions, CancelledError, CLIConfig, CLI };
1
+ import { CLI, CLIConfig, CancelledError, CollectIdsOptions, ColorFlags, ColorMode, CommandAction, CommandBuilder, CommandConfig, CommandFlags, ComposedPreset, CursorOptions, DateRange, ErrorCategory, ExecutionFlags, ExecutionPresetConfig, ExpandFileOptions, FilterExpression, FlagPreset, FlagPresetConfig, InteractionFlags, KeyValuePair, NormalizeIdOptions, NumericRange, OutputMode, OutputOptions, PaginationFlags, PaginationPresetConfig, PaginationState, ParseGlobOptions, ProjectionFlags, Range, Result, SortCriteria, StrictFlags, TimeWindowFlags, TimeWindowPresetConfig, ValidationError, VerbConfig, VerbFamily } from "./shared/@outfitter/cli-md9347gn";
2
+ export { VerbFamily, VerbConfig, ValidationError, TimeWindowPresetConfig, TimeWindowFlags, StrictFlags, SortCriteria, Result, Range, ProjectionFlags, ParseGlobOptions, PaginationState, PaginationPresetConfig, PaginationFlags, OutputOptions, OutputMode, NumericRange, NormalizeIdOptions, KeyValuePair, InteractionFlags, FlagPresetConfig, FlagPreset, FilterExpression, ExpandFileOptions, ExecutionPresetConfig, ExecutionFlags, ErrorCategory, DateRange, CursorOptions, ComposedPreset, CommandFlags, CommandConfig, CommandBuilder, CommandAction, ColorMode, ColorFlags, CollectIdsOptions, CancelledError, CLIConfig, CLI };
package/dist/types.js CHANGED
@@ -1,6 +1,4 @@
1
1
  // @bun
2
- import"./shared/@outfitter/cli-v1tzwxkt.js";
3
-
4
2
  // packages/cli/src/types.ts
5
3
  import {
6
4
  CancelledError,
@@ -0,0 +1,50 @@
1
+ import { CommandBuilder, VerbConfig, VerbFamily } from "./shared/@outfitter/cli-md9347gn";
2
+ /**
3
+ * Built-in verb families with standard primary verbs and aliases.
4
+ *
5
+ * These follow POSIX and modern CLI conventions:
6
+ * - `create` / `new` — Create a new resource
7
+ * - `modify` / `edit` / `update` — Modify an existing resource
8
+ * - `remove` / `delete` / `rm` — Remove a resource
9
+ * - `list` / `ls` — List resources
10
+ * - `show` / `get` / `view` — Show resource details
11
+ */
12
+ declare const VERB_FAMILIES: Readonly<Record<string, VerbFamily>>;
13
+ /**
14
+ * Resolve a verb family with optional project-level config overrides.
15
+ *
16
+ * @param family - Name of the verb family (e.g., "create", "modify")
17
+ * @param config - Optional overrides for primary verb, aliases, etc.
18
+ * @returns Resolved verb name and aliases
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * resolveVerb("modify"); // { name: "modify", aliases: ["edit", "update"] }
23
+ * resolveVerb("modify", { primary: "edit" }); // { name: "edit", aliases: ["update"] }
24
+ * resolveVerb("remove", { aliases: false }); // { name: "remove", aliases: [] }
25
+ * ```
26
+ */
27
+ declare function resolveVerb(family: string, config?: VerbConfig): {
28
+ name: string;
29
+ aliases: string[];
30
+ };
31
+ /**
32
+ * Apply verb conventions to a CommandBuilder.
33
+ *
34
+ * Adds aliases from the resolved verb family to the command builder.
35
+ *
36
+ * @param builder - CommandBuilder to apply aliases to
37
+ * @param family - Name of the verb family
38
+ * @param config - Optional overrides
39
+ * @returns The builder for chaining
40
+ *
41
+ * @example
42
+ * ```typescript
43
+ * const cmd = command("remove <id>")
44
+ * .description("Remove a resource");
45
+ * applyVerb(cmd, "remove");
46
+ * // Adds aliases: "delete", "rm"
47
+ * ```
48
+ */
49
+ declare function applyVerb(builder: CommandBuilder, family: string, config?: VerbConfig): CommandBuilder;
50
+ export { resolveVerb, applyVerb, VERB_FAMILIES };
package/dist/verbs.js ADDED
@@ -0,0 +1,61 @@
1
+ // @bun
2
+ // packages/cli/src/verbs.ts
3
+ var VERB_FAMILIES = {
4
+ create: {
5
+ primary: "create",
6
+ aliases: ["new"],
7
+ description: "Create a new resource"
8
+ },
9
+ modify: {
10
+ primary: "modify",
11
+ aliases: ["edit", "update"],
12
+ description: "Modify a resource"
13
+ },
14
+ remove: {
15
+ primary: "remove",
16
+ aliases: ["delete", "rm"],
17
+ description: "Remove a resource"
18
+ },
19
+ list: {
20
+ primary: "list",
21
+ aliases: ["ls"],
22
+ description: "List resources"
23
+ },
24
+ show: {
25
+ primary: "show",
26
+ aliases: ["get", "view"],
27
+ description: "Show details"
28
+ }
29
+ };
30
+ function resolveVerb(family, config) {
31
+ const def = VERB_FAMILIES[family];
32
+ if (!Object.hasOwn(VERB_FAMILIES, family) || def === undefined) {
33
+ throw new Error(`Unknown verb family: "${family}"`);
34
+ }
35
+ const name = config?.primary ?? def.primary;
36
+ if (config?.aliases === false) {
37
+ return { name, aliases: [] };
38
+ }
39
+ let aliases = [...def.aliases].filter((a) => a !== name);
40
+ if (config?.extraAliases) {
41
+ aliases.push(...config.extraAliases);
42
+ }
43
+ if (config?.excludeAliases) {
44
+ const exclude = new Set(config.excludeAliases);
45
+ aliases = aliases.filter((a) => !exclude.has(a));
46
+ }
47
+ aliases = [...new Set(aliases)];
48
+ return { name, aliases };
49
+ }
50
+ function applyVerb(builder, family, config) {
51
+ const { aliases } = resolveVerb(family, config);
52
+ for (const alias of aliases) {
53
+ builder.alias(alias);
54
+ }
55
+ return builder;
56
+ }
57
+ export {
58
+ resolveVerb,
59
+ applyVerb,
60
+ VERB_FAMILIES
61
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@outfitter/cli",
3
3
  "description": "Typed CLI runtime with terminal detection, rendering, output contracts, and input parsing",
4
- "version": "0.3.0",
4
+ "version": "0.4.1",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -9,58 +9,65 @@
9
9
  "module": "./dist/index.js",
10
10
  "types": "./dist/index.d.ts",
11
11
  "exports": {
12
- "./output": {
12
+ ".": {
13
13
  "import": {
14
- "types": "./dist/output.d.ts",
15
- "default": "./dist/output.js"
14
+ "types": "./dist/index.d.ts",
15
+ "default": "./dist/index.js"
16
16
  }
17
17
  },
18
- "./demo": {
18
+ "./actions": {
19
19
  "import": {
20
- "types": "./dist/demo/index.d.ts",
21
- "default": "./dist/demo/index.js"
20
+ "types": "./dist/actions.d.ts",
21
+ "default": "./dist/actions.js"
22
22
  }
23
23
  },
24
- "./borders": {
24
+ "./colors": {
25
+ "import": {
26
+ "types": "./dist/colors/index.d.ts",
27
+ "default": "./dist/colors/index.js"
28
+ }
29
+ },
30
+ "./command": {
25
31
  "import": {
26
- "types": "./dist/borders/index.d.ts",
27
- "default": "./dist/borders/index.js"
32
+ "types": "./dist/command.d.ts",
33
+ "default": "./dist/command.js"
28
34
  }
29
35
  },
30
- "./preset/full": {
36
+ "./completion": {
31
37
  "import": {
32
- "types": "./dist/preset/full.d.ts",
33
- "default": "./dist/preset/full.js"
38
+ "types": "./dist/completion.d.ts",
39
+ "default": "./dist/completion.js"
34
40
  }
35
41
  },
36
- "./preset/standard": {
42
+ "./flags": {
37
43
  "import": {
38
- "types": "./dist/preset/standard.d.ts",
39
- "default": "./dist/preset/standard.js"
44
+ "types": "./dist/flags.d.ts",
45
+ "default": "./dist/flags.js"
40
46
  }
41
47
  },
42
- "./box": {
48
+ "./input": {
43
49
  "import": {
44
- "types": "./dist/box/index.d.ts",
45
- "default": "./dist/box/index.js"
50
+ "types": "./dist/input.d.ts",
51
+ "default": "./dist/input.js"
46
52
  }
47
53
  },
48
- "./tree": {
54
+ "./output": {
49
55
  "import": {
50
- "types": "./dist/tree/index.d.ts",
51
- "default": "./dist/tree/index.js"
56
+ "types": "./dist/output.d.ts",
57
+ "default": "./dist/output.js"
52
58
  }
53
59
  },
54
- "./demo/section": {
60
+ "./package.json": "./package.json",
61
+ "./pagination": {
55
62
  "import": {
56
- "types": "./dist/demo/section.d.ts",
57
- "default": "./dist/demo/section.js"
63
+ "types": "./dist/pagination.d.ts",
64
+ "default": "./dist/pagination.js"
58
65
  }
59
66
  },
60
- "./render": {
67
+ "./query": {
61
68
  "import": {
62
- "types": "./dist/render/index.d.ts",
63
- "default": "./dist/render/index.js"
69
+ "types": "./dist/query.d.ts",
70
+ "default": "./dist/query.js"
64
71
  }
65
72
  },
66
73
  "./terminal": {
@@ -75,160 +82,10 @@
75
82
  "default": "./dist/terminal/detection.js"
76
83
  }
77
84
  },
78
- "./prompt/text": {
79
- "import": {
80
- "types": "./dist/prompt/text.d.ts",
81
- "default": "./dist/prompt/text.js"
82
- }
83
- },
84
- "./prompt/types": {
85
+ "./text": {
85
86
  "import": {
86
- "types": "./dist/prompt/types.d.ts",
87
- "default": "./dist/prompt/types.js"
88
- }
89
- },
90
- "./prompt/validators": {
91
- "import": {
92
- "types": "./dist/prompt/validators.d.ts",
93
- "default": "./dist/prompt/validators.js"
94
- }
95
- },
96
- "./prompt": {
97
- "import": {
98
- "types": "./dist/prompt/index.d.ts",
99
- "default": "./dist/prompt/index.js"
100
- }
101
- },
102
- "./streaming/spinner": {
103
- "import": {
104
- "types": "./dist/streaming/spinner.d.ts",
105
- "default": "./dist/streaming/spinner.js"
106
- }
107
- },
108
- "./streaming/ansi": {
109
- "import": {
110
- "types": "./dist/streaming/ansi.d.ts",
111
- "default": "./dist/streaming/ansi.js"
112
- }
113
- },
114
- "./streaming/writer": {
115
- "import": {
116
- "types": "./dist/streaming/writer.d.ts",
117
- "default": "./dist/streaming/writer.js"
118
- }
119
- },
120
- "./streaming": {
121
- "import": {
122
- "types": "./dist/streaming/index.d.ts",
123
- "default": "./dist/streaming/index.js"
124
- }
125
- },
126
- "./theme/presets/rounded": {
127
- "import": {
128
- "types": "./dist/theme/presets/rounded.d.ts",
129
- "default": "./dist/theme/presets/rounded.js"
130
- }
131
- },
132
- "./theme/presets/bold": {
133
- "import": {
134
- "types": "./dist/theme/presets/bold.d.ts",
135
- "default": "./dist/theme/presets/bold.js"
136
- }
137
- },
138
- "./theme/presets/minimal": {
139
- "import": {
140
- "types": "./dist/theme/presets/minimal.d.ts",
141
- "default": "./dist/theme/presets/minimal.js"
142
- }
143
- },
144
- "./theme/presets/default": {
145
- "import": {
146
- "types": "./dist/theme/presets/default.d.ts",
147
- "default": "./dist/theme/presets/default.js"
148
- }
149
- },
150
- "./theme/presets": {
151
- "import": {
152
- "types": "./dist/theme/presets/index.d.ts",
153
- "default": "./dist/theme/presets/index.js"
154
- }
155
- },
156
- "./prompt/confirm": {
157
- "import": {
158
- "types": "./dist/prompt/confirm.d.ts",
159
- "default": "./dist/prompt/confirm.js"
160
- }
161
- },
162
- "./prompt/select": {
163
- "import": {
164
- "types": "./dist/prompt/select.d.ts",
165
- "default": "./dist/prompt/select.js"
166
- }
167
- },
168
- "./prompt/group": {
169
- "import": {
170
- "types": "./dist/prompt/group.d.ts",
171
- "default": "./dist/prompt/group.js"
172
- }
173
- },
174
- "./list": {
175
- "import": {
176
- "types": "./dist/list/index.d.ts",
177
- "default": "./dist/list/index.js"
178
- }
179
- },
180
- "./colors": {
181
- "import": {
182
- "types": "./dist/colors/index.d.ts",
183
- "default": "./dist/colors/index.js"
184
- }
185
- },
186
- "./table": {
187
- "import": {
188
- "types": "./dist/table/index.d.ts",
189
- "default": "./dist/table/index.js"
190
- }
191
- },
192
- "./theme/context": {
193
- "import": {
194
- "types": "./dist/theme/context.d.ts",
195
- "default": "./dist/theme/context.js"
196
- }
197
- },
198
- "./theme/types": {
199
- "import": {
200
- "types": "./dist/theme/types.d.ts",
201
- "default": "./dist/theme/types.js"
202
- }
203
- },
204
- "./theme": {
205
- "import": {
206
- "types": "./dist/theme/index.d.ts",
207
- "default": "./dist/theme/index.js"
208
- }
209
- },
210
- "./theme/create": {
211
- "import": {
212
- "types": "./dist/theme/create.d.ts",
213
- "default": "./dist/theme/create.js"
214
- }
215
- },
216
- "./theme/resolve": {
217
- "import": {
218
- "types": "./dist/theme/resolve.d.ts",
219
- "default": "./dist/theme/resolve.js"
220
- }
221
- },
222
- "./pagination": {
223
- "import": {
224
- "types": "./dist/pagination.d.ts",
225
- "default": "./dist/pagination.js"
226
- }
227
- },
228
- "./input": {
229
- "import": {
230
- "types": "./dist/input.d.ts",
231
- "default": "./dist/input.js"
87
+ "types": "./dist/text.d.ts",
88
+ "default": "./dist/text.js"
232
89
  }
233
90
  },
234
91
  "./types": {
@@ -237,25 +94,12 @@
237
94
  "default": "./dist/types.js"
238
95
  }
239
96
  },
240
- "./actions": {
97
+ "./verbs": {
241
98
  "import": {
242
- "types": "./dist/actions.d.ts",
243
- "default": "./dist/actions.js"
99
+ "types": "./dist/verbs.d.ts",
100
+ "default": "./dist/verbs.js"
244
101
  }
245
- },
246
- ".": {
247
- "import": {
248
- "types": "./dist/index.d.ts",
249
- "default": "./dist/index.js"
250
- }
251
- },
252
- "./command": {
253
- "import": {
254
- "types": "./dist/command.d.ts",
255
- "default": "./dist/command.js"
256
- }
257
- },
258
- "./package.json": "./package.json"
102
+ }
259
103
  },
260
104
  "sideEffects": false,
261
105
  "scripts": {
@@ -269,20 +113,22 @@
269
113
  },
270
114
  "dependencies": {
271
115
  "@clack/prompts": "^0.11.0",
272
- "@outfitter/config": "0.3.0",
273
- "@outfitter/contracts": "0.2.0",
274
- "@outfitter/types": "0.2.0",
275
116
  "better-result": "^2.5.1",
276
117
  "commander": "^14.0.2"
277
118
  },
119
+ "peerDependencies": {
120
+ "@outfitter/config": ">=0.3.0",
121
+ "@outfitter/contracts": ">=0.2.0",
122
+ "@outfitter/types": ">=0.2.0",
123
+ "zod": "^4.3.5"
124
+ },
278
125
  "devDependencies": {
126
+ "@outfitter/config": "0.3.1",
127
+ "@outfitter/contracts": "0.3.0",
279
128
  "@types/bun": "^1.3.7",
280
129
  "@types/node": "^25.0.10",
281
130
  "typescript": "^5.9.3"
282
131
  },
283
- "peerDependencies": {
284
- "zod": "^4.3.5"
285
- },
286
132
  "engines": {
287
133
  "bun": ">=1.3.7"
288
134
  },
@@ -1,3 +0,0 @@
1
- import "../shared/@outfitter/cli-w7w7ta31";
2
- import { BORDERS, BorderCharacters, BorderStyle, LinePosition, drawHorizontalLine, getBorderCharacters } from "../shared/@outfitter/cli-fakncnjp";
3
- export { getBorderCharacters, drawHorizontalLine, LinePosition, BorderStyle, BorderCharacters, BORDERS };