@outfitter/cli 0.1.0-rc.1 → 0.1.0-rc.3

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 (266) hide show
  1. package/README.md +21 -32
  2. package/dist/actions.js +1 -1
  3. package/dist/borders/index.d.ts +3 -0
  4. package/dist/borders/index.js +13 -0
  5. package/dist/box/index.d.ts +4 -0
  6. package/dist/box/index.js +13 -0
  7. package/dist/cli.d.ts +2 -103
  8. package/dist/cli.js +4 -51
  9. package/dist/colors/index.d.ts +3 -0
  10. package/dist/colors/index.js +18 -0
  11. package/dist/command.d.ts +3 -37
  12. package/dist/command.js +5 -1
  13. package/dist/demo/index.d.ts +78 -0
  14. package/dist/demo/index.js +148 -0
  15. package/dist/demo/registry.d.ts +7 -0
  16. package/dist/demo/registry.js +28 -0
  17. package/dist/demo/renderers/borders.d.ts +7 -0
  18. package/dist/demo/renderers/borders.js +17 -0
  19. package/dist/demo/renderers/box.d.ts +7 -0
  20. package/dist/demo/renderers/box.js +18 -0
  21. package/dist/demo/renderers/colors.d.ts +7 -0
  22. package/dist/demo/renderers/colors.js +18 -0
  23. package/dist/demo/renderers/indicators.d.ts +7 -0
  24. package/dist/demo/renderers/indicators.js +17 -0
  25. package/dist/demo/renderers/list.d.ts +7 -0
  26. package/dist/demo/renderers/list.js +19 -0
  27. package/dist/demo/renderers/markdown.d.ts +7 -0
  28. package/dist/demo/renderers/markdown.js +18 -0
  29. package/dist/demo/renderers/progress.d.ts +7 -0
  30. package/dist/demo/renderers/progress.js +17 -0
  31. package/dist/demo/renderers/spinner.d.ts +7 -0
  32. package/dist/demo/renderers/spinner.js +19 -0
  33. package/dist/demo/renderers/table.d.ts +7 -0
  34. package/dist/demo/renderers/table.js +19 -0
  35. package/dist/demo/renderers/text.d.ts +7 -0
  36. package/dist/demo/renderers/text.js +16 -0
  37. package/dist/demo/renderers/tree.d.ts +7 -0
  38. package/dist/demo/renderers/tree.js +18 -0
  39. package/dist/demo/section.d.ts +5 -0
  40. package/dist/demo/section.js +23 -0
  41. package/dist/demo/templates.d.ts +4 -0
  42. package/dist/demo/templates.js +10 -0
  43. package/dist/demo/types.d.ts +3 -0
  44. package/dist/demo/types.js +8 -0
  45. package/dist/index.d.ts +5 -607
  46. package/dist/index.js +10 -44
  47. package/dist/input.d.ts +9 -123
  48. package/dist/input.js +2 -3
  49. package/dist/list/index.d.ts +3 -0
  50. package/dist/list/index.js +9 -0
  51. package/dist/output.d.ts +2 -68
  52. package/dist/output.js +4 -150
  53. package/dist/pagination.d.ts +1 -34
  54. package/dist/pagination.js +1 -1
  55. package/dist/preset/full.d.ts +14 -0
  56. package/dist/preset/full.js +41 -0
  57. package/dist/preset/standard.d.ts +11 -0
  58. package/dist/preset/standard.js +30 -0
  59. package/dist/prompt/confirm.d.ts +4 -0
  60. package/dist/prompt/confirm.js +9 -0
  61. package/dist/prompt/group.d.ts +4 -0
  62. package/dist/prompt/group.js +9 -0
  63. package/dist/prompt/index.d.ts +7 -0
  64. package/dist/prompt/index.js +32 -0
  65. package/dist/prompt/select.d.ts +4 -0
  66. package/dist/prompt/select.js +11 -0
  67. package/dist/prompt/text.d.ts +4 -0
  68. package/dist/prompt/text.js +11 -0
  69. package/dist/prompt/types.d.ts +3 -0
  70. package/dist/prompt/types.js +8 -0
  71. package/dist/prompt/validators.d.ts +2 -0
  72. package/dist/prompt/validators.js +8 -0
  73. package/dist/render/borders.d.ts +2 -0
  74. package/dist/render/borders.js +15 -0
  75. package/dist/render/box.d.ts +3 -0
  76. package/dist/render/box.js +23 -0
  77. package/dist/render/colors.d.ts +2 -0
  78. package/dist/render/colors.js +20 -0
  79. package/dist/render/date.d.ts +2 -0
  80. package/dist/render/date.js +12 -0
  81. package/dist/render/format-relative.d.ts +2 -0
  82. package/dist/render/format-relative.js +8 -0
  83. package/dist/render/format.d.ts +2 -0
  84. package/dist/render/format.js +10 -0
  85. package/dist/render/heading.d.ts +3 -0
  86. package/dist/render/heading.js +14 -0
  87. package/dist/render/index.d.ts +32 -0
  88. package/dist/render/index.js +235 -0
  89. package/dist/render/indicators.d.ts +2 -0
  90. package/dist/render/indicators.js +14 -0
  91. package/dist/render/json.d.ts +2 -0
  92. package/dist/render/json.js +10 -0
  93. package/dist/render/layout.d.ts +5 -0
  94. package/dist/render/layout.js +25 -0
  95. package/dist/render/list.d.ts +2 -0
  96. package/dist/render/list.js +8 -0
  97. package/dist/render/markdown.d.ts +2 -0
  98. package/dist/render/markdown.js +10 -0
  99. package/dist/render/progress.d.ts +2 -0
  100. package/dist/render/progress.js +8 -0
  101. package/dist/render/separator.d.ts +3 -0
  102. package/dist/render/separator.js +14 -0
  103. package/dist/render/shapes.d.ts +2 -0
  104. package/dist/render/shapes.js +35 -0
  105. package/dist/render/spinner.d.ts +2 -0
  106. package/dist/render/spinner.js +12 -0
  107. package/dist/render/stack.d.ts +3 -0
  108. package/dist/render/stack.js +38 -0
  109. package/dist/render/table.d.ts +3 -0
  110. package/dist/render/table.js +12 -0
  111. package/dist/render/text.d.ts +2 -0
  112. package/dist/render/text.js +27 -0
  113. package/dist/render/tree.d.ts +2 -0
  114. package/dist/render/tree.js +10 -0
  115. package/dist/render/types.d.ts +2 -0
  116. package/dist/render/types.js +1 -0
  117. package/dist/shared/@outfitter/cli-0ggcy7fa.js +20 -0
  118. package/dist/shared/@outfitter/cli-0psys2vm.js +7 -0
  119. package/dist/shared/@outfitter/cli-1bghjef6.js +352 -0
  120. package/dist/shared/@outfitter/cli-1kwbnt86.d.ts +45 -0
  121. package/dist/shared/@outfitter/cli-2g8bx1aq.d.ts +50 -0
  122. package/dist/shared/@outfitter/cli-33e97cjs.d.ts +42 -0
  123. package/dist/shared/@outfitter/cli-34fqr7bp.js +37 -0
  124. package/dist/shared/@outfitter/cli-3b7ed3rm.d.ts +97 -0
  125. package/dist/shared/@outfitter/cli-3dxmmy4c.d.ts +20 -0
  126. package/dist/shared/@outfitter/cli-3f12z5kf.d.ts +83 -0
  127. package/dist/shared/@outfitter/cli-3hp8qwx3.js +11 -0
  128. package/dist/shared/@outfitter/cli-3t2zaenc.d.ts +59 -0
  129. package/dist/shared/@outfitter/cli-4cb5g831.d.ts +147 -0
  130. package/dist/shared/@outfitter/cli-4w2a1rfy.d.ts +23 -0
  131. package/dist/shared/@outfitter/cli-4x6pqnez.js +20 -0
  132. package/dist/shared/@outfitter/cli-671sxkhj.js +146 -0
  133. package/dist/shared/@outfitter/cli-6bztk73z.d.ts +51 -0
  134. package/dist/shared/@outfitter/cli-6fxffp8k.js +1 -0
  135. package/dist/shared/@outfitter/cli-6j9qynm8.js +118 -0
  136. package/dist/shared/@outfitter/cli-6m988kh0.d.ts +61 -0
  137. package/dist/shared/@outfitter/cli-72kg550t.d.ts +53 -0
  138. package/dist/shared/@outfitter/cli-74ba31gz.js +134 -0
  139. package/dist/shared/@outfitter/cli-7gnrb8cr.js +214 -0
  140. package/dist/shared/@outfitter/cli-7na6p4fs.d.ts +59 -0
  141. package/dist/shared/@outfitter/cli-7nm6edvh.d.ts +17 -0
  142. package/dist/shared/@outfitter/cli-85fg2vr5.js +123 -0
  143. package/dist/shared/@outfitter/cli-8a8xrzhy.js +20 -0
  144. package/dist/shared/@outfitter/cli-8aa1vhdn.d.ts +119 -0
  145. package/dist/shared/@outfitter/cli-8bwaw3pz.js +7 -0
  146. package/dist/shared/@outfitter/cli-8j5k6mr3.js +71 -0
  147. package/dist/shared/@outfitter/cli-8rx4g3s5.d.ts +41 -0
  148. package/dist/shared/@outfitter/cli-8xsmsbbd.d.ts +223 -0
  149. package/dist/shared/@outfitter/cli-96b2p4td.d.ts +56 -0
  150. package/dist/shared/@outfitter/cli-9khk3cbq.d.ts +190 -0
  151. package/dist/shared/@outfitter/cli-9mtjjykw.js +67 -0
  152. package/dist/shared/@outfitter/cli-9nbyj2bt.js +128 -0
  153. package/dist/shared/@outfitter/cli-a4q87517.d.ts +64 -0
  154. package/dist/shared/@outfitter/cli-afhjqmg3.js +63 -0
  155. package/dist/shared/@outfitter/cli-an9j0h80.js +117 -0
  156. package/dist/shared/@outfitter/cli-ay411nbr.js +122 -0
  157. package/dist/shared/@outfitter/cli-b0tzqgnf.d.ts +132 -0
  158. package/dist/shared/@outfitter/cli-b5c2k0d7.js +39 -0
  159. package/dist/shared/@outfitter/cli-b5epywry.js +1 -0
  160. package/dist/shared/@outfitter/cli-bc17qeh2.js +19 -0
  161. package/dist/shared/@outfitter/cli-bcmcaz1b.js +23 -0
  162. package/dist/shared/@outfitter/cli-bf3vma4q.js +61 -0
  163. package/dist/shared/@outfitter/cli-c8q4f71g.js +144 -0
  164. package/dist/shared/@outfitter/cli-c9knfqn5.d.ts +30 -0
  165. package/dist/shared/@outfitter/cli-cf1xexgn.d.ts +53 -0
  166. package/dist/shared/@outfitter/cli-cf2s94s1.d.ts +42 -0
  167. package/dist/shared/@outfitter/cli-cs45xd6q.js +59 -0
  168. package/dist/shared/@outfitter/cli-d7jpshq5.d.ts +128 -0
  169. package/dist/shared/@outfitter/cli-d9ad0rqj.js +75 -0
  170. package/dist/shared/@outfitter/cli-daw296mv.js +61 -0
  171. package/dist/shared/@outfitter/cli-e5ms1y0x.d.ts +91 -0
  172. package/dist/shared/@outfitter/cli-e73v3qqy.d.ts +93 -0
  173. package/dist/shared/@outfitter/cli-efy6jfcj.js +52 -0
  174. package/dist/shared/@outfitter/cli-en6zn6sj.js +1 -0
  175. package/dist/shared/@outfitter/cli-ep2cvtk8.js +48 -0
  176. package/dist/shared/@outfitter/cli-evx7qcp1.d.ts +300 -0
  177. package/dist/shared/@outfitter/cli-f75h8e94.js +7 -0
  178. package/dist/shared/@outfitter/cli-fakncnjp.d.ts +106 -0
  179. package/dist/shared/@outfitter/cli-feb5j90n.js +94 -0
  180. package/dist/shared/@outfitter/cli-h20jc0bs.d.ts +66 -0
  181. package/dist/shared/@outfitter/cli-hnpbqmc8.d.ts +328 -0
  182. package/dist/shared/@outfitter/cli-j19a91ck.js +30 -0
  183. package/dist/shared/@outfitter/cli-j4n8gaf3.js +95 -0
  184. package/dist/shared/@outfitter/cli-jejfypgf.js +85 -0
  185. package/dist/shared/@outfitter/cli-jhcdwvpn.js +135 -0
  186. package/dist/shared/@outfitter/cli-jjemfdta.js +85 -0
  187. package/dist/shared/@outfitter/cli-kc84wmch.js +267 -0
  188. package/dist/shared/@outfitter/cli-ktqme80d.js +7 -0
  189. package/dist/shared/@outfitter/cli-mhamvbty.d.ts +34 -0
  190. package/dist/shared/@outfitter/cli-mq0jp15z.js +1 -0
  191. package/dist/shared/@outfitter/cli-mymyavvj.d.ts +26 -0
  192. package/dist/shared/@outfitter/cli-n17gt1dz.js +19 -0
  193. package/dist/shared/@outfitter/cli-n9dbh0hp.js +51 -0
  194. package/dist/shared/@outfitter/cli-nvvc92c8.js +128 -0
  195. package/dist/shared/@outfitter/cli-p1m5dhrs.js +169 -0
  196. package/dist/shared/@outfitter/cli-p38sfxyk.js +25 -0
  197. package/dist/shared/@outfitter/cli-p3dqm1vd.js +22 -0
  198. package/dist/shared/@outfitter/cli-p9j1phge.js +20 -0
  199. package/dist/shared/@outfitter/cli-pkxmzavm.js +62 -0
  200. package/dist/shared/@outfitter/cli-q8r6jarq.d.ts +24 -0
  201. package/dist/shared/@outfitter/cli-qj83y5wj.d.ts +71 -0
  202. package/dist/shared/@outfitter/cli-qjfc3j11.d.ts +112 -0
  203. package/dist/shared/@outfitter/cli-qp4cbhqr.js +70 -0
  204. package/dist/shared/@outfitter/cli-s0kkx9m1.d.ts +164 -0
  205. package/dist/shared/@outfitter/cli-snxj55n6.js +43 -0
  206. package/dist/shared/@outfitter/cli-swwxvjvm.d.ts +24 -0
  207. package/dist/shared/@outfitter/cli-sx67mmfx.d.ts +98 -0
  208. package/dist/shared/@outfitter/cli-tarpsa8a.js +30 -0
  209. package/dist/shared/@outfitter/cli-thvzhjd1.js +126 -0
  210. package/dist/shared/@outfitter/cli-tqewy503.d.ts +36 -0
  211. package/dist/shared/@outfitter/cli-ttt7r0j7.d.ts +253 -0
  212. package/dist/shared/@outfitter/cli-tvw1xrdj.js +20 -0
  213. package/dist/shared/@outfitter/cli-v1tzwxkt.js +32 -0
  214. package/dist/shared/@outfitter/cli-vd60dj65.js +1 -0
  215. package/dist/shared/@outfitter/cli-vp88gxev.js +279 -0
  216. package/dist/shared/@outfitter/cli-vstbkzky.d.ts +74 -0
  217. package/dist/shared/@outfitter/cli-vtg0sqk2.d.ts +54 -0
  218. package/dist/shared/@outfitter/cli-w5y3xepp.js +20 -0
  219. package/dist/shared/@outfitter/cli-x4cavvc0.js +1 -0
  220. package/dist/shared/@outfitter/cli-xep6v2c0.js +52 -0
  221. package/dist/shared/@outfitter/cli-xg5y5fhk.js +86 -0
  222. package/dist/shared/@outfitter/cli-xsaheemc.d.ts +248 -0
  223. package/dist/shared/@outfitter/cli-xvqtqjxk.js +82 -0
  224. package/dist/shared/@outfitter/cli-y25tt8nc.d.ts +48 -0
  225. package/dist/shared/@outfitter/cli-zact3325.js +152 -0
  226. package/dist/shared/@outfitter/cli-zx598p8q.d.ts +26 -0
  227. package/dist/streaming/ansi.d.ts +2 -0
  228. package/dist/streaming/ansi.js +8 -0
  229. package/dist/streaming/index.d.ts +4 -0
  230. package/dist/streaming/index.js +17 -0
  231. package/dist/streaming/spinner.d.ts +3 -0
  232. package/dist/streaming/spinner.js +10 -0
  233. package/dist/streaming/writer.d.ts +2 -0
  234. package/dist/streaming/writer.js +9 -0
  235. package/dist/table/index.d.ts +4 -0
  236. package/dist/table/index.js +13 -0
  237. package/dist/terminal/detection.d.ts +2 -0
  238. package/dist/terminal/detection.js +23 -0
  239. package/dist/terminal/index.d.ts +2 -0
  240. package/dist/terminal/index.js +24 -0
  241. package/dist/theme/context.d.ts +9 -0
  242. package/dist/theme/context.js +14 -0
  243. package/dist/theme/create.d.ts +8 -0
  244. package/dist/theme/create.js +12 -0
  245. package/dist/theme/index.d.ts +17 -0
  246. package/dist/theme/index.js +42 -0
  247. package/dist/theme/presets/bold.d.ts +8 -0
  248. package/dist/theme/presets/bold.js +12 -0
  249. package/dist/theme/presets/default.d.ts +8 -0
  250. package/dist/theme/presets/default.js +11 -0
  251. package/dist/theme/presets/index.d.ts +12 -0
  252. package/dist/theme/presets/index.js +24 -0
  253. package/dist/theme/presets/minimal.d.ts +8 -0
  254. package/dist/theme/presets/minimal.js +12 -0
  255. package/dist/theme/presets/rounded.d.ts +8 -0
  256. package/dist/theme/presets/rounded.js +12 -0
  257. package/dist/theme/resolve.d.ts +8 -0
  258. package/dist/theme/resolve.js +11 -0
  259. package/dist/theme/types.d.ts +7 -0
  260. package/dist/theme/types.js +1 -0
  261. package/dist/tree/index.d.ts +3 -0
  262. package/dist/tree/index.js +11 -0
  263. package/dist/types.d.ts +1 -252
  264. package/dist/types.js +1 -1
  265. package/package.json +228 -20
  266. package/dist/shared/@outfitter/cli-4yy82cmp.js +0 -20
