@twin.org/cli-core 0.0.1-next.9 → 0.0.2-next.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.
@@ -4,13 +4,13 @@ The main entry point for the CLI.
4
4
 
5
5
  ## Constructors
6
6
 
7
- ### new CLIBase()
7
+ ### Constructor
8
8
 
9
- > **new CLIBase**(): [`CLIBase`](CLIBase.md)
9
+ > **new CLIBase**(): `CLIBase`
10
10
 
11
11
  #### Returns
12
12
 
13
- [`CLIBase`](CLIBase.md)
13
+ `CLIBase`
14
14
 
15
15
  ## Methods
16
16
 
@@ -22,15 +22,21 @@ Execute the command line processing.
22
22
 
23
23
  #### Parameters
24
24
 
25
- **options**: [`ICliOptions`](../interfaces/ICliOptions.md)
25
+ ##### options
26
+
27
+ [`ICliOptions`](../interfaces/ICliOptions.md)
26
28
 
27
29
  The options for the CLI.
28
30
 
29
- **localesDirectory**: `string`
31
+ ##### localesDirectory
32
+
33
+ `string`
30
34
 
31
35
  The path to load the locales from.
32
36
 
33
- **argv**: `string`[]
37
+ ##### argv
38
+
39
+ `string`[]
34
40
 
35
41
  The process arguments.
36
42
 
@@ -50,7 +56,9 @@ Configure any options or actions at the root program level.
50
56
 
51
57
  #### Parameters
52
58
 
53
- **program**: `Command`
59
+ ##### program
60
+
61
+ `Command`
54
62
 
55
63
  The root program command.
56
64
 
@@ -68,7 +76,9 @@ Get the commands for the CLI, override in derived class to supply your own.
68
76
 
69
77
  #### Parameters
70
78
 
71
- **program**: `Command`
79
+ ##### program
80
+
81
+ `Command`
72
82
 
73
83
  The main program that the commands will be added to.
74
84
 
@@ -4,13 +4,13 @@ Display utilities for the CLI.
4
4
 
5
5
  ## Constructors
6
6
 
7
- ### new CLIDisplay()
7
+ ### Constructor
8
8
 
9
- > **new CLIDisplay**(): [`CLIDisplay`](CLIDisplay.md)
9
+ > **new CLIDisplay**(): `CLIDisplay`
10
10
 
11
11
  #### Returns
12
12
 
13
- [`CLIDisplay`](CLIDisplay.md)
13
+ `CLIDisplay`
14
14
 
15
15
  ## Properties
16
16
 
@@ -22,10 +22,12 @@ The default output method for writing standard messages.
22
22
 
23
23
  #### Parameters
24
24
 
25
- **buffer**: `string` \| `Uint8Array`
25
+ ##### buffer
26
26
 
27
27
  The message to output.
28
28
 
29
+ `string` | `Uint8Array`\<`ArrayBufferLike`\>
30
+
29
31
  #### Returns
30
32
 
31
33
  `void`
@@ -40,10 +42,12 @@ The default output method for writing error messages.
40
42
 
41
43
  #### Parameters
42
44
 
43
- **buffer**: `string` \| `Uint8Array`
45
+ ##### buffer
44
46
 
45
47
  The message to output.
46
48
 
49
+ `string` | `Uint8Array`\<`ArrayBufferLike`\>
50
+
47
51
  #### Returns
48
52
 
49
53
  `void`
@@ -70,15 +74,21 @@ Display the header for the CLI.
70
74
 
71
75
  #### Parameters
72
76
 
73
- **title**: `string`
77
+ ##### title
78
+
79
+ `string`
74
80
 
75
81
  The title of the CLI.
76
82
 
77
- **version**: `string`
83
+ ##### version
84
+
85
+ `string`
78
86
 
79
87
  The version of the CLI.
80
88
 
81
- **icon**: `string`
89
+ ##### icon
90
+
91
+ `string`
82
92
 
