@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.
- package/README.md +21 -32
- package/dist/actions.js +1 -1
- package/dist/borders/index.d.ts +3 -0
- package/dist/borders/index.js +13 -0
- package/dist/box/index.d.ts +4 -0
- package/dist/box/index.js +13 -0
- package/dist/cli.d.ts +2 -103
- package/dist/cli.js +4 -51
- package/dist/colors/index.d.ts +3 -0
- package/dist/colors/index.js +18 -0
- package/dist/command.d.ts +3 -37
- package/dist/command.js +5 -1
- package/dist/demo/index.d.ts +78 -0
- package/dist/demo/index.js +148 -0
- package/dist/demo/registry.d.ts +7 -0
- package/dist/demo/registry.js +28 -0
- package/dist/demo/renderers/borders.d.ts +7 -0
- package/dist/demo/renderers/borders.js +17 -0
- package/dist/demo/renderers/box.d.ts +7 -0
- package/dist/demo/renderers/box.js +18 -0
- package/dist/demo/renderers/colors.d.ts +7 -0
- package/dist/demo/renderers/colors.js +18 -0
- package/dist/demo/renderers/indicators.d.ts +7 -0
- package/dist/demo/renderers/indicators.js +17 -0
- package/dist/demo/renderers/list.d.ts +7 -0
- package/dist/demo/renderers/list.js +19 -0
- package/dist/demo/renderers/markdown.d.ts +7 -0
- package/dist/demo/renderers/markdown.js +18 -0
- package/dist/demo/renderers/progress.d.ts +7 -0
- package/dist/demo/renderers/progress.js +17 -0
- package/dist/demo/renderers/spinner.d.ts +7 -0
- package/dist/demo/renderers/spinner.js +19 -0
- package/dist/demo/renderers/table.d.ts +7 -0
- package/dist/demo/renderers/table.js +19 -0
- package/dist/demo/renderers/text.d.ts +7 -0
- package/dist/demo/renderers/text.js +16 -0
- package/dist/demo/renderers/tree.d.ts +7 -0
- package/dist/demo/renderers/tree.js +18 -0
- package/dist/demo/section.d.ts +5 -0
- package/dist/demo/section.js +23 -0
- package/dist/demo/templates.d.ts +4 -0
- package/dist/demo/templates.js +10 -0
- package/dist/demo/types.d.ts +3 -0
- package/dist/demo/types.js +8 -0
- package/dist/index.d.ts +5 -607
- package/dist/index.js +10 -44
- package/dist/input.d.ts +9 -123
- package/dist/input.js +2 -3
- package/dist/list/index.d.ts +3 -0
- package/dist/list/index.js +9 -0
- package/dist/output.d.ts +2 -68
- package/dist/output.js +4 -150
- package/dist/pagination.d.ts +1 -34
- package/dist/pagination.js +1 -1
- package/dist/preset/full.d.ts +14 -0
- package/dist/preset/full.js +41 -0
- package/dist/preset/standard.d.ts +11 -0
- package/dist/preset/standard.js +30 -0
- package/dist/prompt/confirm.d.ts +4 -0
- package/dist/prompt/confirm.js +9 -0
- package/dist/prompt/group.d.ts +4 -0
- package/dist/prompt/group.js +9 -0
- package/dist/prompt/index.d.ts +7 -0
- package/dist/prompt/index.js +32 -0
- package/dist/prompt/select.d.ts +4 -0
- package/dist/prompt/select.js +11 -0
- package/dist/prompt/text.d.ts +4 -0
- package/dist/prompt/text.js +11 -0
- package/dist/prompt/types.d.ts +3 -0
- package/dist/prompt/types.js +8 -0
- package/dist/prompt/validators.d.ts +2 -0
- package/dist/prompt/validators.js +8 -0
- package/dist/render/borders.d.ts +2 -0
- package/dist/render/borders.js +15 -0
- package/dist/render/box.d.ts +3 -0
- package/dist/render/box.js +23 -0
- package/dist/render/colors.d.ts +2 -0
- package/dist/render/colors.js +20 -0
- package/dist/render/date.d.ts +2 -0
- package/dist/render/date.js +12 -0
- package/dist/render/format-relative.d.ts +2 -0
- package/dist/render/format-relative.js +8 -0
- package/dist/render/format.d.ts +2 -0
- package/dist/render/format.js +10 -0
- package/dist/render/heading.d.ts +3 -0
- package/dist/render/heading.js +14 -0
- package/dist/render/index.d.ts +32 -0
- package/dist/render/index.js +235 -0
- package/dist/render/indicators.d.ts +2 -0
- package/dist/render/indicators.js +14 -0
- package/dist/render/json.d.ts +2 -0
- package/dist/render/json.js +10 -0
- package/dist/render/layout.d.ts +5 -0
- package/dist/render/layout.js +25 -0
- package/dist/render/list.d.ts +2 -0
- package/dist/render/list.js +8 -0
- package/dist/render/markdown.d.ts +2 -0
- package/dist/render/markdown.js +10 -0
- package/dist/render/progress.d.ts +2 -0
- package/dist/render/progress.js +8 -0
- package/dist/render/separator.d.ts +3 -0
- package/dist/render/separator.js +14 -0
- package/dist/render/shapes.d.ts +2 -0
- package/dist/render/shapes.js +35 -0
- package/dist/render/spinner.d.ts +2 -0
- package/dist/render/spinner.js +12 -0
- package/dist/render/stack.d.ts +3 -0
- package/dist/render/stack.js +38 -0
- package/dist/render/table.d.ts +3 -0
- package/dist/render/table.js +12 -0
- package/dist/render/text.d.ts +2 -0
- package/dist/render/text.js +27 -0
- package/dist/render/tree.d.ts +2 -0
- package/dist/render/tree.js +10 -0
- package/dist/render/types.d.ts +2 -0
- package/dist/render/types.js +1 -0
- package/dist/shared/@outfitter/cli-0ggcy7fa.js +20 -0
- package/dist/shared/@outfitter/cli-0psys2vm.js +7 -0
- package/dist/shared/@outfitter/cli-1bghjef6.js +352 -0
- package/dist/shared/@outfitter/cli-1kwbnt86.d.ts +45 -0
- package/dist/shared/@outfitter/cli-2g8bx1aq.d.ts +50 -0
- package/dist/shared/@outfitter/cli-33e97cjs.d.ts +42 -0
- package/dist/shared/@outfitter/cli-34fqr7bp.js +37 -0
- package/dist/shared/@outfitter/cli-3b7ed3rm.d.ts +97 -0
- package/dist/shared/@outfitter/cli-3dxmmy4c.d.ts +20 -0
- package/dist/shared/@outfitter/cli-3f12z5kf.d.ts +83 -0
- package/dist/shared/@outfitter/cli-3hp8qwx3.js +11 -0
- package/dist/shared/@outfitter/cli-3t2zaenc.d.ts +59 -0
- package/dist/shared/@outfitter/cli-4cb5g831.d.ts +147 -0
- package/dist/shared/@outfitter/cli-4w2a1rfy.d.ts +23 -0
- package/dist/shared/@outfitter/cli-4x6pqnez.js +20 -0
- package/dist/shared/@outfitter/cli-671sxkhj.js +146 -0
- package/dist/shared/@outfitter/cli-6bztk73z.d.ts +51 -0
- package/dist/shared/@outfitter/cli-6fxffp8k.js +1 -0
- package/dist/shared/@outfitter/cli-6j9qynm8.js +118 -0
- package/dist/shared/@outfitter/cli-6m988kh0.d.ts +61 -0
- package/dist/shared/@outfitter/cli-72kg550t.d.ts +53 -0
- package/dist/shared/@outfitter/cli-74ba31gz.js +134 -0
- package/dist/shared/@outfitter/cli-7gnrb8cr.js +214 -0
- package/dist/shared/@outfitter/cli-7na6p4fs.d.ts +59 -0
- package/dist/shared/@outfitter/cli-7nm6edvh.d.ts +17 -0
- package/dist/shared/@outfitter/cli-85fg2vr5.js +123 -0
- package/dist/shared/@outfitter/cli-8a8xrzhy.js +20 -0
- package/dist/shared/@outfitter/cli-8aa1vhdn.d.ts +119 -0
- package/dist/shared/@outfitter/cli-8bwaw3pz.js +7 -0
- package/dist/shared/@outfitter/cli-8j5k6mr3.js +71 -0
- package/dist/shared/@outfitter/cli-8rx4g3s5.d.ts +41 -0
- package/dist/shared/@outfitter/cli-8xsmsbbd.d.ts +223 -0
- package/dist/shared/@outfitter/cli-96b2p4td.d.ts +56 -0
- package/dist/shared/@outfitter/cli-9khk3cbq.d.ts +190 -0
- package/dist/shared/@outfitter/cli-9mtjjykw.js +67 -0
- package/dist/shared/@outfitter/cli-9nbyj2bt.js +128 -0
- package/dist/shared/@outfitter/cli-a4q87517.d.ts +64 -0
- package/dist/shared/@outfitter/cli-afhjqmg3.js +63 -0
- package/dist/shared/@outfitter/cli-an9j0h80.js +117 -0
- package/dist/shared/@outfitter/cli-ay411nbr.js +122 -0
- package/dist/shared/@outfitter/cli-b0tzqgnf.d.ts +132 -0
- package/dist/shared/@outfitter/cli-b5c2k0d7.js +39 -0
- package/dist/shared/@outfitter/cli-b5epywry.js +1 -0
- package/dist/shared/@outfitter/cli-bc17qeh2.js +19 -0
- package/dist/shared/@outfitter/cli-bcmcaz1b.js +23 -0
- package/dist/shared/@outfitter/cli-bf3vma4q.js +61 -0
- package/dist/shared/@outfitter/cli-c8q4f71g.js +144 -0
- package/dist/shared/@outfitter/cli-c9knfqn5.d.ts +30 -0
- package/dist/shared/@outfitter/cli-cf1xexgn.d.ts +53 -0
- package/dist/shared/@outfitter/cli-cf2s94s1.d.ts +42 -0
- package/dist/shared/@outfitter/cli-cs45xd6q.js +59 -0
- package/dist/shared/@outfitter/cli-d7jpshq5.d.ts +128 -0
- package/dist/shared/@outfitter/cli-d9ad0rqj.js +75 -0
- package/dist/shared/@outfitter/cli-daw296mv.js +61 -0
- package/dist/shared/@outfitter/cli-e5ms1y0x.d.ts +91 -0
- package/dist/shared/@outfitter/cli-e73v3qqy.d.ts +93 -0
- package/dist/shared/@outfitter/cli-efy6jfcj.js +52 -0
- package/dist/shared/@outfitter/cli-en6zn6sj.js +1 -0
- package/dist/shared/@outfitter/cli-ep2cvtk8.js +48 -0
- package/dist/shared/@outfitter/cli-evx7qcp1.d.ts +300 -0
- package/dist/shared/@outfitter/cli-f75h8e94.js +7 -0
- package/dist/shared/@outfitter/cli-fakncnjp.d.ts +106 -0
- package/dist/shared/@outfitter/cli-feb5j90n.js +94 -0
- package/dist/shared/@outfitter/cli-h20jc0bs.d.ts +66 -0
- package/dist/shared/@outfitter/cli-hnpbqmc8.d.ts +328 -0
- package/dist/shared/@outfitter/cli-j19a91ck.js +30 -0
- package/dist/shared/@outfitter/cli-j4n8gaf3.js +95 -0
- package/dist/shared/@outfitter/cli-jejfypgf.js +85 -0
- package/dist/shared/@outfitter/cli-jhcdwvpn.js +135 -0
- package/dist/shared/@outfitter/cli-jjemfdta.js +85 -0
- package/dist/shared/@outfitter/cli-kc84wmch.js +267 -0
- package/dist/shared/@outfitter/cli-ktqme80d.js +7 -0
- package/dist/shared/@outfitter/cli-mhamvbty.d.ts +34 -0
- package/dist/shared/@outfitter/cli-mq0jp15z.js +1 -0
- package/dist/shared/@outfitter/cli-mymyavvj.d.ts +26 -0
- package/dist/shared/@outfitter/cli-n17gt1dz.js +19 -0
- package/dist/shared/@outfitter/cli-n9dbh0hp.js +51 -0
- package/dist/shared/@outfitter/cli-nvvc92c8.js +128 -0
- package/dist/shared/@outfitter/cli-p1m5dhrs.js +169 -0
- package/dist/shared/@outfitter/cli-p38sfxyk.js +25 -0
- package/dist/shared/@outfitter/cli-p3dqm1vd.js +22 -0
- package/dist/shared/@outfitter/cli-p9j1phge.js +20 -0
- package/dist/shared/@outfitter/cli-pkxmzavm.js +62 -0
- package/dist/shared/@outfitter/cli-q8r6jarq.d.ts +24 -0
- package/dist/shared/@outfitter/cli-qj83y5wj.d.ts +71 -0
- package/dist/shared/@outfitter/cli-qjfc3j11.d.ts +112 -0
- package/dist/shared/@outfitter/cli-qp4cbhqr.js +70 -0
- package/dist/shared/@outfitter/cli-s0kkx9m1.d.ts +164 -0
- package/dist/shared/@outfitter/cli-snxj55n6.js +43 -0
- package/dist/shared/@outfitter/cli-swwxvjvm.d.ts +24 -0
- package/dist/shared/@outfitter/cli-sx67mmfx.d.ts +98 -0
- package/dist/shared/@outfitter/cli-tarpsa8a.js +30 -0
- package/dist/shared/@outfitter/cli-thvzhjd1.js +126 -0
- package/dist/shared/@outfitter/cli-tqewy503.d.ts +36 -0
- package/dist/shared/@outfitter/cli-ttt7r0j7.d.ts +253 -0
- package/dist/shared/@outfitter/cli-tvw1xrdj.js +20 -0
- package/dist/shared/@outfitter/cli-v1tzwxkt.js +32 -0
- package/dist/shared/@outfitter/cli-vd60dj65.js +1 -0
- package/dist/shared/@outfitter/cli-vp88gxev.js +279 -0
- package/dist/shared/@outfitter/cli-vstbkzky.d.ts +74 -0
- package/dist/shared/@outfitter/cli-vtg0sqk2.d.ts +54 -0
- package/dist/shared/@outfitter/cli-w5y3xepp.js +20 -0
- package/dist/shared/@outfitter/cli-x4cavvc0.js +1 -0
- package/dist/shared/@outfitter/cli-xep6v2c0.js +52 -0
- package/dist/shared/@outfitter/cli-xg5y5fhk.js +86 -0
- package/dist/shared/@outfitter/cli-xsaheemc.d.ts +248 -0
- package/dist/shared/@outfitter/cli-xvqtqjxk.js +82 -0
- package/dist/shared/@outfitter/cli-y25tt8nc.d.ts +48 -0
- package/dist/shared/@outfitter/cli-zact3325.js +152 -0
- package/dist/shared/@outfitter/cli-zx598p8q.d.ts +26 -0
- package/dist/streaming/ansi.d.ts +2 -0
- package/dist/streaming/ansi.js +8 -0
- package/dist/streaming/index.d.ts +4 -0
- package/dist/streaming/index.js +17 -0
- package/dist/streaming/spinner.d.ts +3 -0
- package/dist/streaming/spinner.js +10 -0
- package/dist/streaming/writer.d.ts +2 -0
- package/dist/streaming/writer.js +9 -0
- package/dist/table/index.d.ts +4 -0
- package/dist/table/index.js +13 -0
- package/dist/terminal/detection.d.ts +2 -0
- package/dist/terminal/detection.js +23 -0
- package/dist/terminal/index.d.ts +2 -0
- package/dist/terminal/index.js +24 -0
- package/dist/theme/context.d.ts +9 -0
- package/dist/theme/context.js +14 -0
- package/dist/theme/create.d.ts +8 -0
- package/dist/theme/create.js +12 -0
- package/dist/theme/index.d.ts +17 -0
- package/dist/theme/index.js +42 -0
- package/dist/theme/presets/bold.d.ts +8 -0
- package/dist/theme/presets/bold.js +12 -0
- package/dist/theme/presets/default.d.ts +8 -0
- package/dist/theme/presets/default.js +11 -0
- package/dist/theme/presets/index.d.ts +12 -0
- package/dist/theme/presets/index.js +24 -0
- package/dist/theme/presets/minimal.d.ts +8 -0
- package/dist/theme/presets/minimal.js +12 -0
- package/dist/theme/presets/rounded.d.ts +8 -0
- package/dist/theme/presets/rounded.js +12 -0
- package/dist/theme/resolve.d.ts +8 -0
- package/dist/theme/resolve.js +11 -0
- package/dist/theme/types.d.ts +7 -0
- package/dist/theme/types.js +1 -0
- package/dist/tree/index.d.ts +3 -0
- package/dist/tree/index.js +11 -0
- package/dist/types.d.ts +1 -252
- package/dist/types.js +1 -1
- package/package.json +228 -20
- package/dist/shared/@outfitter/cli-4yy82cmp.js +0 -20
package/dist/types.d.ts
CHANGED
|
@@ -1,253 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CancelledError, ErrorCategory, ValidationError } from "@outfitter/contracts";
|
|
3
|
-
import { Result } from "better-result";
|
|
4
|
-
/**
|
|
5
|
-
* Configuration for creating a CLI instance.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* const config: CLIConfig = {
|
|
10
|
-
* name: "waymark",
|
|
11
|
-
* version: "1.0.0",
|
|
12
|
-
* description: "A note management CLI",
|
|
13
|
-
* };
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
interface CLIConfig {
|
|
17
|
-
/** CLI name (used in help output and error messages) */
|
|
18
|
-
readonly name: string;
|
|
19
|
-
/** CLI version (displayed with --version) */
|
|
20
|
-
readonly version: string;
|
|
21
|
-
/** CLI description (displayed in help output) */
|
|
22
|
-
readonly description?: string;
|
|
23
|
-
/** Custom error handler */
|
|
24
|
-
readonly onError?: (error: Error) => void;
|
|
25
|
-
/** Custom exit handler (defaults to process.exit) */
|
|
26
|
-
readonly onExit?: (code: number) => never;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* CLI instance returned by createCLI.
|
|
30
|
-
*/
|
|
31
|
-
interface CLI {
|
|
32
|
-
/** Register a command with the CLI */
|
|
33
|
-
register(command: CommandBuilder | Command): this;
|
|
34
|
-
/** Parse arguments and execute the matched command */
|
|
35
|
-
parse(argv?: readonly string[]): Promise<void>;
|
|
36
|
-
/** Get the underlying Commander program */
|
|
37
|
-
readonly program: Command;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Configuration for a single command.
|
|
41
|
-
*/
|
|
42
|
-
interface CommandConfig {
|
|
43
|
-
/** Command name and argument syntax (e.g., "list" or "get <id>") */
|
|
44
|
-
readonly name: string;
|
|
45
|
-
/** Command description */
|
|
46
|
-
readonly description?: string;
|
|
47
|
-
/** Command aliases */
|
|
48
|
-
readonly aliases?: readonly string[];
|
|
49
|
-
/** Whether to hide from help output */
|
|
50
|
-
readonly hidden?: boolean;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Action function executed when a command is invoked.
|
|
54
|
-
*
|
|
55
|
-
* @typeParam TFlags - Type of parsed command flags
|
|
56
|
-
*/
|
|
57
|
-
type CommandAction<TFlags extends CommandFlags = CommandFlags> = (context: {
|
|
58
|
-
/** Parsed command-line arguments */
|
|
59
|
-
readonly args: readonly string[];
|
|
60
|
-
/** Parsed command flags */
|
|
61
|
-
readonly flags: TFlags;
|
|
62
|
-
/** Raw Commander command instance */
|
|
63
|
-
readonly command: Command;
|
|
64
|
-
}) => Promise<void> | void;
|
|
65
|
-
/**
|
|
66
|
-
* Base type for command flags.
|
|
67
|
-
* All flag types must extend this.
|
|
68
|
-
*/
|
|
69
|
-
type CommandFlags = Record<string, unknown>;
|
|
70
|
-
/**
|
|
71
|
-
* Builder interface for constructing commands fluently.
|
|
72
|
-
*/
|
|
73
|
-
interface CommandBuilder {
|
|
74
|
-
/** Set command description */
|
|
75
|
-
description(text: string): this;
|
|
76
|
-
/** Add a command option/flag */
|
|
77
|
-
option(flags: string, description: string, defaultValue?: unknown): this;
|
|
78
|
-
/** Add a required option */
|
|
79
|
-
requiredOption(flags: string, description: string, defaultValue?: unknown): this;
|
|
80
|
-
/** Add command aliases */
|
|
81
|
-
alias(alias: string): this;
|
|
82
|
-
/** Set the action handler */
|
|
83
|
-
action<TFlags extends CommandFlags = CommandFlags>(handler: CommandAction<TFlags>): this;
|
|
84
|
-
/** Build the underlying Commander command */
|
|
85
|
-
build(): Command;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Available output modes for CLI commands.
|
|
89
|
-
*/
|
|
90
|
-
type OutputMode = "human" | "json" | "jsonl" | "tree" | "table";
|
|
91
|
-
/**
|
|
92
|
-
* Options for the output() function.
|
|
93
|
-
*/
|
|
94
|
-
interface OutputOptions {
|
|
95
|
-
/** Force a specific output mode (overrides flag detection) */
|
|
96
|
-
readonly mode?: OutputMode;
|
|
97
|
-
/** Stream to write to (defaults to stdout) */
|
|
98
|
-
readonly stream?: NodeJS.WritableStream;
|
|
99
|
-
/** Whether to pretty-print JSON output */
|
|
100
|
-
readonly pretty?: boolean;
|
|
101
|
-
/** Exit code to use after output (undefined = don't exit) */
|
|
102
|
-
readonly exitCode?: number;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Options for collectIds() input utility.
|
|
106
|
-
*
|
|
107
|
-
* @example
|
|
108
|
-
* ```typescript
|
|
109
|
-
* const ids = await collectIds(args, {
|
|
110
|
-
* allowFile: true, // @file expansion
|
|
111
|
-
* allowStdin: true, // - reads from stdin
|
|
112
|
-
* });
|
|
113
|
-
* ```
|
|
114
|
-
*/
|
|
115
|
-
interface CollectIdsOptions {
|
|
116
|
-
/** Allow @file expansion (reads IDs from file) */
|
|
117
|
-
readonly allowFile?: boolean;
|
|
118
|
-
/** Allow glob patterns */
|
|
119
|
-
readonly allowGlob?: boolean;
|
|
120
|
-
/** Allow reading from stdin with "-" */
|
|
121
|
-
readonly allowStdin?: boolean;
|
|
122
|
-
/** Separator for comma-separated values */
|
|
123
|
-
readonly separator?: string;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Options for expandFileArg() input utility.
|
|
127
|
-
*/
|
|
128
|
-
interface ExpandFileOptions {
|
|
129
|
-
/** Encoding for file reads (defaults to utf-8) */
|
|
130
|
-
readonly encoding?: BufferEncoding;
|
|
131
|
-
/** Maximum file size to read (in bytes) */
|
|
132
|
-
readonly maxSize?: number;
|
|
133
|
-
/** Whether to trim the file content */
|
|
134
|
-
readonly trim?: boolean;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Options for parseGlob() input utility.
|
|
138
|
-
*/
|
|
139
|
-
interface ParseGlobOptions {
|
|
140
|
-
/** Current working directory for glob resolution */
|
|
141
|
-
readonly cwd?: string;
|
|
142
|
-
/** Whether to follow symlinks */
|
|
143
|
-
readonly followSymlinks?: boolean;
|
|
144
|
-
/** Patterns to exclude */
|
|
145
|
-
readonly ignore?: readonly string[];
|
|
146
|
-
/** Only match files (not directories) */
|
|
147
|
-
readonly onlyFiles?: boolean;
|
|
148
|
-
/** Only match directories (not files) */
|
|
149
|
-
readonly onlyDirectories?: boolean;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Options for normalizeId().
|
|
153
|
-
*/
|
|
154
|
-
interface NormalizeIdOptions {
|
|
155
|
-
/** Whether to lowercase the ID */
|
|
156
|
-
readonly lowercase?: boolean;
|
|
157
|
-
/** Whether to trim whitespace */
|
|
158
|
-
readonly trim?: boolean;
|
|
159
|
-
/** Minimum length requirement */
|
|
160
|
-
readonly minLength?: number;
|
|
161
|
-
/** Maximum length requirement */
|
|
162
|
-
readonly maxLength?: number;
|
|
163
|
-
/** Pattern the ID must match */
|
|
164
|
-
readonly pattern?: RegExp;
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Options for confirmDestructive().
|
|
168
|
-
*/
|
|
169
|
-
interface ConfirmDestructiveOptions {
|
|
170
|
-
/** Message to display to the user */
|
|
171
|
-
readonly message: string;
|
|
172
|
-
/** Whether to bypass confirmation (e.g., --yes flag) */
|
|
173
|
-
readonly bypassFlag?: boolean;
|
|
174
|
-
/** Number of items affected (shown in confirmation) */
|
|
175
|
-
readonly itemCount?: number;
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Numeric or date range parsed from CLI input.
|
|
179
|
-
*/
|
|
180
|
-
type Range = NumericRange | DateRange;
|
|
181
|
-
/**
|
|
182
|
-
* Numeric range (e.g., "1-10").
|
|
183
|
-
*/
|
|
184
|
-
interface NumericRange {
|
|
185
|
-
readonly type: "number";
|
|
186
|
-
readonly min: number;
|
|
187
|
-
readonly max: number;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Date range (e.g., "2024-01-01..2024-12-31").
|
|
191
|
-
*/
|
|
192
|
-
interface DateRange {
|
|
193
|
-
readonly type: "date";
|
|
194
|
-
readonly start: Date;
|
|
195
|
-
readonly end: Date;
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Filter expression parsed from CLI input.
|
|
199
|
-
*/
|
|
200
|
-
interface FilterExpression {
|
|
201
|
-
readonly field: string;
|
|
202
|
-
readonly value: string;
|
|
203
|
-
readonly operator?: "eq" | "ne" | "gt" | "lt" | "gte" | "lte" | "contains";
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Sort criteria parsed from CLI input.
|
|
207
|
-
*/
|
|
208
|
-
interface SortCriteria {
|
|
209
|
-
readonly field: string;
|
|
210
|
-
readonly direction: "asc" | "desc";
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* Key-value pair parsed from CLI input.
|
|
214
|
-
*/
|
|
215
|
-
interface KeyValuePair {
|
|
216
|
-
readonly key: string;
|
|
217
|
-
readonly value: string;
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* State for paginated command results.
|
|
221
|
-
*/
|
|
222
|
-
interface PaginationState {
|
|
223
|
-
/** Cursor for the next page */
|
|
224
|
-
readonly cursor: string;
|
|
225
|
-
/** Command that generated this state */
|
|
226
|
-
readonly command: string;
|
|
227
|
-
/** Context key for scoping pagination */
|
|
228
|
-
readonly context?: string;
|
|
229
|
-
/** Timestamp when state was created */
|
|
230
|
-
readonly timestamp: number;
|
|
231
|
-
/** Whether there are more results */
|
|
232
|
-
readonly hasMore: boolean;
|
|
233
|
-
/** Total count (if known) */
|
|
234
|
-
readonly total?: number;
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* Options for cursor persistence operations.
|
|
238
|
-
*/
|
|
239
|
-
interface CursorOptions {
|
|
240
|
-
/** Command name for cursor scoping */
|
|
241
|
-
readonly command: string;
|
|
242
|
-
/** Context key for additional scoping */
|
|
243
|
-
readonly context?: string;
|
|
244
|
-
/** Tool name for XDG path resolution */
|
|
245
|
-
readonly toolName: string;
|
|
246
|
-
/** Maximum age in milliseconds before a cursor is treated as expired */
|
|
247
|
-
readonly maxAgeMs?: number;
|
|
248
|
-
/** Whether there are more results (defaults to true) */
|
|
249
|
-
readonly hasMore?: boolean;
|
|
250
|
-
/** Total count of results (if known) */
|
|
251
|
-
readonly total?: number;
|
|
252
|
-
}
|
|
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";
|
|
253
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 };
|
package/dist/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@outfitter/cli",
|
|
3
|
-
"description": "Typed CLI runtime with output contracts, input parsing
|
|
4
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"description": "Typed CLI runtime with terminal detection, rendering, output contracts, and input parsing",
|
|
4
|
+
"version": "0.1.0-rc.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
@@ -9,28 +9,220 @@
|
|
|
9
9
|
"module": "./dist/index.js",
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"exports": {
|
|
12
|
-
"
|
|
12
|
+
".": {
|
|
13
13
|
"import": {
|
|
14
|
-
"types": "./dist/
|
|
15
|
-
"default": "./dist/
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"default": "./dist/index.js"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
-
"./
|
|
18
|
+
"./render": {
|
|
19
19
|
"import": {
|
|
20
|
-
"types": "./dist/
|
|
21
|
-
"default": "./dist/
|
|
20
|
+
"types": "./dist/render/index.d.ts",
|
|
21
|
+
"default": "./dist/render/index.js"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
|
-
"
|
|
24
|
+
"./theme/presets": {
|
|
25
25
|
"import": {
|
|
26
|
-
"types": "./dist/index.d.ts",
|
|
27
|
-
"default": "./dist/index.js"
|
|
26
|
+
"types": "./dist/theme/presets/index.d.ts",
|
|
27
|
+
"default": "./dist/theme/presets/index.js"
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
|
-
"./
|
|
30
|
+
"./theme/presets/minimal": {
|
|
31
31
|
"import": {
|
|
32
|
-
"types": "./dist/
|
|
33
|
-
"default": "./dist/
|
|
32
|
+
"types": "./dist/theme/presets/minimal.d.ts",
|
|
33
|
+
"default": "./dist/theme/presets/minimal.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"./streaming": {
|
|
37
|
+
"import": {
|
|
38
|
+
"types": "./dist/streaming/index.d.ts",
|
|
39
|
+
"default": "./dist/streaming/index.js"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"./streaming/writer": {
|
|
43
|
+
"import": {
|
|
44
|
+
"types": "./dist/streaming/writer.d.ts",
|
|
45
|
+
"default": "./dist/streaming/writer.js"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"./streaming/spinner": {
|
|
49
|
+
"import": {
|
|
50
|
+
"types": "./dist/streaming/spinner.d.ts",
|
|
51
|
+
"default": "./dist/streaming/spinner.js"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"./streaming/ansi": {
|
|
55
|
+
"import": {
|
|
56
|
+
"types": "./dist/streaming/ansi.d.ts",
|
|
57
|
+
"default": "./dist/streaming/ansi.js"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"./box": {
|
|
61
|
+
"import": {
|
|
62
|
+
"types": "./dist/box/index.d.ts",
|
|
63
|
+
"default": "./dist/box/index.js"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"./theme/create": {
|
|
67
|
+
"import": {
|
|
68
|
+
"types": "./dist/theme/create.d.ts",
|
|
69
|
+
"default": "./dist/theme/create.js"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"./theme": {
|
|
73
|
+
"import": {
|
|
74
|
+
"types": "./dist/theme/index.d.ts",
|
|
75
|
+
"default": "./dist/theme/index.js"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"./theme/context": {
|
|
79
|
+
"import": {
|
|
80
|
+
"types": "./dist/theme/context.d.ts",
|
|
81
|
+
"default": "./dist/theme/context.js"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"./theme/resolve": {
|
|
85
|
+
"import": {
|
|
86
|
+
"types": "./dist/theme/resolve.d.ts",
|
|
87
|
+
"default": "./dist/theme/resolve.js"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"./theme/types": {
|
|
91
|
+
"import": {
|
|
92
|
+
"types": "./dist/theme/types.d.ts",
|
|
93
|
+
"default": "./dist/theme/types.js"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"./theme/presets/default": {
|
|
97
|
+
"import": {
|
|
98
|
+
"types": "./dist/theme/presets/default.d.ts",
|
|
99
|
+
"default": "./dist/theme/presets/default.js"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"./theme/presets/bold": {
|
|
103
|
+
"import": {
|
|
104
|
+
"types": "./dist/theme/presets/bold.d.ts",
|
|
105
|
+
"default": "./dist/theme/presets/bold.js"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"./theme/presets/rounded": {
|
|
109
|
+
"import": {
|
|
110
|
+
"types": "./dist/theme/presets/rounded.d.ts",
|
|
111
|
+
"default": "./dist/theme/presets/rounded.js"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"./prompt": {
|
|
115
|
+
"import": {
|
|
116
|
+
"types": "./dist/prompt/index.d.ts",
|
|
117
|
+
"default": "./dist/prompt/index.js"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"./prompt/text": {
|
|
121
|
+
"import": {
|
|
122
|
+
"types": "./dist/prompt/text.d.ts",
|
|
123
|
+
"default": "./dist/prompt/text.js"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"./prompt/confirm": {
|
|
127
|
+
"import": {
|
|
128
|
+
"types": "./dist/prompt/confirm.d.ts",
|
|
129
|
+
"default": "./dist/prompt/confirm.js"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"./prompt/group": {
|
|
133
|
+
"import": {
|
|
134
|
+
"types": "./dist/prompt/group.d.ts",
|
|
135
|
+
"default": "./dist/prompt/group.js"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"./prompt/types": {
|
|
139
|
+
"import": {
|
|
140
|
+
"types": "./dist/prompt/types.d.ts",
|
|
141
|
+
"default": "./dist/prompt/types.js"
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"./colors": {
|
|
145
|
+
"import": {
|
|
146
|
+
"types": "./dist/colors/index.d.ts",
|
|
147
|
+
"default": "./dist/colors/index.js"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"./terminal/detection": {
|
|
151
|
+
"import": {
|
|
152
|
+
"types": "./dist/terminal/detection.d.ts",
|
|
153
|
+
"default": "./dist/terminal/detection.js"
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"./terminal": {
|
|
157
|
+
"import": {
|
|
158
|
+
"types": "./dist/terminal/index.d.ts",
|
|
159
|
+
"default": "./dist/terminal/index.js"
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"./tree": {
|
|
163
|
+
"import": {
|
|
164
|
+
"types": "./dist/tree/index.d.ts",
|
|
165
|
+
"default": "./dist/tree/index.js"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"./table": {
|
|
169
|
+
"import": {
|
|
170
|
+
"types": "./dist/table/index.d.ts",
|
|
171
|
+
"default": "./dist/table/index.js"
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"./list": {
|
|
175
|
+
"import": {
|
|
176
|
+
"types": "./dist/list/index.d.ts",
|
|
177
|
+
"default": "./dist/list/index.js"
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"./borders": {
|
|
181
|
+
"import": {
|
|
182
|
+
"types": "./dist/borders/index.d.ts",
|
|
183
|
+
"default": "./dist/borders/index.js"
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"./preset/standard": {
|
|
187
|
+
"import": {
|
|
188
|
+
"types": "./dist/preset/standard.d.ts",
|
|
189
|
+
"default": "./dist/preset/standard.js"
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"./preset/full": {
|
|
193
|
+
"import": {
|
|
194
|
+
"types": "./dist/preset/full.d.ts",
|
|
195
|
+
"default": "./dist/preset/full.js"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"./prompt/select": {
|
|
199
|
+
"import": {
|
|
200
|
+
"types": "./dist/prompt/select.d.ts",
|
|
201
|
+
"default": "./dist/prompt/select.js"
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"./prompt/validators": {
|
|
205
|
+
"import": {
|
|
206
|
+
"types": "./dist/prompt/validators.d.ts",
|
|
207
|
+
"default": "./dist/prompt/validators.js"
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"./demo/section": {
|
|
211
|
+
"import": {
|
|
212
|
+
"types": "./dist/demo/section.d.ts",
|
|
213
|
+
"default": "./dist/demo/section.js"
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"./demo": {
|
|
217
|
+
"import": {
|
|
218
|
+
"types": "./dist/demo/index.d.ts",
|
|
219
|
+
"default": "./dist/demo/index.js"
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"./output": {
|
|
223
|
+
"import": {
|
|
224
|
+
"types": "./dist/output.d.ts",
|
|
225
|
+
"default": "./dist/output.js"
|
|
34
226
|
}
|
|
35
227
|
},
|
|
36
228
|
"./input": {
|
|
@@ -39,12 +231,24 @@
|
|
|
39
231
|
"default": "./dist/input.js"
|
|
40
232
|
}
|
|
41
233
|
},
|
|
234
|
+
"./pagination": {
|
|
235
|
+
"import": {
|
|
236
|
+
"types": "./dist/pagination.d.ts",
|
|
237
|
+
"default": "./dist/pagination.js"
|
|
238
|
+
}
|
|
239
|
+
},
|
|
42
240
|
"./actions": {
|
|
43
241
|
"import": {
|
|
44
242
|
"types": "./dist/actions.d.ts",
|
|
45
243
|
"default": "./dist/actions.js"
|
|
46
244
|
}
|
|
47
245
|
},
|
|
246
|
+
"./types": {
|
|
247
|
+
"import": {
|
|
248
|
+
"types": "./dist/types.d.ts",
|
|
249
|
+
"default": "./dist/types.js"
|
|
250
|
+
}
|
|
251
|
+
},
|
|
48
252
|
"./command": {
|
|
49
253
|
"import": {
|
|
50
254
|
"types": "./dist/command.d.ts",
|
|
@@ -55,7 +259,7 @@
|
|
|
55
259
|
},
|
|
56
260
|
"sideEffects": false,
|
|
57
261
|
"scripts": {
|
|
58
|
-
"build": "bunup --filter @outfitter/cli",
|
|
262
|
+
"build": "cd ../.. && bunup --filter @outfitter/cli",
|
|
59
263
|
"test": "bun test",
|
|
60
264
|
"test:watch": "bun test --watch",
|
|
61
265
|
"lint": "biome lint ./src",
|
|
@@ -65,13 +269,14 @@
|
|
|
65
269
|
},
|
|
66
270
|
"dependencies": {
|
|
67
271
|
"@clack/prompts": "^0.11.0",
|
|
68
|
-
"@outfitter/
|
|
69
|
-
"@outfitter/
|
|
272
|
+
"@outfitter/config": "0.1.0-rc.3",
|
|
273
|
+
"@outfitter/contracts": "0.1.0-rc.2",
|
|
274
|
+
"@outfitter/types": "0.1.0-rc.3",
|
|
70
275
|
"better-result": "^2.5.1",
|
|
71
276
|
"commander": "^14.0.2"
|
|
72
277
|
},
|
|
73
278
|
"devDependencies": {
|
|
74
|
-
"@types/bun": "^1.3.
|
|
279
|
+
"@types/bun": "^1.3.7",
|
|
75
280
|
"@types/node": "^25.0.10",
|
|
76
281
|
"typescript": "^5.9.3"
|
|
77
282
|
},
|
|
@@ -79,7 +284,7 @@
|
|
|
79
284
|
"zod": "^4.3.5"
|
|
80
285
|
},
|
|
81
286
|
"engines": {
|
|
82
|
-
"bun": ">=1.3.
|
|
287
|
+
"bun": ">=1.3.7"
|
|
83
288
|
},
|
|
84
289
|
"publishConfig": {
|
|
85
290
|
"access": "public"
|
|
@@ -95,6 +300,9 @@
|
|
|
95
300
|
"commander",
|
|
96
301
|
"typescript",
|
|
97
302
|
"bun",
|
|
98
|
-
"outfitter"
|
|
303
|
+
"outfitter",
|
|
304
|
+
"terminal",
|
|
305
|
+
"colors",
|
|
306
|
+
"renderers"
|
|
99
307
|
]
|
|
100
308
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
8
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
9
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
10
|
-
for (let key of __getOwnPropNames(mod))
|
|
11
|
-
if (!__hasOwnProp.call(to, key))
|
|
12
|
-
__defProp(to, key, {
|
|
13
|
-
get: () => mod[key],
|
|
14
|
-
enumerable: true
|
|
15
|
-
});
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __require = import.meta.require;
|
|
19
|
-
|
|
20
|
-
export { __toESM, __require };
|