package/README.md CHANGED
@@ -11,7 +11,9 @@ bun add @outfitter/cli
11
11
  ## Quick Start
12
12
 
13
13
  ```typescript
14
- import { output, collectIds, loadCursor, saveCursor } from "@outfitter/cli";
14
+ import { output } from "@outfitter/cli/output";
15
+ import { collectIds } from "@outfitter/cli/input";
16
+ import { loadCursor, saveCursor } from "@outfitter/cli/pagination";
15
17
 
16
18
  // Output data with automatic mode detection
17
19
  output({ id: "123", name: "Example" });
@@ -37,7 +39,7 @@ Output data to the console with automatic mode selection.
37
39
  Defaults to human-friendly output for TTY, JSON for non-TTY. Override via `mode` option or `OUTFITTER_JSON`/`OUTFITTER_JSONL` environment variables.
38
40
 
39
41
  ```typescript
40
- import { output } from "@outfitter/cli";
42
+ import { output } from "@outfitter/cli/output";
41
43
 
42
44
  // Basic usage - mode auto-detected
43
45
  output(results);
@@ -73,7 +75,7 @@ output(errors, { stream: process.stderr });
73
75
  Exit the process with an error message and appropriate exit code.
74
76
 
75
77
  ```typescript
76
- import { exitWithError } from "@outfitter/cli";
78
+ import { exitWithError } from "@outfitter/cli/output";
77
79
 
78
80
  try {
79
81
  await riskyOperation();
@@ -89,7 +91,7 @@ try {
89
91
  Collect IDs from various input formats: space-separated, comma-separated, repeated flags, `@file`, and stdin.
90
92
 
91
93
  ```typescript