83
93
  The icon for the CLI.
84
94
 
@@ -96,11 +106,15 @@ Display an error message.
96
106
 
97
107
  #### Parameters
98
108
 
99
- **error**: `unknown`
109
+ ##### error
110
+
111
+ `unknown`
100
112
 
101
113
  The error to display.
102
114
 
103
- **lineBreaks**: `boolean` = `true`
115
+ ##### lineBreaks
116
+
117
+ `boolean` = `true`
104
118
 
105
119
  Whether to add a line break after the error.
106
120
 
@@ -118,7 +132,9 @@ Display a section.
118
132
 
119
133
  #### Parameters
120
134
 
121
- **label**: `string`
135
+ ##### label
136
+
137
+ `string`
122
138
 
123
139
  The label for the section.
124
140
 
@@ -136,15 +152,21 @@ Display a value with a label.
136
152
 
137
153
  #### Parameters
138
154
 
139
- **label**: `string`
155
+ ##### label
156
+
157
+ `string`
140
158
 
141
159
  The label for the value.
142
160
 
143
- **value**: `unknown`
161
+ ##### value
162
+
163
+ `unknown`
144
164
 
145
165
  The value to display.
146
166
 
147
- **indentLevel**: `number` = `0`
167
+ ##### indentLevel
168
+
169
+ `number` = `0`
148
170
 
149
171
  The level of indentation.
150
172
 
@@ -156,17 +178,21 @@ The level of indentation.
156
178
 
157
179
  ### task()
158
180
 
159
- > `static` **task**(`label`, `task`?): `void`
181
+ > `static` **task**(`label`, `task?`): `void`
160
182
 
161
183
  Display a task with a label.
162
184
 
163
185
  #### Parameters
164
186
 
165
- **label**: `string`
187
+ ##### label
188
+
189
+ `string`
166
190
 
167
191
  The label for the value.
168
192
 
169
- **task?**: `string`
193
+ ##### task?
194
+
195
+ `string`
170
196
 
171
197
  The task to display.
172
198
 
@@ -196,7 +222,9 @@ Display formatted and colorized JSON.
196
222
 
197
223
  #### Parameters
198
224
 
199
- **obj**: `unknown`
225
+ ##### obj
226
+
227
+ `unknown`
200
228
 
201
229
  The object to display.
202
230
 
@@ -226,15 +254,21 @@ Start the spinner.
226
254
 
227
255
  #### Parameters
228
256
 
229
- **i18nMessage**: `string` = `"cli.progress.pleaseWait"`
257
+ ##### i18nMessage
258
+
259
+ `string` = `"cli.progress.pleaseWait"`
230
260
 
231
261
  The message to display with the spinner.
232
262
 
233
- **spinnerCharacters**: `string`[] = `...`
263
+ ##### spinnerCharacters
264
+
265
+ `string`[] = `...`
234
266
 
235
267
  The characters to use in the spinner.
236
268
 
237
- **interval**: `number` = `100`
269
+ ##### interval
270
+
271
+ `number` = `100`
238
272
 
239
273
  The interval for the spinner.
240
274
 
@@ -4,13 +4,13 @@ Utilities for getting standard options.
4
4
 
5
5
  ## Constructors
6
6
 
7
- ### new CLIOptions()
7
+ ### Constructor
8
8
 
9
- > **new CLIOptions**(): [`CLIOptions`](CLIOptions.md)
9
+ > **new CLIOptions**(): `CLIOptions`
10
10
 
11
11
  #### Returns
12
12
 
13
- [`CLIOptions`](CLIOptions.md)
13
+ `CLIOptions`
14
14
 
15
15
  ## Methods
16
16
 
@@ -22,31 +22,43 @@ Get the options for output.
22
22
 
23
23
  #### Parameters
24
24
 
25
- **command**: `Command`
25
+ ##### command
26
+
27
+ `Command`
26
28
 
27
29
  The command to add the options to.
28
30
 
