cli-forge 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +12 -2
- package/src/lib/cli-forge.d.ts +74 -3
- package/src/lib/cli-forge.js +92 -4
- package/src/lib/cli-forge.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cli-forge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"tslib": "^2.3.0"
|
|
5
|
+
"tslib": "^2.3.0",
|
|
6
|
+
"@cli-forge/parser": "0.2.0"
|
|
6
7
|
},
|
|
7
8
|
"type": "commonjs",
|
|
8
9
|
"main": "./src/index.js",
|
|
9
10
|
"typings": "./src/index.d.ts",
|
|
11
|
+
"license": "ISC",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"directory": "packages/cli-forge",
|
|
15
|
+
"url": "https://github.com/AgentEnder/cli-forge"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
10
20
|
"types": "./src/index.d.ts"
|
|
11
21
|
}
|
package/src/lib/cli-forge.d.ts
CHANGED
|
@@ -1,35 +1,106 @@
|
|
|
1
1
|
import { ArrayOptionConfig, OptionConfig, ParsedArgs } from '@cli-forge/parser';
|
|
2
|
-
type CLICommandOptions<TInitial extends ParsedArgs, TArgs extends TInitial> = {
|
|
2
|
+
export type CLICommandOptions<TInitial extends ParsedArgs, TArgs extends TInitial> = {
|
|
3
3
|
description?: string;
|
|
4
4
|
builder?: (parser: CLI<TInitial>) => CLI<TArgs>;
|
|
5
|
-
handler: (args: TArgs) => void
|
|
5
|
+
handler: (args: TArgs) => void | Promise<void>;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* The base class for a CLI application. This class is used to define the structure of the CLI.
|
|
9
|
+
*
|
|
10
|
+
* {@link cli} is provided as a small helper function to create a new CLI instance.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { cli } from 'cli-forge';
|
|
15
|
+
*
|
|
16
|
+
* cli('basic-cli').command('hello', {
|
|
17
|
+
* builder: (args) =>
|
|
18
|
+
* args.option('name', {
|
|
19
|
+
* type: 'string',
|
|
20
|
+
* }),
|
|
21
|
+
* handler: (args) => {
|
|
22
|
+
* console.log(`Hello, ${args.name}!`);
|
|
23
|
+
* }).forge();
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare class CLI<T extends ParsedArgs = ParsedArgs> {
|
|
8
27
|
name: string;
|
|
9
28
|
protected configuration?: CLICommandOptions<T, T> | undefined;
|
|
10
29
|
private commands;
|
|
11
30
|
private commandChain;
|
|
12
31
|
private requiresCommand;
|
|
13
32
|
private parser;
|
|
33
|
+
/**
|
|
34
|
+
* @param name What should the name of the cli command be?
|
|
35
|
+
* @param configuration Configuration for the current CLI command.
|
|
36
|
+
*/
|
|
14
37
|
constructor(name: string, configuration?: CLICommandOptions<T, T> | undefined);
|
|
38
|
+
/**
|
|
39
|
+
* Registers a new command with the CLI.
|
|
40
|
+
* @param key What should the new command be called?
|
|
41
|
+
* @param options Settings for the new command. See {@link CLICommandOptions}.
|
|
42
|
+
* @returns Updated CLI instance with the new command registered.
|
|
43
|
+
*/
|
|
15
44
|
command<TArgs extends T>(key: string, options: CLICommandOptions<T, TArgs>): this;
|
|
45
|
+
/**
|
|
46
|
+
* Registers a new option for the CLI command. This option will be accessible
|
|
47
|
+
* within the command handler, as well as any subcommands.
|
|
48
|
+
*
|
|
49
|
+
* @param name The name of the option.
|
|
50
|
+
* @param config Configuration for the option. See {@link OptionConfig}.
|
|
51
|
+
* @returns Updated CLI instance with the new option registered.
|
|
52
|
+
*/
|
|
16
53
|
option<TOption extends string, TOptionConfig extends OptionConfig>(name: TOption, config: TOptionConfig): CLI<T & { [key in TOption]: TOptionConfig["coerce"] extends (value: string) => infer TCoerce ? TCoerce : {
|
|
17
54
|
string: string;
|
|
18
55
|
number: number;
|
|
19
56
|
boolean: boolean;
|
|
20
57
|
array: (TOptionConfig extends ArrayOptionConfig<string | number> ? TOptionConfig["items"] extends "string" ? string : number : never)[];
|
|
21
58
|
}[TOptionConfig["type"]]; }>;
|
|
59
|
+
/**
|
|
60
|
+
* Registers a new positional argument for the CLI command. This argument will be accessible
|
|
61
|
+
* within the command handler, as well as any subcommands.
|
|
62
|
+
* @param name The name of the positional argument.
|
|
63
|
+
* @param config Configuration for the positional argument. See {@link OptionConfig}.
|
|
64
|
+
* @returns Updated CLI instance with the new positional argument registered.
|
|
65
|
+
*/
|
|
22
66
|
positional<TOption extends string, TOptionConfig extends OptionConfig>(name: TOption, config: TOptionConfig): CLI<T & { [key in TOption]: {
|
|
23
67
|
string: string;
|
|
24
68
|
number: number;
|
|
25
69
|
boolean: boolean;
|
|
26
70
|
array: (TOptionConfig extends ArrayOptionConfig<string | number> ? TOptionConfig["items"] extends "string" ? string : number : never)[];
|
|
27
71
|
}[TOptionConfig["type"]]; }>;
|
|
72
|
+
/**
|
|
73
|
+
* Requires a command to be provided when executing the CLI. Useful if your parent command
|
|
74
|
+
* cannot be executed on its own.
|
|
75
|
+
* @returns Updated CLI instance.
|
|
76
|
+
*/
|
|
28
77
|
demandCommand(): this;
|
|
78
|
+
/**
|
|
79
|
+
* Gets help text for the current command as a string.
|
|
80
|
+
* @returns Help text for the current command.
|
|
81
|
+
*/
|
|
29
82
|
formatHelp(): string;
|
|
83
|
+
/**
|
|
84
|
+
* Prints help text for the current command to the console.
|
|
85
|
+
*/
|
|
30
86
|
printHelp(): void;
|
|
87
|
+
/**
|
|
88
|
+
* Runs the current command.
|
|
89
|
+
* @param cmd The command to run.
|
|
90
|
+
* @param args The arguments to pass to the command.
|
|
91
|
+
*/
|
|
31
92
|
runCommand<T extends ParsedArgs>(cmd: CLI<T>, args: T): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Parses argv and executes the CLI
|
|
95
|
+
* @param args argv. Defaults to process.argv.slice(2)
|
|
96
|
+
* @returns Promise that resolves when the handler completes.
|
|
97
|
+
*/
|
|
32
98
|
forge(args?: string[]): Promise<void>;
|
|
33
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Constructs a CLI instance. See {@link CLI} for more information.
|
|
102
|
+
* @param name Name for the top level CLI
|
|
103
|
+
* @returns
|
|
104
|
+
*/
|
|
34
105
|
export declare function cli(name: string): CLI<ParsedArgs>;
|
|
35
106
|
export default cli;
|
package/src/lib/cli-forge.js
CHANGED
|
@@ -4,16 +4,41 @@ exports.CLI = void 0;
|
|
|
4
4
|
exports.cli = cli;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const parser_1 = require("@cli-forge/parser");
|
|
7
|
+
/**
|
|
8
|
+
* The base class for a CLI application. This class is used to define the structure of the CLI.
|
|
9
|
+
*
|
|
10
|
+
* {@link cli} is provided as a small helper function to create a new CLI instance.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { cli } from 'cli-forge';
|
|
15
|
+
*
|
|
16
|
+
* cli('basic-cli').command('hello', {
|
|
17
|
+
* builder: (args) =>
|
|
18
|
+
* args.option('name', {
|
|
19
|
+
* type: 'string',
|
|
20
|
+
* }),
|
|
21
|
+
* handler: (args) => {
|
|
22
|
+
* console.log(`Hello, ${args.name}!`);
|
|
23
|
+
* }).forge();
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
7
26
|
class CLI {
|
|
27
|
+
/**
|
|
28
|
+
* @param name What should the name of the cli command be?
|
|
29
|
+
* @param configuration Configuration for the current CLI command.
|
|
30
|
+
*/
|
|
8
31
|
constructor(name, configuration) {
|
|
9
32
|
this.name = name;
|
|
10
33
|
this.configuration = configuration;
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
35
|
this.commands = {};
|
|
12
36
|
this.commandChain = [];
|
|
13
37
|
this.requiresCommand = false;
|
|
14
38
|
this.parser = new parser_1.ArgvParser({
|
|
15
|
-
unmatchedParser: (arg
|
|
39
|
+
unmatchedParser: (arg) => {
|
|
16
40
|
var _a, _b;
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias, @typescript-eslint/no-explicit-any
|
|
17
42
|
let currentCommand = this;
|
|
18
43
|
for (const command of this.commandChain) {
|
|
19
44
|
currentCommand = currentCommand.commands[command];
|
|
@@ -32,29 +57,66 @@ class CLI {
|
|
|
32
57
|
description: 'Show help for the current command',
|
|
33
58
|
});
|
|
34
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Registers a new command with the CLI.
|
|
62
|
+
* @param key What should the new command be called?
|
|
63
|
+
* @param options Settings for the new command. See {@link CLICommandOptions}.
|
|
64
|
+
* @returns Updated CLI instance with the new command registered.
|
|
65
|
+
*/
|
|
35
66
|
command(key, options) {
|
|
36
67
|
if (key === '$0') {
|
|
37
|
-
this.configuration = Object.assign(Object.assign({}, this.configuration), {
|
|
68
|
+
this.configuration = Object.assign(Object.assign({}, this.configuration), {
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
70
|
+
builder: options.builder,
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
|
+
handler: options.handler, description: options.description });
|
|
38
73
|
}
|
|
39
74
|
this.commands[key] = new CLI(key, options);
|
|
40
75
|
this.commands[key].parser = this.parser;
|
|
41
76
|
return this;
|
|
42
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Registers a new option for the CLI command. This option will be accessible
|
|
80
|
+
* within the command handler, as well as any subcommands.
|
|
81
|
+
*
|
|
82
|
+
* @param name The name of the option.
|
|
83
|
+
* @param config Configuration for the option. See {@link OptionConfig}.
|
|
84
|
+
* @returns Updated CLI instance with the new option registered.
|
|
85
|
+
*/
|
|
43
86
|
option(name, config) {
|
|
44
87
|
this.parser.option(name, config);
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
89
|
return this;
|
|
46
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Registers a new positional argument for the CLI command. This argument will be accessible
|
|
93
|
+
* within the command handler, as well as any subcommands.
|
|
94
|
+
* @param name The name of the positional argument.
|
|
95
|
+
* @param config Configuration for the positional argument. See {@link OptionConfig}.
|
|
96
|
+
* @returns Updated CLI instance with the new positional argument registered.
|
|
97
|
+
*/
|
|
47
98
|
positional(name, config) {
|
|
48
99
|
this.parser.option(name, config);
|
|
100
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
49
101
|
return this;
|
|
50
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Requires a command to be provided when executing the CLI. Useful if your parent command
|
|
105
|
+
* cannot be executed on its own.
|
|
106
|
+
* @returns Updated CLI instance.
|
|
107
|
+
*/
|
|
51
108
|
demandCommand() {
|
|
52
109
|
this.requiresCommand = true;
|
|
53
110
|
return this;
|
|
54
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Gets help text for the current command as a string.
|
|
114
|
+
* @returns Help text for the current command.
|
|
115
|
+
*/
|
|
55
116
|
formatHelp() {
|
|
56
117
|
var _a, _b;
|
|
57
118
|
const help = [];
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
58
120
|
let command = this;
|
|
59
121
|
for (const key of this.commandChain) {
|
|
60
122
|
command = command.commands[key];
|
|
@@ -78,6 +140,7 @@ class CLI {
|
|
|
78
140
|
help.push('Options:');
|
|
79
141
|
}
|
|
80
142
|
for (const key in this.parser.configuredOptions) {
|
|
143
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
81
144
|
const option = this.parser.configuredOptions[key];
|
|
82
145
|
help.push(` --${key}${option.description ? ' - ' + option.description : ''}`);
|
|
83
146
|
}
|
|
@@ -87,23 +150,42 @@ class CLI {
|
|
|
87
150
|
}
|
|
88
151
|
return help.join('\n');
|
|
89
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* Prints help text for the current command to the console.
|
|
155
|
+
*/
|
|
90
156
|
printHelp() {
|
|
91
157
|
console.log(this.formatHelp());
|
|
92
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* Runs the current command.
|
|
161
|
+
* @param cmd The command to run.
|
|
162
|
+
* @param args The arguments to pass to the command.
|
|
163
|
+
*/
|
|
93
164
|
runCommand(cmd, args) {
|
|
94
165
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
166
|
+
var _a;
|
|
95
167
|
try {
|
|
96
168
|
if (cmd.requiresCommand) {
|
|
97
169
|
throw new Error(`${[this.name, ...this.commandChain].join(' ')} requires a command`);
|
|
98
170
|
}
|
|
99
|
-
|
|
171
|
+
if ((_a = cmd.configuration) === null || _a === void 0 ? void 0 : _a.handler) {
|
|
172
|
+
yield cmd.configuration.handler(args);
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
throw new Error(`${[this.name, ...this.commandChain].join(' ')} is not implemented.`);
|
|
176
|
+
}
|
|
100
177
|
}
|
|
101
|
-
catch (
|
|
178
|
+
catch (_b) {
|
|
102
179
|
process.exitCode = 1;
|
|
103
180
|
this.printHelp();
|
|
104
181
|
}
|
|
105
182
|
});
|
|
106
183
|
}
|
|
184
|
+
/**
|
|
185
|
+
* Parses argv and executes the CLI
|
|
186
|
+
* @param args argv. Defaults to process.argv.slice(2)
|
|
187
|
+
* @returns Promise that resolves when the handler completes.
|
|
188
|
+
*/
|
|
107
189
|
forge() {
|
|
108
190
|
return tslib_1.__awaiter(this, arguments, void 0, function* (args = process.argv.slice(2)) {
|
|
109
191
|
var _a, _b, _c;
|
|
@@ -111,6 +193,7 @@ class CLI {
|
|
|
111
193
|
// - builds argv to pass to handler
|
|
112
194
|
// - fills the command chain + registers commands
|
|
113
195
|
const argv = this.parser.parse(args);
|
|
196
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias, @typescript-eslint/no-explicit-any
|
|
114
197
|
let currentCommand = this;
|
|
115
198
|
for (const command of this.commandChain) {
|
|
116
199
|
currentCommand = currentCommand.commands[command];
|
|
@@ -127,6 +210,11 @@ class CLI {
|
|
|
127
210
|
}
|
|
128
211
|
}
|
|
129
212
|
exports.CLI = CLI;
|
|
213
|
+
/**
|
|
214
|
+
* Constructs a CLI instance. See {@link CLI} for more information.
|
|
215
|
+
* @param name Name for the top level CLI
|
|
216
|
+
* @returns
|
|
217
|
+
*/
|
|
130
218
|
function cli(name) {
|
|
131
219
|
return new CLI(name);
|
|
132
220
|
}
|
package/src/lib/cli-forge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-forge.js","sourceRoot":"","sources":["../../../../../packages/cli-forge/src/lib/cli-forge.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"cli-forge.js","sourceRoot":"","sources":["../../../../../packages/cli-forge/src/lib/cli-forge.ts"],"names":[],"mappings":";;;AAgSA,kBAEC;;AAlSD,8CAK2B;AAW3B;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,GAAG;IA0Bd;;;OAGG;IACH,YACS,IAAY,EACT,aAAuC;QAD1C,SAAI,GAAJ,IAAI,CAAQ;QACT,kBAAa,GAAb,aAAa,CAA0B;QA/BnD,8DAA8D;QACtD,aAAQ,GAA6B,EAAE,CAAC;QACxC,iBAAY,GAAa,EAAE,CAAC;QAC5B,oBAAe,GAAG,KAAK,CAAC;QACxB,WAAM,GAAG,IAAI,mBAAU,CAAI;YACjC,eAAe,EAAE,CAAC,GAAG,EAAE,EAAE;;gBACvB,gGAAgG;gBAChG,IAAI,cAAc,GAAa,IAAI,CAAC;gBACpC,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;oBACxC,cAAc,GAAG,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;gBACpD,CAAC;gBACD,MAAM,OAAO,GAAG,cAAc,CAAC,QAAQ,CAAC,GAA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