92
- import { collectIds } from "@outfitter/cli";
94
+ import { collectIds } from "@outfitter/cli/input";
93
95
 
94
96
  // All these produce the same result:
95
97
  // myapp show id1 id2 id3
@@ -116,7 +118,7 @@ const ids = await collectIds(args.ids, {
116
118
  Expand `@file` references to file contents. Returns input unchanged if not a file reference.
117
119
 
118
120
  ```typescript
119
- import { expandFileArg } from "@outfitter/cli";
121
+ import { expandFileArg } from "@outfitter/cli/input";
120
122
 
121
123
  // myapp create @template.md
122
124
  const content = await expandFileArg(args.content);
@@ -141,7 +143,7 @@ const content = await expandFileArg(args.content, {
141
143
  Parse and expand glob patterns using `Bun.Glob`.
142
144
 
143
145
  ```typescript
144
- import { parseGlob } from "@outfitter/cli";
146
+ import { parseGlob } from "@outfitter/cli/input";
145
147
 
146
148
  const files = await parseGlob("src/**/*.ts", {
147
149
  cwd: workspaceRoot,
@@ -165,7 +167,7 @@ const files = await parseGlob("src/**/*.ts", {
165
167
  Parse `key=value` pairs from CLI input.
166
168
 
167
169
  ```typescript
168
- import { parseKeyValue } from "@outfitter/cli";
170
+ import { parseKeyValue } from "@outfitter/cli/input";
169
171
 
170
172
  // --set key=value --set key2=value2
171
173
  // --set key=value,key2=value2
@@ -182,7 +184,7 @@ if (result.isOk()) {
182
184
  Parse numeric or date range inputs.
183
185
 
184
186
  ```typescript
185
- import { parseRange } from "@outfitter/cli";
187
+ import { parseRange } from "@outfitter/cli/input";
186
188
 
187
189
  // Numeric range
188
190
  const numResult = parseRange("1-10", "number");
@@ -202,7 +204,7 @@ const single = parseRange("5", "number");
202
204
  Parse filter expressions from CLI input.
203
205
 
204
206
  ```typescript
205
- import { parseFilter } from "@outfitter/cli";
207
+ import { parseFilter } from "@outfitter/cli/input";
206
208
 
207
209
  const result = parseFilter("status:active,priority:>=high,!archived:true");
208
210
 
@@ -232,7 +234,7 @@ if (result.isOk()) {
232
234
  Parse sort specification from CLI input.
233
235
 
234
236
  ```typescript
235
- import { parseSortSpec } from "@outfitter/cli";
237
+ import { parseSortSpec } from "@outfitter/cli/input";
236
238
 
237
239
  const result = parseSortSpec("modified:desc,title:asc");
238
240
 
@@ -249,7 +251,7 @@ if (result.isOk()) {
249
251
  Normalize an identifier with validation.
250
252
 
251
253
  ```typescript
252
- import { normalizeId } from "@outfitter/cli";
254
+ import { normalizeId } from "@outfitter/cli/input";
253
255
 
254
256
  const result = normalizeId(" MY-ID ", {
255
257
  trim: true,
@@ -279,7 +281,7 @@ if (result.isOk()) {
279
281
  Prompt for confirmation before destructive operations. Respects `--yes` flag for non-interactive mode.
280
282
 
281
283
  ```typescript
282
- import { confirmDestructive } from "@outfitter/cli";
284
+ import { confirmDestructive } from "@outfitter/cli/input";
283
285
 
284
286
  const result = await confirmDestructive({
285
287
  message: "Delete 5 notes?",
@@ -311,7 +313,7 @@ $XDG_STATE_HOME/{toolName}/cursors/{command}[/{context}]/cursor.json
311
313
  Load persisted pagination state for a command.
312
314
 
313
315
  ```typescript
314
- import { loadCursor } from "@outfitter/cli";
316
+ import { loadCursor } from "@outfitter/cli/pagination";
315
317
 
316
318
  const state = loadCursor({
317
319
  command: "list",
@@ -331,7 +333,7 @@ if (state) {
331
333
  Save pagination state for a command.
332
334
 
333
335
  ```typescript
334
- import { saveCursor } from "@outfitter/cli";
336
+ import { saveCursor } from "@outfitter/cli/pagination";
335
337
 
336
338
  const results = await listNotes({ limit: 20 });
337
339
 
@@ -348,7 +350,7 @@ if (results.hasMore) {
348
350
  Clear persisted pagination state for a command.
349
351
 
350
352
  ```typescript
351
- import { clearCursor } from "@outfitter/cli";
353
+ import { clearCursor } from "@outfitter/cli/pagination";
352
354
 
353
355
  // User passed --reset flag
354
356
  if (flags.reset) {
@@ -412,23 +414,10 @@ exitWithError(error); // Exits with code 2
412
414
  All types are exported for TypeScript consumers:
413
415
 
414
416
  ```typescript
415
- import type {
416
- // Core types
417
- CLIConfig,
418
- CommandConfig,
419
- CommandAction,
420
- CommandFlags,
421
- // Output types
422
- OutputMode,
423
- OutputOptions,
424
- // Input types
425
- CollectIdsOptions,
426
- ExpandFileOptions,
427
- ParseGlobOptions,
428
- // Pagination types
429
- PaginationState,
430
- CursorOptions,
431
- } from "@outfitter/cli";
417
+ import type { CLIConfig, CommandConfig, CommandAction, CommandFlags } from "@outfitter/cli/command";
418
+ import type { OutputMode, OutputOptions } from "@outfitter/cli/output";
419
+ import type { CollectIdsOptions, ExpandFileOptions, ParseGlobOptions } from "@outfitter/cli/input";
420
+ import type { PaginationState, CursorOptions } from "@outfitter/cli/pagination";
432
421
  ```
433
422
 
434
423
  ## License
package/dist/actions.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./shared/@outfitter/cli-4yy82cmp.js";
2
+ import"./shared/@outfitter/cli-v1tzwxkt.js";
3
3
 
4
4
  // packages/cli/src/actions.ts
5
5
  import {
@@ -0,0 +1,3 @@
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 };
@@ -0,0 +1,13 @@
1
+ // @bun
2
+ import"../shared/@outfitter/cli-ktqme80d.js";
3
+ import {
4
+ BORDERS,
5
+ drawHorizontalLine,
6
+ getBorderCharacters
7
+ } from "../shared/@outfitter/cli-85fg2vr5.js";
8
+ import"../shared/@outfitter/cli-v1tzwxkt.js";
9
+ export {
10
+ getBorderCharacters,
11
+ drawHorizontalLine,
12
+ BORDERS
13
+ };
@@ -0,0 +1,4 @@
1
+ import "../shared/@outfitter/cli-zfqz333z";
2
+ import { BoxAlign, BoxOptions, renderBox } from "../shared/@outfitter/cli-8xsmsbbd";
3
+ import "../shared/@outfitter/cli-fakncnjp";
4
+ export { renderBox, BoxOptions, BoxAlign };
@@ -0,0 +1,13 @@
1
+ // @bun
2
+ import"../shared/@outfitter/cli-f75h8e94.js";
3
+ import {
4
+ renderBox
5
+ } from "../shared/@outfitter/cli-vp88gxev.js";
6
+ import"../shared/@outfitter/cli-jjemfdta.js";
7
+ import"../shared/@outfitter/cli-85fg2vr5.js";
8
+ import"../shared/@outfitter/cli-9nbyj2bt.js";
9
+ import"../shared/@outfitter/cli-d9ad0rqj.js";
10
+ import"../shared/@outfitter/cli-v1tzwxkt.js";
11
+ export {
12
+ renderBox
13
+ };
package/dist/cli.d.ts CHANGED
@@ -1,104 +1,3 @@
1
- import { Command } from "commander";
2
- /**
3
- * Configuration for creating a CLI instance.
4
- *
5
- * @example
6
- * ```typescript
7
- * const config: CLIConfig = {
8
- * name: "waymark",
9
- * version: "1.0.0",
10
- * description: "A note management CLI",
11
- * };
12
- * ```
13
- */
14
- interface CLIConfig {
15
- /** CLI name (used in help output and error messages) */
16
- readonly name: string;
17
- /** CLI version (displayed with --version) */
18
- readonly version: string;
19
- /** CLI description (displayed in help output) */
20
- readonly description?: string;
21
- /** Custom error handler */
22
- readonly onError?: (error: Error) => void;
23
- /** Custom exit handler (defaults to process.exit) */
24
- readonly onExit?: (code: number) => never;
25
- }
26
- /**
27
- * CLI instance returned by createCLI.
28
- */
29
- interface CLI {
30
- /** Register a command with the CLI */
31
- register(command: CommandBuilder | Command): this;
32
- /** Parse arguments and execute the matched command */
33
- parse(argv?: readonly string[]): Promise<void>;
34
- /** Get the underlying Commander program */
35
- readonly program: Command;
36
- }
37
- /**
38
- * Action function executed when a command is invoked.
39
- *
40
- * @typeParam TFlags - Type of parsed command flags
41
- */
42
- type CommandAction<TFlags extends CommandFlags = CommandFlags> = (context: {
43
- /** Parsed command-line arguments */
44
- readonly args: readonly string[];
45
- /** Parsed command flags */
46
- readonly flags: TFlags;
47
- /** Raw Commander command instance */
48
- readonly command: Command;
49
- }) => Promise<void> | void;
50
- /**
51
- * Base type for command flags.
52
- * All flag types must extend this.
53
- */
54
- type CommandFlags = Record<string, unknown>;
55
- /**
56
- * Builder interface for constructing commands fluently.
57
- */
58
- interface CommandBuilder {
59
- /** Set command description */
60
- description(text: string): this;
61
- /** Add a command option/flag */
62
- option(flags: string, description: string, defaultValue?: unknown): this;
63
- /** Add a required option */
64
- requiredOption(flags: string, description: string, defaultValue?: unknown): this;
65
- /** Add command aliases */
66
- alias(alias: string): this;
67
- /** Set the action handler */
68
- action<TFlags extends CommandFlags = CommandFlags>(handler: CommandAction<TFlags>): this;
69
- /** Build the underlying Commander command */
70
- build(): Command;
71
- }
72
- /**
73
- * Create a new CLI instance with the given configuration.
74
- *
75
- * The CLI wraps Commander.js with typed helpers, output contract enforcement,
76
- * and pagination state management.
77
- *
78
- * @param config - CLI configuration options
79
- * @returns A CLI instance ready for command registration
80
- *
81
- * @example
82
- * ```typescript
83
- * import { createCLI, command, output } from "@outfitter/cli";
84
- *
85
- * const cli = createCLI({
86
- * name: "waymark",
87
- * version: "1.0.0",
88
- * description: "A note management CLI",
89
- * });
90
- *
91
- * cli.register(
92
- * command("list")
93
- * .description("List all notes")
94
- * .action(async () => {
95
- * const notes = await getNotes();
96
- * output(notes);
97
- * })
98
- * );
99
- *
100
- * await cli.parse();
101
- * ```
102
- */
103
- declare function createCLI(config: CLIConfig): CLI;
1
+ import { createCLI } from "./shared/@outfitter/cli-mhamvbty";
2
+ import "./shared/@outfitter/cli-ttt7r0j7";
104
3
  export { createCLI };
package/dist/cli.js CHANGED
@@ -1,55 +1,8 @@
1
1
  // @bun
2
- import"./shared/@outfitter/cli-4yy82cmp.js";
3
-
4
- // packages/cli/src/cli.ts
5
- import { Command } from "commander";
6
- function isCommanderHelp(error) {
7
- return error.code === "commander.helpDisplayed" || error.code === "commander.version" || error.code === "commander.help";
8
- }
9
- function createCLI(config) {
10
- const program = new Command;
11
- program.name(config.name).version(config.version);
12
- if (config.description) {
13
- program.description(config.description);
14
- }
15
- const exit = config.onExit ?? ((code) => process.exit(code));
16
- program.exitOverride((error) => {
17
- if (isCommanderHelp(error)) {
18
- exit(0);
19
- }
20
- if (config.onError) {
21
- config.onError(error);
22
- }
23
- const exitCode = typeof error.exitCode === "number" && Number.isFinite(error.exitCode) ? error.exitCode : 1;
24
- exit(exitCode);
25
- });
26
- const parse = async (argv) => {
27
- try {
28
- await program.parseAsync(argv ?? process.argv);
29
- } catch (error) {
30
- const err = error instanceof Error ? error : new Error(String(error));
31
- if (config.onError) {
32
- config.onError(err);
33
- }
34
- const errorExitCode = error.exitCode;
35
- const exitCode = typeof errorExitCode === "number" ? errorExitCode : 1;
36
- exit(exitCode);
37
- }
38
- };
39
- const cli = {
40
- program,
41
- register: (builderOrCommand) => {
42
- if ("build" in builderOrCommand) {
43
- program.addCommand(builderOrCommand.build());
44
- } else {
45
- program.addCommand(builderOrCommand);
46
- }
47
- return cli;
48
- },
49
- parse
50
- };
51
- return cli;
52
- }
2
+ import {
3
+ createCLI
4
+ } from "./shared/@outfitter/cli-efy6jfcj.js";
5
+ import"./shared/@outfitter/cli-v1tzwxkt.js";
53
6
  export {
54
7
  createCLI
55
8
  };
@@ -0,0 +1,3 @@
1
+ import "../shared/@outfitter/cli-qz47jk6d";
2
+ import { ANSI, ColorName, Theme, TokenOptions, Tokens, applyColor, createTheme, createTokens, resolveTokenColorEnabled } from "../shared/@outfitter/cli-xsaheemc";
3
+ export { resolveTokenColorEnabled, createTokens, createTheme, applyColor, Tokens, TokenOptions, Theme, ColorName, ANSI };
@@ -0,0 +1,18 @@
1
+ // @bun
2
+ import"../shared/@outfitter/cli-0psys2vm.js";
3
+ import {
4
+ ANSI,
5
+ applyColor,
6
+ createTheme,
7
+ createTokens,
8
+ resolveTokenColorEnabled
9
+ } from "../shared/@outfitter/cli-9nbyj2bt.js";
10
+ import"../shared/@outfitter/cli-d9ad0rqj.js";
11
+ import"../shared/@outfitter/cli-v1tzwxkt.js";
12
+ export {
13
+ resolveTokenColorEnabled,
14
+ createTokens,
15
+ createTheme,
16
+ applyColor,
17
+ ANSI
18
+ };
package/dist/command.d.ts CHANGED
@@ -1,39 +1,5 @@
1
- import { Command } from "commander";
2
- /**
3
- * Action function executed when a command is invoked.
4
- *
5
- * @typeParam TFlags - Type of parsed command flags
6
- */
7
- type CommandAction<TFlags extends CommandFlags = CommandFlags> = (context: {
8
- /** Parsed command-line arguments */
9
- readonly args: readonly string[];
10
- /** Parsed command flags */
11
- readonly flags: TFlags;
12
- /** Raw Commander command instance */
13
- readonly command: Command;
14
- }) => Promise<void> | void;
15
- /**
16
- * Base type for command flags.
17
- * All flag types must extend this.
18
- */
19
- type CommandFlags = Record<string, unknown>;
20
- /**
21
- * Builder interface for constructing commands fluently.
22
- */
23
- interface CommandBuilder {
24
- /** Set command description */
25
- description(text: string): this;
26
- /** Add a command option/flag */
27
- option(flags: string, description: string, defaultValue?: unknown): this;
28
- /** Add a required option */
29
- requiredOption(flags: string, description: string, defaultValue?: unknown): this;
30
- /** Add command aliases */
31
- alias(alias: string): this;
32
- /** Set the action handler */
33
- action<TFlags extends CommandFlags = CommandFlags>(handler: CommandAction<TFlags>): this;
34
- /** Build the underlying Commander command */
35
- build(): Command;
36
- }
1
+ import { createCLI } from "./shared/@outfitter/cli-mhamvbty";
2
+ import { CommandBuilder } from "./shared/@outfitter/cli-ttt7r0j7";
37
3
  /**
38
4
  * Create a new command builder with the given name.
39
5
  *
@@ -71,4 +37,4 @@ interface CommandBuilder {
71
37
  * ```
72
38
  */
73
39
  declare function command(name: string): CommandBuilder;
74
- export { command };
40
+ export { createCLI, command };
package/dist/command.js CHANGED
@@ -1,5 +1,8 @@
1
1
  // @bun
2
- import"./shared/@outfitter/cli-4yy82cmp.js";
2
+ import {
3
+ createCLI
4
+ } from "./shared/@outfitter/cli-efy6jfcj.js";
5
+ import"./shared/@outfitter/cli-v1tzwxkt.js";
3
6
 
4
7
  // packages/cli/src/command.ts
5
8
  import { Command } from "commander";
@@ -42,5 +45,6 @@ function command(name) {
42
45
  return new CommandBuilderImpl(name);
43
46
  }
44
47
  export {
48
+ createCLI,
45
49
  command
46
50
  };
@@ -0,0 +1,78 @@
1
+ import { BORDER_STYLE_META, LIST_STYLE_META, PRIMITIVE_META, SPINNER_STYLE_META, THEME_METHOD_META, getBorderStyles, getListStyles, getPrimitiveIds, getSpinnerStyles, getThemeMethodsByCategory } from "../shared/@outfitter/cli-96b2p4td";
2
+ import "../shared/@outfitter/cli-e5ms1y0x";
3
+ import "../shared/@outfitter/cli-b0tzqgnf";
4
+ import "../shared/@outfitter/cli-fakncnjp";
5
+ import { SectionOptions, SubsectionOptions, codeBlock, demoContent, demoSection, demoSubsection, description } from "../shared/@outfitter/cli-d7jpshq5";
6
+ import "../shared/@outfitter/cli-6bztk73z";
7
+ import "../shared/@outfitter/cli-2g8bx1aq";
8
+ import { DEFAULT_EXAMPLES, getExample } from "../shared/@outfitter/cli-7nm6edvh";
9
+ import { DemoConfig, DemoRegistryEntry, DemoRenderer, ExampleTexts, PrimitiveId, PrimitiveMeta, ThemeMethodCategory, ThemeMethodMeta, VariantMeta, isPrimitiveId } from "../shared/@outfitter/cli-qjfc3j11";
10
+ import "../shared/@outfitter/cli-xsaheemc";
11
+ /**
12
+ * Renders a demo for a specific primitive.
13
+ *
14
+ * @param id - The primitive to demo
15
+ * @param config - Optional configuration for customization
16
+ * @returns Formatted demo output string
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * // Default examples
21
+ * console.log(renderDemo("colors"));
22
+ *
23
+ * // Custom examples
24
+ * console.log(renderDemo("colors", {
25
+ * examples: { success: "Build completed" }
26
+ * }));
27
+ *
28
+ * // No code examples
29
+ * console.log(renderDemo("table", { showCode: false }));
30
+ * ```
31
+ */
32
+ declare function renderDemo(id: PrimitiveId, config?: DemoConfig): string;
33
+ /**
34
+ * Renders demos for all primitives.
35
+ *
36
+ * @param config - Optional configuration applied to all demos
37
+ * @returns Combined output from all demos, separated by blank lines
38
+ *
39
+ * @example
40
+ * ```typescript
41
+ * console.log(renderAllDemos());
42
+ *
43
+ * // With custom config
44
+ * console.log(renderAllDemos({
45
+ * showCode: false,
46
+ * showDescriptions: true,
47
+ * }));
48
+ * ```
49
+ */
50
+ declare function renderAllDemos(config?: DemoConfig): string;
51
+ /**
52
+ * Gets metadata for a specific primitive.
53
+ *
54
+ * @param id - The primitive ID
55
+ * @returns Primitive metadata including name, description, and import example
56
+ *
57
+ * @example
58
+ * ```typescript
59
+ * const meta = getPrimitive("colors");
60
+ * console.log(meta.name); // "Colors"
61
+ * console.log(meta.importExample); // 'import { createTheme } from "@outfitter/cli/render";'
62
+ * ```
63
+ */
64
+ declare function getPrimitive(id: PrimitiveId): PrimitiveMeta;
65
+ /**
66
+ * Gets all primitives with their metadata.
67
+ *
68
+ * @returns Array of all primitive metadata
69
+ */
70
+ declare function getAllPrimitives(): PrimitiveMeta[];
71
+ /**
72
+ * Gets a registry entry with both metadata and renderer.
73
+ *
74
+ * @param id - The primitive ID
75
+ * @returns Registry entry with meta and render function
76
+ */
77
+ declare function getDemoEntry(id: PrimitiveId): DemoRegistryEntry;
78
+ export { renderDemo, renderAllDemos, isPrimitiveId, getThemeMethodsByCategory, getSpinnerStyles, getPrimitiveIds, getPrimitive, getListStyles, getExample, getDemoEntry, getBorderStyles, getAllPrimitives, description, demoSubsection, demoSection, demoContent, codeBlock, VariantMeta, ThemeMethodMeta, ThemeMethodCategory, THEME_METHOD_META, SubsectionOptions, SectionOptions, SPINNER_STYLE_META, PrimitiveMeta, PrimitiveId, PRIMITIVE_META, LIST_STYLE_META, ExampleTexts, DemoRenderer, DemoRegistryEntry, DemoConfig, DEFAULT_EXAMPLES, BORDER_STYLE_META };
@@ -0,0 +1,148 @@
1
+ // @bun
2
+ import {
3
+ renderTreeDemo
4
+ } from "../shared/@outfitter/cli-ay411nbr.js";
5
+ import"../shared/@outfitter/cli-b5c2k0d7.js";
6
+ import {
7
+ renderTextDemo
8
+ } from "../shared/@outfitter/cli-nvvc92c8.js";
9
+ import {
10
+ renderSpinnerDemo
11
+ } from "../shared/@outfitter/cli-9mtjjykw.js";
12
+ import"../shared/@outfitter/cli-n9dbh0hp.js";
13
+ import {
14
+ renderColorsDemo
15
+ } from "../shared/@outfitter/cli-74ba31gz.js";
16
+ import {
17
+ renderListDemo
18
+ } from "../shared/@outfitter/cli-thvzhjd1.js";
19
+ import"../shared/@outfitter/cli-xg5y5fhk.js";
20
+ import {
21
+ renderIndicatorsDemo
22
+ } from "../shared/@outfitter/cli-6j9qynm8.js";
23
+ import"../shared/@outfitter/cli-p1m5dhrs.js";
24
+ import {
25
+ renderProgressDemo
26
+ } from "../shared/@outfitter/cli-daw296mv.js";
27
+ import"../shared/@outfitter/cli-bc17qeh2.js";
28
+ import {
29
+ renderTableDemo
30
+ } from "../shared/@outfitter/cli-feb5j90n.js";
31
+ import"../shared/@outfitter/cli-an9j0h80.js";
32
+ import {
33
+ isPrimitiveId
34
+ } from "../shared/@outfitter/cli-tvw1xrdj.js";
35
+ import {
36
+ renderBordersDemo
37
+ } from "../shared/@outfitter/cli-pkxmzavm.js";
38
+ import {
39
+ renderMarkdownDemo
40
+ } from "../shared/@outfitter/cli-qp4cbhqr.js";
41
+ import"../shared/@outfitter/cli-afhjqmg3.js";
42
+ import {
43
+ renderBoxDemo
44
+ } from "../shared/@outfitter/cli-7gnrb8cr.js";
45
+ import {
46
+ BORDER_STYLE_META,
47
+ LIST_STYLE_META,
48
+ PRIMITIVE_META,
49
+ SPINNER_STYLE_META,
50
+ THEME_METHOD_META,
51
+ getBorderStyles,
52
+ getListStyles,
53
+ getPrimitiveIds,
54
+ getPrimitiveMeta,
55
+ getSpinnerStyles,
56
+ getThemeMethodsByCategory
57
+ } from "../shared/@outfitter/cli-kc84wmch.js";
58
+ import {
59
+ DEFAULT_EXAMPLES,
60
+ getExample
61
+ } from "../shared/@outfitter/cli-xep6v2c0.js";
62
+ import {
63
+ codeBlock,
64
+ demoContent,
65
+ demoSection,
66
+ demoSubsection,
67
+ description
68
+ } from "../shared/@outfitter/cli-34fqr7bp.js";
69
+ import"../shared/@outfitter/cli-xvqtqjxk.js";
70
+ import"../shared/@outfitter/cli-671sxkhj.js";
71
+ import"../shared/@outfitter/cli-vp88gxev.js";
72
+ import"../shared/@outfitter/cli-jjemfdta.js";
73
+ import"../shared/@outfitter/cli-85fg2vr5.js";
74
+ import {
75
+ createTheme,
76
+ init_colors
77
+ } from "../shared/@outfitter/cli-9nbyj2bt.js";
78
+ import"../shared/@outfitter/cli-d9ad0rqj.js";
79
+ import"../shared/@outfitter/cli-v1tzwxkt.js";
80
+
81
+ // packages/cli/src/demo/index.ts
82
+ init_colors();
83
+ var DEMO_RENDERERS = {
84
+ colors: renderColorsDemo,
85
+ borders: renderBordersDemo,
86
+ spinner: renderSpinnerDemo,
87
+ list: renderListDemo,
88
+ box: renderBoxDemo,
89
+ table: renderTableDemo,
90
+ progress: renderProgressDemo,
91
+ tree: renderTreeDemo,
92
+ text: renderTextDemo,
93
+ markdown: renderMarkdownDemo,
94
+ indicators: renderIndicatorsDemo
95
+ };
96
+ function renderDemo(id, config = {}) {
97
+ const renderer = DEMO_RENDERERS[id];
98
+ const theme = createTheme();
99
+ return renderer(config, theme);
100
+ }
101
+ function renderAllDemos(config = {}) {
102
+ const theme = createTheme();
103
+ const outputs = [];
104
+ for (const id of getPrimitiveIds()) {
105
+ const renderer = DEMO_RENDERERS[id];
106
+ outputs.push(renderer(config, theme));
107
+ outputs.push("");
108
+ }
109
+ return outputs.join(`
110
+ `).trimEnd();
111
+ }
112
+ function getPrimitive(id) {
113
+ return getPrimitiveMeta(id);
114
+ }
115
+ function getAllPrimitives() {
116
+ return getPrimitiveIds().map((id) => PRIMITIVE_META[id]);
117
+ }
118
+ function getDemoEntry(id) {
119
+ return {
120
+ meta: getPrimitiveMeta(id),
121
+ render: DEMO_RENDERERS[id]
122
+ };
123
+ }
124
+ export {
125
+ renderDemo,
126
+ renderAllDemos,
127
+ isPrimitiveId,
128
+ getThemeMethodsByCategory,
129
+ getSpinnerStyles,
130
+ getPrimitiveIds,
131
+ getPrimitive,
132
+ getListStyles,
133
+ getExample,
134
+ getDemoEntry,
135
+ getBorderStyles,
136
+ getAllPrimitives,
137
+ description,
138
+ demoSubsection,
139
+ demoSection,
140
+ demoContent,
141
+ codeBlock,
142
+ THEME_METHOD_META,
143
+ SPINNER_STYLE_META,
144
+ PRIMITIVE_META,
145
+ LIST_STYLE_META,
146
+ DEFAULT_EXAMPLES,
147
+ BORDER_STYLE_META
148
+ };