29
- **opts**
31
+ ##### opts
30
32
 
31
33
  The options of what to include.
32
34
 
33
- **opts.noConsole**: `boolean`
35
+ ###### noConsole
36
+
37
+ `boolean`
34
38
 
35
39
  Do not output to the console.
36
40
 
37
- **opts.json**: `boolean`
41
+ ###### json
42
+
43
+ `boolean`
38
44
 
39
45
  Output to a JSON file.
40
46
 
41
- **opts.env**: `boolean`
47
+ ###### env
48
+
49
+ `boolean`
42
50
 
43
51
  Output to an environment file.
44
52
 
45
- **opts.mergeJson**: `boolean`
53
+ ###### mergeJson
54
+
55
+ `boolean`
46
56
 
47
57
  Merge existing JSON file.
48
58
 
49
- **opts.mergeEnv**: `boolean`
59
+ ###### mergeEnv
60
+
61
+ `boolean`
50
62
 
51
63
  Merge existing environment file.
52
64
 
@@ -4,13 +4,13 @@ Parameter utilities for the CLI.
4
4
 
5
5
  ## Constructors
6
6
 
7
- ### new CLIParam()
7
+ ### Constructor
8
8
 
9
- > **new CLIParam**(): [`CLIParam`](CLIParam.md)
9
+ > **new CLIParam**(): `CLIParam`
10
10
 
11
11
  #### Returns
12
12
 
13
- [`CLIParam`](CLIParam.md)
13
+ `CLIParam`
14
14
 
15
15
  ## Methods
16
16
 
@@ -22,15 +22,21 @@ Check the option to see if it exists.
22
22
 
23
23
  #### Parameters
24
24
 
25
- **optionName**: `string`
25
+ ##### optionName
26
+
27
+ `string`
26
28
 
27
29
  The name of the option.
28
30
 
29
- **optionValue**: `undefined` \| `string`
31
+ ##### optionValue
30
32
 
31
33
  The option value.
32
34
 
33
- **allowEnvVar**: `boolean`
35
+ `undefined` | `string`
36
+
37
+ ##### allowEnvVar
38
+
39
+ `boolean`
34
40
 
35
41
  Allow the option to be read from an env var.
36
42
 
@@ -50,19 +56,25 @@ An error if the option is invalid.
50
56
 
51
57
  > `static` **stringValue**(`optionName`, `optionValue`, `allowEnvVar`): `string`
52
58
 
53
- Check the option to see if it exists.
59
+ Check the option to see if the String exists.
54
60
 
55
61
  #### Parameters
56
62
 
57
- **optionName**: `string`
63
+ ##### optionName
64
+
65
+ `string`
58
66
 
59
67
  The name of the option.
60
68
 
61
- **optionValue**: `undefined` \| `string`
69
+ ##### optionValue
62
70
 
63
71
  The option value.
64
72
 
65
- • **allowEnvVar**: `boolean` = `true`
73
+ `undefined` | `string`
74
+
75
+ ##### allowEnvVar
76
+
77
+ `boolean` = `true`
66
78
 
67
79
  Allow the option to be read from an env var.
68
80
 
@@ -82,19 +94,25 @@ An error if the option is invalid.
82
94
 
83
95
  > `static` **url**(`optionName`, `optionValue`, `allowEnvVar`): `string`
84
96
 
85
- Check the option to see if it a url.
97
+ Check the option to see if it is a url.
86
98
 
87
99
  #### Parameters
88
100
 
89
- **optionName**: `string`
101
+ ##### optionName
102
+
103
+ `string`
90
104
 
91
105
  The name of the option.
92
106
 
93
- **optionValue**: `undefined` \| `string`
107
+ ##### optionValue
94
108
 
95
109
  The option value.
96
110
 
97
- • **allowEnvVar**: `boolean` = `true`
111
+ `undefined` | `string`
112
+
113
+ ##### allowEnvVar
114
+
115
+ `boolean` = `true`
98
116
 
