@laioutr/cli 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/README.md +380 -0
- package/bin/dev.cmd +3 -0
- package/bin/dev.js +5 -0
- package/bin/run.cmd +3 -0
- package/bin/run.js +5 -0
- package/dist/commands/project/fetch-rc.d.ts +17 -0
- package/dist/commands/project/fetch-rc.js +52 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/laioutr-base-command.d.ts +8 -0
- package/dist/laioutr-base-command.js +18 -0
- package/oclif.manifest.json +87 -0
- package/package.json +64 -0
package/README.md
ADDED
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
# @laioutr/cli
|
|
2
|
+
|
|
3
|
+
Laioutr CLI
|
|
4
|
+
|
|
5
|
+
[](https://oclif.io)
|
|
6
|
+
[](https://npmjs.org/package/@laioutr/cli)
|
|
7
|
+
[](https://npmjs.org/package/@laioutr/cli)
|
|
8
|
+
|
|
9
|
+
<!-- toc -->
|
|
10
|
+
* [@laioutr/cli](#laioutrcli)
|
|
11
|
+
* [Usage](#usage)
|
|
12
|
+
* [Commands](#commands)
|
|
13
|
+
<!-- tocstop -->
|
|
14
|
+
|
|
15
|
+
# Usage
|
|
16
|
+
|
|
17
|
+
<!-- usage -->
|
|
18
|
+
```sh-session
|
|
19
|
+
$ npm install -g @laioutr/cli
|
|
20
|
+
$ laioutr COMMAND
|
|
21
|
+
running command...
|
|
22
|
+
$ laioutr (--version)
|
|
23
|
+
@laioutr/cli/0.2.0 darwin-arm64 node-v22.12.0
|
|
24
|
+
$ laioutr --help [COMMAND]
|
|
25
|
+
USAGE
|
|
26
|
+
$ laioutr COMMAND
|
|
27
|
+
...
|
|
28
|
+
```
|
|
29
|
+
<!-- usagestop -->
|
|
30
|
+
|
|
31
|
+
# Commands
|
|
32
|
+
|
|
33
|
+
<!-- commands -->
|
|
34
|
+
* [`laioutr help [COMMAND]`](#laioutr-help-command)
|
|
35
|
+
* [`laioutr plugins`](#laioutr-plugins)
|
|
36
|
+
* [`laioutr plugins add PLUGIN`](#laioutr-plugins-add-plugin)
|
|
37
|
+
* [`laioutr plugins:inspect PLUGIN...`](#laioutr-pluginsinspect-plugin)
|
|
38
|
+
* [`laioutr plugins install PLUGIN`](#laioutr-plugins-install-plugin)
|
|
39
|
+
* [`laioutr plugins link PATH`](#laioutr-plugins-link-path)
|
|
40
|
+
* [`laioutr plugins remove [PLUGIN]`](#laioutr-plugins-remove-plugin)
|
|
41
|
+
* [`laioutr plugins reset`](#laioutr-plugins-reset)
|
|
42
|
+
* [`laioutr plugins uninstall [PLUGIN]`](#laioutr-plugins-uninstall-plugin)
|
|
43
|
+
* [`laioutr plugins unlink [PLUGIN]`](#laioutr-plugins-unlink-plugin)
|
|
44
|
+
* [`laioutr plugins update`](#laioutr-plugins-update)
|
|
45
|
+
* [`laioutr project fetch-rc [FILENAME]`](#laioutr-project-fetch-rc-filename)
|
|
46
|
+
|
|
47
|
+
## `laioutr help [COMMAND]`
|
|
48
|
+
|
|
49
|
+
Display help for laioutr.
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
USAGE
|
|
53
|
+
$ laioutr help [COMMAND...] [-n]
|
|
54
|
+
|
|
55
|
+
ARGUMENTS
|
|
56
|
+
COMMAND... Command to show help for.
|
|
57
|
+
|
|
58
|
+
FLAGS
|
|
59
|
+
-n, --nested-commands Include all nested commands in the output.
|
|
60
|
+
|
|
61
|
+
DESCRIPTION
|
|
62
|
+
Display help for laioutr.
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.29/src/commands/help.ts)_
|
|
66
|
+
|
|
67
|
+
## `laioutr plugins`
|
|
68
|
+
|
|
69
|
+
List installed plugins.
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
USAGE
|
|
73
|
+
$ laioutr plugins [--json] [--core]
|
|
74
|
+
|
|
75
|
+
FLAGS
|
|
76
|
+
--core Show core plugins.
|
|
77
|
+
|
|
78
|
+
GLOBAL FLAGS
|
|
79
|
+
--json Format output as json.
|
|
80
|
+
|
|
81
|
+
DESCRIPTION
|
|
82
|
+
List installed plugins.
|
|
83
|
+
|
|
84
|
+
EXAMPLES
|
|
85
|
+
$ laioutr plugins
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.41/src/commands/plugins/index.ts)_
|
|
89
|
+
|
|
90
|
+
## `laioutr plugins add PLUGIN`
|
|
91
|
+
|
|
92
|
+
Installs a plugin into laioutr.
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
USAGE
|
|
96
|
+
$ laioutr plugins add PLUGIN... [--json] [-f] [-h] [-s | -v]
|
|
97
|
+
|
|
98
|
+
ARGUMENTS
|
|
99
|
+
PLUGIN... Plugin to install.
|
|
100
|
+
|
|
101
|
+
FLAGS
|
|
102
|
+
-f, --force Force npm to fetch remote resources even if a local copy exists on disk.
|
|
103
|
+
-h, --help Show CLI help.
|
|
104
|
+
-s, --silent Silences npm output.
|
|
105
|
+
-v, --verbose Show verbose npm output.
|
|
106
|
+
|
|
107
|
+
GLOBAL FLAGS
|
|
108
|
+
--json Format output as json.
|
|
109
|
+
|
|
110
|
+
DESCRIPTION
|
|
111
|
+
Installs a plugin into laioutr.
|
|
112
|
+
|
|
113
|
+
Uses npm to install plugins.
|
|
114
|
+
|
|
115
|
+
Installation of a user-installed plugin will override a core plugin.
|
|
116
|
+
|
|
117
|
+
Use the LAIOUTR_NPM_LOG_LEVEL environment variable to set the npm loglevel.
|
|
118
|
+
Use the LAIOUTR_NPM_REGISTRY environment variable to set the npm registry.
|
|
119
|
+
|
|
120
|
+
ALIASES
|
|
121
|
+
$ laioutr plugins add
|
|
122
|
+
|
|
123
|
+
EXAMPLES
|
|
124
|
+
Install a plugin from npm registry.
|
|
125
|
+
|
|
126
|
+
$ laioutr plugins add myplugin
|
|
127
|
+
|
|
128
|
+
Install a plugin from a github url.
|
|
129
|
+
|
|
130
|
+
$ laioutr plugins add https://github.com/someuser/someplugin
|
|
131
|
+
|
|
132
|
+
Install a plugin from a github slug.
|
|
133
|
+
|
|
134
|
+
$ laioutr plugins add someuser/someplugin
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## `laioutr plugins:inspect PLUGIN...`
|
|
138
|
+
|
|
139
|
+
Displays installation properties of a plugin.
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
USAGE
|
|
143
|
+
$ laioutr plugins inspect PLUGIN...
|
|
144
|
+
|
|
145
|
+
ARGUMENTS
|
|
146
|
+
PLUGIN... [default: .] Plugin to inspect.
|
|
147
|
+
|
|
148
|
+
FLAGS
|
|
149
|
+
-h, --help Show CLI help.
|
|
150
|
+
-v, --verbose
|
|
151
|
+
|
|
152
|
+
GLOBAL FLAGS
|
|
153
|
+
--json Format output as json.
|
|
154
|
+
|
|
155
|
+
DESCRIPTION
|
|
156
|
+
Displays installation properties of a plugin.
|
|
157
|
+
|
|
158
|
+
EXAMPLES
|
|
159
|
+
$ laioutr plugins inspect myplugin
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.41/src/commands/plugins/inspect.ts)_
|
|
163
|
+
|
|
164
|
+
## `laioutr plugins install PLUGIN`
|
|
165
|
+
|
|
166
|
+
Installs a plugin into laioutr.
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
USAGE
|
|
170
|
+
$ laioutr plugins install PLUGIN... [--json] [-f] [-h] [-s | -v]
|
|
171
|
+
|
|
172
|
+
ARGUMENTS
|
|
173
|
+
PLUGIN... Plugin to install.
|
|
174
|
+
|
|
175
|
+
FLAGS
|
|
176
|
+
-f, --force Force npm to fetch remote resources even if a local copy exists on disk.
|
|
177
|
+
-h, --help Show CLI help.
|
|
178
|
+
-s, --silent Silences npm output.
|
|
179
|
+
-v, --verbose Show verbose npm output.
|
|
180
|
+
|
|
181
|
+
GLOBAL FLAGS
|
|
182
|
+
--json Format output as json.
|
|
183
|
+
|
|
184
|
+
DESCRIPTION
|
|
185
|
+
Installs a plugin into laioutr.
|
|
186
|
+
|
|
187
|
+
Uses npm to install plugins.
|
|
188
|
+
|
|
189
|
+
Installation of a user-installed plugin will override a core plugin.
|
|
190
|
+
|
|
191
|
+
Use the LAIOUTR_NPM_LOG_LEVEL environment variable to set the npm loglevel.
|
|
192
|
+
Use the LAIOUTR_NPM_REGISTRY environment variable to set the npm registry.
|
|
193
|
+
|
|
194
|
+
ALIASES
|
|
195
|
+
$ laioutr plugins add
|
|
196
|
+
|
|
197
|
+
EXAMPLES
|
|
198
|
+
Install a plugin from npm registry.
|
|
199
|
+
|
|
200
|
+
$ laioutr plugins install myplugin
|
|
201
|
+
|
|
202
|
+
Install a plugin from a github url.
|
|
203
|
+
|
|
204
|
+
$ laioutr plugins install https://github.com/someuser/someplugin
|
|
205
|
+
|
|
206
|
+
Install a plugin from a github slug.
|
|
207
|
+
|
|
208
|
+
$ laioutr plugins install someuser/someplugin
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.41/src/commands/plugins/install.ts)_
|
|
212
|
+
|
|
213
|
+
## `laioutr plugins link PATH`
|
|
214
|
+
|
|
215
|
+
Links a plugin into the CLI for development.
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
USAGE
|
|
219
|
+
$ laioutr plugins link PATH [-h] [--install] [-v]
|
|
220
|
+
|
|
221
|
+
ARGUMENTS
|
|
222
|
+
PATH [default: .] path to plugin
|
|
223
|
+
|
|
224
|
+
FLAGS
|
|
225
|
+
-h, --help Show CLI help.
|
|
226
|
+
-v, --verbose
|
|
227
|
+
--[no-]install Install dependencies after linking the plugin.
|
|
228
|
+
|
|
229
|
+
DESCRIPTION
|
|
230
|
+
Links a plugin into the CLI for development.
|
|
231
|
+
|
|
232
|
+
Installation of a linked plugin will override a user-installed or core plugin.
|
|
233
|
+
|
|
234
|
+
e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
|
|
235
|
+
command will override the user-installed or core plugin implementation. This is useful for development work.
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
EXAMPLES
|
|
239
|
+
$ laioutr plugins link myplugin
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.41/src/commands/plugins/link.ts)_
|
|
243
|
+
|
|
244
|
+
## `laioutr plugins remove [PLUGIN]`
|
|
245
|
+
|
|
246
|
+
Removes a plugin from the CLI.
|
|
247
|
+
|
|
248
|
+
```
|
|
249
|
+
USAGE
|
|
250
|
+
$ laioutr plugins remove [PLUGIN...] [-h] [-v]
|
|
251
|
+
|
|
252
|
+
ARGUMENTS
|
|
253
|
+
PLUGIN... plugin to uninstall
|
|
254
|
+
|
|
255
|
+
FLAGS
|
|
256
|
+
-h, --help Show CLI help.
|
|
257
|
+
-v, --verbose
|
|
258
|
+
|
|
259
|
+
DESCRIPTION
|
|
260
|
+
Removes a plugin from the CLI.
|
|
261
|
+
|
|
262
|
+
ALIASES
|
|
263
|
+
$ laioutr plugins unlink
|
|
264
|
+
$ laioutr plugins remove
|
|
265
|
+
|
|
266
|
+
EXAMPLES
|
|
267
|
+
$ laioutr plugins remove myplugin
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## `laioutr plugins reset`
|
|
271
|
+
|
|
272
|
+
Remove all user-installed and linked plugins.
|
|
273
|
+
|
|
274
|
+
```
|
|
275
|
+
USAGE
|
|
276
|
+
$ laioutr plugins reset [--hard] [--reinstall]
|
|
277
|
+
|
|
278
|
+
FLAGS
|
|
279
|
+
--hard Delete node_modules and package manager related files in addition to uninstalling plugins.
|
|
280
|
+
--reinstall Reinstall all plugins after uninstalling.
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.41/src/commands/plugins/reset.ts)_
|
|
284
|
+
|
|
285
|
+
## `laioutr plugins uninstall [PLUGIN]`
|
|
286
|
+
|
|
287
|
+
Removes a plugin from the CLI.
|
|
288
|
+
|
|
289
|
+
```
|
|
290
|
+
USAGE
|
|
291
|
+
$ laioutr plugins uninstall [PLUGIN...] [-h] [-v]
|
|
292
|
+
|
|
293
|
+
ARGUMENTS
|
|
294
|
+
PLUGIN... plugin to uninstall
|
|
295
|
+
|
|
296
|
+
FLAGS
|
|
297
|
+
-h, --help Show CLI help.
|
|
298
|
+
-v, --verbose
|
|
299
|
+
|
|
300
|
+
DESCRIPTION
|
|
301
|
+
Removes a plugin from the CLI.
|
|
302
|
+
|
|
303
|
+
ALIASES
|
|
304
|
+
$ laioutr plugins unlink
|
|
305
|
+
$ laioutr plugins remove
|
|
306
|
+
|
|
307
|
+
EXAMPLES
|
|
308
|
+
$ laioutr plugins uninstall myplugin
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.41/src/commands/plugins/uninstall.ts)_
|
|
312
|
+
|
|
313
|
+
## `laioutr plugins unlink [PLUGIN]`
|
|
314
|
+
|
|
315
|
+
Removes a plugin from the CLI.
|
|
316
|
+
|
|
317
|
+
```
|
|
318
|
+
USAGE
|
|
319
|
+
$ laioutr plugins unlink [PLUGIN...] [-h] [-v]
|
|
320
|
+
|
|
321
|
+
ARGUMENTS
|
|
322
|
+
PLUGIN... plugin to uninstall
|
|
323
|
+
|
|
324
|
+
FLAGS
|
|
325
|
+
-h, --help Show CLI help.
|
|
326
|
+
-v, --verbose
|
|
327
|
+
|
|
328
|
+
DESCRIPTION
|
|
329
|
+
Removes a plugin from the CLI.
|
|
330
|
+
|
|
331
|
+
ALIASES
|
|
332
|
+
$ laioutr plugins unlink
|
|
333
|
+
$ laioutr plugins remove
|
|
334
|
+
|
|
335
|
+
EXAMPLES
|
|
336
|
+
$ laioutr plugins unlink myplugin
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
## `laioutr plugins update`
|
|
340
|
+
|
|
341
|
+
Update installed plugins.
|
|
342
|
+
|
|
343
|
+
```
|
|
344
|
+
USAGE
|
|
345
|
+
$ laioutr plugins update [-h] [-v]
|
|
346
|
+
|
|
347
|
+
FLAGS
|
|
348
|
+
-h, --help Show CLI help.
|
|
349
|
+
-v, --verbose
|
|
350
|
+
|
|
351
|
+
DESCRIPTION
|
|
352
|
+
Update installed plugins.
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.41/src/commands/plugins/update.ts)_
|
|
356
|
+
|
|
357
|
+
## `laioutr project fetch-rc [FILENAME]`
|
|
358
|
+
|
|
359
|
+
Fetches the laioutrrc.json of a project from the cockpit api.
|
|
360
|
+
|
|
361
|
+
```
|
|
362
|
+
USAGE
|
|
363
|
+
$ laioutr project fetch-rc [FILENAME] --cockpitApiHost <value> --cwd <value> -e <value> -s <value> -p <value>
|
|
364
|
+
|
|
365
|
+
FLAGS
|
|
366
|
+
-e, --environmentName=<value> (required) [default: main] environment name
|
|
367
|
+
-p, --project=<value> (required) <organization slug>/<project slug>
|
|
368
|
+
-s, --projectSecret=<value> (required) project secret
|
|
369
|
+
--cockpitApiHost=<value> (required) [default: https://cockpit.laioutr.cloud] cockpit api host
|
|
370
|
+
--cwd=<value> (required) [default: /Users/sl/src/laioutr/apps/cli] current working directory
|
|
371
|
+
|
|
372
|
+
DESCRIPTION
|
|
373
|
+
Fetches the laioutrrc.json of a project from the cockpit api.
|
|
374
|
+
|
|
375
|
+
EXAMPLES
|
|
376
|
+
$ laioutr project fetch-rc
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
_See code: [src/commands/project/fetch-rc.ts](https://github.com/packages/cli/blob/v0.2.0/src/commands/project/fetch-rc.ts)_
|
|
380
|
+
<!-- commandsstop -->
|
package/bin/dev.cmd
ADDED
package/bin/dev.js
ADDED
package/bin/run.cmd
ADDED
package/bin/run.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import LaioutrBaseCommand from '../../laioutr-base-command.js';
|
|
2
|
+
export default class ProjectFetchRc extends LaioutrBaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
fileName: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
environmentName: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
projectSecret: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
cockpitApiHost: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
cwd: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<void>;
|
|
16
|
+
private fetchRc;
|
|
17
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { writeFile } from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { Args, Flags } from '@oclif/core';
|
|
4
|
+
import { z } from 'zod/v4';
|
|
5
|
+
import LaioutrBaseCommand from '../../laioutr-base-command.js';
|
|
6
|
+
const apiResponseSchema = z.object({
|
|
7
|
+
content: z.string(),
|
|
8
|
+
});
|
|
9
|
+
export default class ProjectFetchRc extends LaioutrBaseCommand {
|
|
10
|
+
static args = {
|
|
11
|
+
...LaioutrBaseCommand.args,
|
|
12
|
+
fileName: Args.string({ default: 'laioutrrc.json', name: 'fileName', required: false }),
|
|
13
|
+
};
|
|
14
|
+
static description = 'Fetches the laioutrrc.json of a project from the cockpit api.';
|
|
15
|
+
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
16
|
+
static flags = {
|
|
17
|
+
...LaioutrBaseCommand.flags,
|
|
18
|
+
environmentName: Flags.string({ char: 'e', default: 'main', description: 'environment name', env: 'ENVIRONMENT_NAME', required: true }),
|
|
19
|
+
projectSecret: Flags.string({ char: 's', description: 'project secret', env: 'PROJECT_SECRET', required: true }),
|
|
20
|
+
project: Flags.string({ char: 'p', description: '<organization slug>/<project slug>', env: 'PROJECT', required: true }),
|
|
21
|
+
};
|
|
22
|
+
async run() {
|
|
23
|
+
const { args, flags } = await this.parse(ProjectFetchRc);
|
|
24
|
+
const rc = await this.fetchRc(flags);
|
|
25
|
+
const filePath = path.join(flags.cwd, args.fileName);
|
|
26
|
+
this.log('Writing RC file', filePath);
|
|
27
|
+
return writeFile(filePath, rc);
|
|
28
|
+
}
|
|
29
|
+
async fetchRc(flags) {
|
|
30
|
+
const url = `${flags.cockpitApiHost}/api/v1/project/fetch-rc`;
|
|
31
|
+
const [organizationSlug, projectSlug] = flags.project.split('/');
|
|
32
|
+
const response = await fetch(url, {
|
|
33
|
+
body: JSON.stringify({
|
|
34
|
+
environmentName: flags.environmentName,
|
|
35
|
+
organizationSlug,
|
|
36
|
+
projectSecret: flags.projectSecret,
|
|
37
|
+
projectSlug,
|
|
38
|
+
}),
|
|
39
|
+
headers: {
|
|
40
|
+
'Content-Type': 'application/json',
|
|
41
|
+
},
|
|
42
|
+
method: 'POST',
|
|
43
|
+
});
|
|
44
|
+
const data = await response.json();
|
|
45
|
+
if (response.status !== 200) {
|
|
46
|
+
this.log(data);
|
|
47
|
+
this.error('Failed to fetch RC file. See error message above.', { exit: 1 });
|
|
48
|
+
}
|
|
49
|
+
const parsed = apiResponseSchema.parse(data);
|
|
50
|
+
return parsed.content;
|
|
51
|
+
}
|
|
52
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { run } from '@oclif/core';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { run } from '@oclif/core';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default abstract class LaioutrBaseCommand extends Command {
|
|
3
|
+
static args: {};
|
|
4
|
+
static flags: {
|
|
5
|
+
cockpitApiHost: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
cwd: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
export default class LaioutrBaseCommand extends Command {
|
|
3
|
+
static args = {};
|
|
4
|
+
static flags = {
|
|
5
|
+
cockpitApiHost: Flags.string({
|
|
6
|
+
default: 'https://cockpit.laioutr.cloud',
|
|
7
|
+
description: 'cockpit api host',
|
|
8
|
+
env: 'COCKPIT_API_HOST',
|
|
9
|
+
required: true,
|
|
10
|
+
}),
|
|
11
|
+
cwd: Flags.string({
|
|
12
|
+
default: process.cwd(),
|
|
13
|
+
description: 'current working directory',
|
|
14
|
+
env: 'CWD',
|
|
15
|
+
required: true,
|
|
16
|
+
}),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"commands": {
|
|
3
|
+
"project:fetch-rc": {
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"args": {
|
|
6
|
+
"fileName": {
|
|
7
|
+
"default": "laioutrrc.json",
|
|
8
|
+
"name": "fileName",
|
|
9
|
+
"required": false
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"description": "Fetches the laioutrrc.json of a project from the cockpit api.",
|
|
13
|
+
"examples": [
|
|
14
|
+
"<%= config.bin %> <%= command.id %>"
|
|
15
|
+
],
|
|
16
|
+
"flags": {
|
|
17
|
+
"cockpitApiHost": {
|
|
18
|
+
"description": "cockpit api host",
|
|
19
|
+
"env": "COCKPIT_API_HOST",
|
|
20
|
+
"name": "cockpitApiHost",
|
|
21
|
+
"required": true,
|
|
22
|
+
"default": "https://cockpit.laioutr.cloud",
|
|
23
|
+
"hasDynamicHelp": false,
|
|
24
|
+
"multiple": false,
|
|
25
|
+
"type": "option"
|
|
26
|
+
},
|
|
27
|
+
"cwd": {
|
|
28
|
+
"description": "current working directory",
|
|
29
|
+
"env": "CWD",
|
|
30
|
+
"name": "cwd",
|
|
31
|
+
"required": true,
|
|
32
|
+
"default": "/Users/sl/src/laioutr/apps/cli",
|
|
33
|
+
"hasDynamicHelp": false,
|
|
34
|
+
"multiple": false,
|
|
35
|
+
"type": "option"
|
|
36
|
+
},
|
|
37
|
+
"environmentName": {
|
|
38
|
+
"char": "e",
|
|
39
|
+
"description": "environment name",
|
|
40
|
+
"env": "ENVIRONMENT_NAME",
|
|
41
|
+
"name": "environmentName",
|
|
42
|
+
"required": true,
|
|
43
|
+
"default": "main",
|
|
44
|
+
"hasDynamicHelp": false,
|
|
45
|
+
"multiple": false,
|
|
46
|
+
"type": "option"
|
|
47
|
+
},
|
|
48
|
+
"projectSecret": {
|
|
49
|
+
"char": "s",
|
|
50
|
+
"description": "project secret",
|
|
51
|
+
"env": "PROJECT_SECRET",
|
|
52
|
+
"name": "projectSecret",
|
|
53
|
+
"required": true,
|
|
54
|
+
"hasDynamicHelp": false,
|
|
55
|
+
"multiple": false,
|
|
56
|
+
"type": "option"
|
|
57
|
+
},
|
|
58
|
+
"project": {
|
|
59
|
+
"char": "p",
|
|
60
|
+
"description": "<organization slug>/<project slug>",
|
|
61
|
+
"env": "PROJECT",
|
|
62
|
+
"name": "project",
|
|
63
|
+
"required": true,
|
|
64
|
+
"hasDynamicHelp": false,
|
|
65
|
+
"multiple": false,
|
|
66
|
+
"type": "option"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"hasDynamicHelp": false,
|
|
70
|
+
"hiddenAliases": [],
|
|
71
|
+
"id": "project:fetch-rc",
|
|
72
|
+
"pluginAlias": "@laioutr/cli",
|
|
73
|
+
"pluginName": "@laioutr/cli",
|
|
74
|
+
"pluginType": "core",
|
|
75
|
+
"strict": true,
|
|
76
|
+
"enableJsonFlag": false,
|
|
77
|
+
"isESM": true,
|
|
78
|
+
"relativePath": [
|
|
79
|
+
"dist",
|
|
80
|
+
"commands",
|
|
81
|
+
"project",
|
|
82
|
+
"fetch-rc.js"
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"version": "0.2.0"
|
|
87
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@laioutr/cli",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Laioutr CLI",
|
|
5
|
+
"repository": "packages/cli",
|
|
6
|
+
"author": "Laioutr GmbH",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"bin": {
|
|
11
|
+
"laioutr": "./bin/run.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"/bin",
|
|
15
|
+
"/dist",
|
|
16
|
+
"/oclif.manifest.json"
|
|
17
|
+
],
|
|
18
|
+
"lint-staged": {
|
|
19
|
+
"*.{js,mjs,jsx,ts,tsx,vue}": [
|
|
20
|
+
"pnpm lint --fix",
|
|
21
|
+
"prettier --cache --write"
|
|
22
|
+
],
|
|
23
|
+
"*.{css,scss,md,html,json}": "prettier --cache --write"
|
|
24
|
+
},
|
|
25
|
+
"oclif": {
|
|
26
|
+
"bin": "laioutr",
|
|
27
|
+
"commands": "./dist/commands",
|
|
28
|
+
"dirname": "laioutr",
|
|
29
|
+
"plugins": [
|
|
30
|
+
"@oclif/plugin-help",
|
|
31
|
+
"@oclif/plugin-plugins"
|
|
32
|
+
],
|
|
33
|
+
"topicSeparator": " "
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@oclif/core": "^4",
|
|
37
|
+
"@oclif/plugin-help": "^6",
|
|
38
|
+
"@oclif/plugin-plugins": "^5",
|
|
39
|
+
"zod": "3.25.61"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@oclif/test": "^4",
|
|
43
|
+
"@types/chai": "^4",
|
|
44
|
+
"@types/mocha": "^10",
|
|
45
|
+
"@types/node": "latest",
|
|
46
|
+
"chai": "^4",
|
|
47
|
+
"mocha": "^10",
|
|
48
|
+
"oclif": "^4",
|
|
49
|
+
"shx": "^0.3.3",
|
|
50
|
+
"ts-node": "^10",
|
|
51
|
+
"typescript": "^5.7.2"
|
|
52
|
+
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=18.0.0"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "shx rm -rf dist && tsc -b",
|
|
58
|
+
"dev": "./bin/dev.js",
|
|
59
|
+
"lint": "eslint --cache --cache-location ../../.eslintcache",
|
|
60
|
+
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
|
|
61
|
+
"posttest": "pnpm run lint",
|
|
62
|
+
"version": "oclif readme && git add README.md"
|
|
63
|
+
}
|
|
64
|
+
}
|