99
117
  Allow the option to be read from an env var.
100
118
 
@@ -112,29 +130,39 @@ An error if the option is invalid.
112
130
 
113
131
  ### number()
114
132
 
115
- > `static` **number**(`optionName`, `optionValue`, `allowEnvVar`, `minValue`, `maxValue`?): `number`
133
+ > `static` **number**(`optionName`, `optionValue`, `allowEnvVar`, `minValue`, `maxValue?`): `number`
116
134
 
117
135
  Check the option to see if it exists and is a number.
118
136
 
119
137
  #### Parameters
120
138
 
121
- **optionName**: `string`
139
+ ##### optionName
140
+
141
+ `string`
122
142
 
123
143
  The name of the option.
124
144
 
125
- **optionValue**: `undefined` \| `string`
145
+ ##### optionValue
126
146
 
127
147
  The option value.
128
148
 
129
- • **allowEnvVar**: `boolean` = `true`
149
+ `undefined` | `string`
150
+
151
+ ##### allowEnvVar
152
+
153
+ `boolean` = `true`
130
154
 
131
155
  Allow the option to be read from an env var.
132
156
 
133
- **minValue**: `number` = `0`
157
+ ##### minValue
158
+
159
+ `number` = `0`
134
160
 
135
161
  The minimum value.
136
162
 
137
- **maxValue?**: `number`
163
+ ##### maxValue?
164
+
165
+ `number`
138
166
 
139
167
  The maximum value.
140
168
 
@@ -152,29 +180,39 @@ An error if the option is invalid.
152
180
 
153
181
  ### integer()
154
182
 
155
- > `static` **integer**(`optionName`, `optionValue`, `allowEnvVar`, `minValue`, `maxValue`?): `number`
183
+ > `static` **integer**(`optionName`, `optionValue`, `allowEnvVar`, `minValue`, `maxValue?`): `number`
156
184
 
157
185
  Check the option to see if it exists and is an integer.
158
186
 
159
187
  #### Parameters
160
188
 
161
- **optionName**: `string`
189
+ ##### optionName
190
+
191
+ `string`
162
192
 
163
193
  The name of the option.
164
194
 
165
- **optionValue**: `undefined` \| `string`
195
+ ##### optionValue
166
196
 
167
197
  The option value.
168
198
 
169
- • **allowEnvVar**: `boolean` = `true`
199
+ `undefined` | `string`
200
+
201
+ ##### allowEnvVar
202
+
203
+ `boolean` = `true`
170
204
 
171
205
  Allow the option to be read from an env var.
172
206
 
173
- **minValue**: `number` = `0`
207
+ ##### minValue
208
+
209
+ `number` = `0`
174
210
 
175
211
  The minimum value.
176
212
 
177
- **maxValue?**: `number`
213
+ ##### maxValue?
214
+
215
+ `number`
178
216
 
179
217
  The maximum value.
180
218
 
@@ -192,29 +230,39 @@ An error if the option is invalid.
192
230
 
193
231
  ### bigint()
194
232
 
195
- > `static` **bigint**(`optionName`, `optionValue`, `allowEnvVar`, `minValue`, `maxValue`?): `bigint`
233
+ > `static` **bigint**(`optionName`, `optionValue`, `allowEnvVar`, `minValue`, `maxValue?`): `bigint`
196
234
 
197
235
  Check the option to see if it exists and is a big number.
198
236
 
199
237
  #### Parameters
200
238
 
201
- **optionName**: `string`
239
+ ##### optionName
240
+
241
+ `string`
202
242
 
203
243
  The name of the option.
204
244
 
205
- **optionValue**: `undefined` \| `string`
245
+ ##### optionValue
206
246
 
207
247
  The option value.
208
248
 
209
- • **allowEnvVar**: `boolean` = `true`
249
+ `undefined` | `string`
250
+
251
+ ##### allowEnvVar
252
+
253
+ `boolean` = `true`
210
254
 
211
255
  Allow the option to be read from an env var.
212
256
 
213
- **minValue**: `bigint` = `...`
257
+ ##### minValue
258
+
259
+ `bigint` = `0n`
214
260
 
215
261
  The minimum value.
216
262
 
217
- **maxValue?**: `bigint`
263
+ ##### maxValue?
264
+
265
+ `bigint`
218
266
 
219
267
  The maximum value.
220
268
 
@@ -238,15 +286,21 @@ Check the option to see if it exists and is a boolean.
238
286
 
239
287
  #### Parameters
240
288
 
241
- **optionName**: `string`
289
+ ##### optionName
290
+
291
+ `string`
242
292
 
243
293
  The name of the option.
244
294
 
245
- **optionValue**: `undefined` \| `string`
295
+ ##### optionValue
246
296
 
247
297
  The option value.
248
298
 
249
- • **allowEnvVar**: `boolean` = `true`
299
+ `undefined` | `string`
300
+
301
+ ##### allowEnvVar
302
+
303
+ `boolean` = `true`
250
304
 
251
305
  Allow the option to be read from an env var.
252
306
 
@@ -270,15 +324,21 @@ Check the option to see if it exists and is hex.
270
324
 
271
325
  #### Parameters
272
326
 
273
- **optionName**: `string`
327
+ ##### optionName
328
+
329
+ `string`
274
330
 
275
331
  The name of the option.
276
332
 
277
- **optionValue**: `undefined` \| `string`
333
+ ##### optionValue
278
334
 
279
335
  The option value.
280
336
 
281
- • **allowEnvVar**: `boolean` = `true`
337
+ `undefined` | `string`
338
+
339
+ ##### allowEnvVar
340
+
341
+ `boolean` = `true`
282
342
 
283
343
  Allow the option to be read from an env var.
284
344
 
@@ -302,15 +362,21 @@ Check the option to see if it exists and is base64.
302
362
 
303
363
  #### Parameters
304
364
 
305
- **optionName**: `string`
365
+ ##### optionName
366
+
367
+ `string`
306
368
 
307
369
  The name of the option.
308
370
 
309
- **optionValue**: `undefined` \| `string`
371
+ ##### optionValue
310
372
 
311
373
  The option value.
312
374
 
313
- • **allowEnvVar**: `boolean` = `true`
375
+ `undefined` | `string`
376
+
377
+ ##### allowEnvVar
378
+
379
+ `boolean` = `true`
314
380
 
315
381
  Allow the option to be read from an env var.
316
382
 
@@ -334,15 +400,21 @@ Check the option to see if it exists and is hex or base64.
334
400
 
335
401
  #### Parameters
336
402
 
337
- **optionName**: `string`
403
+ ##### optionName
404
+
405
+ `string`
338
406
 
339
407
  The name of the option.
340
408
 
341
- **optionValue**: `undefined` \| `string`
409
+ ##### optionValue
342
410
 
343
411
  The option value.
344
412
 
345
- • **allowEnvVar**: `boolean` = `true`
413
+ `undefined` | `string`
414
+
415
+ ##### allowEnvVar
416
+
417
+ `boolean` = `true`
346
418
 
347
419
  Allow the option to be read from an env var.
348
420
 
@@ -366,15 +438,21 @@ Check the option to see if it exists and is bech32.
366
438
 
367
439
  #### Parameters
368
440
 
369
- **optionName**: `string`
441
+ ##### optionName
442
+
443
+ `string`
370
444
 
371
445
  The name of the option.
372
446
 
373
- **optionValue**: `undefined` \| `string`
447
+ ##### optionValue
374
448
 
375
449
  The option value.
376
450
 
377
- • **allowEnvVar**: `boolean` = `true`
451
+ `undefined` | `string`
452
+
453
+ ##### allowEnvVar
454
+
455
+ `boolean` = `true`
378
456
 
379
457
  Allow the option to be read from an env var.
380
458