hereya-cli 0.6.3 → 0.6.4
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 +28 -20
- package/dist/commands/env/index.d.ts +4 -0
- package/dist/commands/env/index.js +24 -3
- package/oclif.manifest.json +19 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ $ npm install -g hereya-cli
|
|
|
20
20
|
$ hereya COMMAND
|
|
21
21
|
running command...
|
|
22
22
|
$ hereya (--version)
|
|
23
|
-
hereya-cli/0.6.
|
|
23
|
+
hereya-cli/0.6.4 linux-x64 node-v20.14.0
|
|
24
24
|
$ hereya --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ hereya COMMAND
|
|
@@ -33,7 +33,7 @@ USAGE
|
|
|
33
33
|
* [`hereya bootstrap INFRASTRUCTURETYPE`](#hereya-bootstrap-infrastructuretype)
|
|
34
34
|
* [`hereya deploy`](#hereya-deploy)
|
|
35
35
|
* [`hereya down`](#hereya-down)
|
|
36
|
-
* [`hereya env`](#hereya-env)
|
|
36
|
+
* [`hereya env [NAME]`](#hereya-env-name)
|
|
37
37
|
* [`hereya help [COMMAND]`](#hereya-help-command)
|
|
38
38
|
* [`hereya init PROJECT`](#hereya-init-project)
|
|
39
39
|
* [`hereya remote exec [PKGPATH]`](#hereya-remote-exec-pkgpath)
|
|
@@ -70,7 +70,7 @@ EXAMPLES
|
|
|
70
70
|
$ hereya add cloudy/docker_postgres
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.
|
|
73
|
+
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.4/src/commands/add/index.ts)_
|
|
74
74
|
|
|
75
75
|
## `hereya bootstrap INFRASTRUCTURETYPE`
|
|
76
76
|
|
|
@@ -95,7 +95,7 @@ EXAMPLES
|
|
|
95
95
|
$ hereya bootstrap local
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.
|
|
98
|
+
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.4/src/commands/bootstrap/index.ts)_
|
|
99
99
|
|
|
100
100
|
## `hereya deploy`
|
|
101
101
|
|
|
@@ -116,7 +116,7 @@ EXAMPLES
|
|
|
116
116
|
$ hereya deploy
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.
|
|
119
|
+
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.4/src/commands/deploy/index.ts)_
|
|
120
120
|
|
|
121
121
|
## `hereya down`
|
|
122
122
|
|
|
@@ -138,17 +138,21 @@ EXAMPLES
|
|
|
138
138
|
$ hereya down
|
|
139
139
|
```
|
|
140
140
|
|
|
141
|
-
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.
|
|
141
|
+
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.4/src/commands/down/index.ts)_
|
|
142
142
|
|
|
143
|
-
## `hereya env`
|
|
143
|
+
## `hereya env [NAME]`
|
|
144
144
|
|
|
145
145
|
Print project environment variables.
|
|
146
146
|
|
|
147
147
|
```
|
|
148
148
|
USAGE
|
|
149
|
-
$ hereya env [--chdir <value>] [-w <value>]
|
|
149
|
+
$ hereya env [NAME] [--chdir <value>] [-l] [-w <value>]
|
|
150
|
+
|
|
151
|
+
ARGUMENTS
|
|
152
|
+
NAME name of the env to display
|
|
150
153
|
|
|
151
154
|
FLAGS
|
|
155
|
+
-l, --list list only the env vars without values
|
|
152
156
|
-w, --workspace=<value> name of the workspace to print the env vars for
|
|
153
157
|
--chdir=<value> project root directory
|
|
154
158
|
|
|
@@ -158,10 +162,14 @@ DESCRIPTION
|
|
|
158
162
|
EXAMPLES
|
|
159
163
|
$ hereya env
|
|
160
164
|
|
|
165
|
+
$ hereya env myEnv
|
|
166
|
+
|
|
161
167
|
$ hereya env -w dev
|
|
168
|
+
|
|
169
|
+
$ hereya env -w dev -l
|
|
162
170
|
```
|
|
163
171
|
|
|
164
|
-
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.
|
|
172
|
+
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.4/src/commands/env/index.ts)_
|
|
165
173
|
|
|
166
174
|
## `hereya help [COMMAND]`
|
|
167
175
|
|
|
@@ -207,7 +215,7 @@ EXAMPLES
|
|
|
207
215
|
$ hereya init myProject -w=defaultWorkspace --chdir=./myProject
|
|
208
216
|
```
|
|
209
217
|
|
|
210
|
-
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.
|
|
218
|
+
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.4/src/commands/init/index.ts)_
|
|
211
219
|
|
|
212
220
|
## `hereya remote exec [PKGPATH]`
|
|
213
221
|
|
|
@@ -231,7 +239,7 @@ EXAMPLES
|
|
|
231
239
|
$ hereya remote exec
|
|
232
240
|
```
|
|
233
241
|
|
|
234
|
-
_See code: [src/commands/remote/exec/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.
|
|
242
|
+
_See code: [src/commands/remote/exec/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.4/src/commands/remote/exec/index.ts)_
|
|
235
243
|
|
|
236
244
|
## `hereya remove PACKAGE`
|
|
237
245
|
|
|
@@ -254,7 +262,7 @@ EXAMPLES
|
|
|
254
262
|
$ hereya remove cloudy/docker_postgres
|
|
255
263
|
```
|
|
256
264
|
|
|
257
|
-
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.
|
|
265
|
+
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.4/src/commands/remove/index.ts)_
|
|
258
266
|
|
|
259
267
|
## `hereya run CMD`
|
|
260
268
|
|
|
@@ -280,7 +288,7 @@ EXAMPLES
|
|
|
280
288
|
$ hereya run -w uat -- node index.js
|
|
281
289
|
```
|
|
282
290
|
|
|
283
|
-
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.
|
|
291
|
+
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.4/src/commands/run/index.ts)_
|
|
284
292
|
|
|
285
293
|
## `hereya undeploy`
|
|
286
294
|
|
|
@@ -301,7 +309,7 @@ EXAMPLES
|
|
|
301
309
|
$ hereya undeploy
|
|
302
310
|
```
|
|
303
311
|
|
|
304
|
-
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.
|
|
312
|
+
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.4/src/commands/undeploy/index.ts)_
|
|
305
313
|
|
|
306
314
|
## `hereya up`
|
|
307
315
|
|
|
@@ -323,7 +331,7 @@ EXAMPLES
|
|
|
323
331
|
$ hereya up
|
|
324
332
|
```
|
|
325
333
|
|
|
326
|
-
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.
|
|
334
|
+
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.4/src/commands/up/index.ts)_
|
|
327
335
|
|
|
328
336
|
## `hereya workspace create NAME`
|
|
329
337
|
|
|
@@ -343,7 +351,7 @@ EXAMPLES
|
|
|
343
351
|
$ hereya workspace create dev
|
|
344
352
|
```
|
|
345
353
|
|
|
346
|
-
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.
|
|
354
|
+
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.4/src/commands/workspace/create/index.ts)_
|
|
347
355
|
|
|
348
356
|
## `hereya workspace delete NAME`
|
|
349
357
|
|
|
@@ -363,7 +371,7 @@ EXAMPLES
|
|
|
363
371
|
$ hereya workspace delete dev
|
|
364
372
|
```
|
|
365
373
|
|
|
366
|
-
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.
|
|
374
|
+
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.4/src/commands/workspace/delete/index.ts)_
|
|
367
375
|
|
|
368
376
|
## `hereya workspace env [NAME]`
|
|
369
377
|
|
|
@@ -389,7 +397,7 @@ EXAMPLES
|
|
|
389
397
|
$ hereya workspace env myEnv -w dev
|
|
390
398
|
```
|
|
391
399
|
|
|
392
|
-
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.
|
|
400
|
+
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.4/src/commands/workspace/env/index.ts)_
|
|
393
401
|
|
|
394
402
|
## `hereya workspace install PACKAGE`
|
|
395
403
|
|
|
@@ -415,7 +423,7 @@ EXAMPLES
|
|
|
415
423
|
$ hereya workspace install hereya/aws-cognito
|
|
416
424
|
```
|
|
417
425
|
|
|
418
|
-
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.
|
|
426
|
+
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.4/src/commands/workspace/install/index.ts)_
|
|
419
427
|
|
|
420
428
|
## `hereya workspace uninstall PACKAGE`
|
|
421
429
|
|
|
@@ -441,5 +449,5 @@ EXAMPLES
|
|
|
441
449
|
$ hereya workspace uninstall hereya/aws-cognito
|
|
442
450
|
```
|
|
443
451
|
|
|
444
|
-
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.
|
|
452
|
+
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.4/src/commands/workspace/uninstall/index.ts)_
|
|
445
453
|
<!-- commandsstop -->
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default class Env extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
name: import("@oclif/core/lib/interfaces/parser.js").Arg<string | undefined, Record<string, unknown>>;
|
|
5
|
+
};
|
|
3
6
|
static description: string;
|
|
4
7
|
static examples: string[];
|
|
5
8
|
static flags: {
|
|
6
9
|
chdir: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
+
list: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
7
11
|
workspace: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
8
12
|
};
|
|
9
13
|
run(): Promise<void>;
|
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
import { Command, Flags } from '@oclif/core';
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
2
|
import { getConfigManager } from '../../lib/config/index.js';
|
|
3
3
|
import { getEnvManager } from '../../lib/env/index.js';
|
|
4
4
|
import { logEnv } from '../../lib/env-utils.js';
|
|
5
5
|
export default class Env extends Command {
|
|
6
|
+
static args = {
|
|
7
|
+
name: Args.string({ description: 'name of the env to display', required: false }),
|
|
8
|
+
};
|
|
6
9
|
static description = 'Print project environment variables.';
|
|
7
10
|
static examples = [
|
|
8
11
|
'<%= config.bin %> <%= command.id %>',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> myEnv',
|
|
9
13
|
'<%= config.bin %> <%= command.id %> -w dev',
|
|
14
|
+
'<%= config.bin %> <%= command.id %> -w dev -l',
|
|
10
15
|
];
|
|
11
16
|
static flags = {
|
|
12
17
|
chdir: Flags.string({
|
|
13
18
|
description: 'project root directory',
|
|
14
19
|
required: false,
|
|
15
20
|
}),
|
|
21
|
+
list: Flags.boolean({
|
|
22
|
+
char: 'l',
|
|
23
|
+
description: 'list only the env vars without values',
|
|
24
|
+
required: false,
|
|
25
|
+
}),
|
|
16
26
|
workspace: Flags.string({
|
|
17
27
|
char: 'w',
|
|
18
28
|
description: 'name of the workspace to print the env vars for',
|
|
@@ -20,7 +30,7 @@ export default class Env extends Command {
|
|
|
20
30
|
}),
|
|
21
31
|
};
|
|
22
32
|
async run() {
|
|
23
|
-
const { flags } = await this.parse(Env);
|
|
33
|
+
const { args, flags } = await this.parse(Env);
|
|
24
34
|
const projectRootDir = flags.chdir || process.env.HEREYA_PROJECT_ROOT_DIR;
|
|
25
35
|
const configManager = getConfigManager();
|
|
26
36
|
const loadConfigOutput = await configManager.loadConfig({ projectRootDir });
|
|
@@ -29,7 +39,7 @@ export default class Env extends Command {
|
|
|
29
39
|
return;
|
|
30
40
|
}
|
|
31
41
|
const { config } = loadConfigOutput;
|
|
32
|
-
let { workspace } = flags;
|
|
42
|
+
let { list, workspace } = flags;
|
|
33
43
|
if (!workspace) {
|
|
34
44
|
workspace = config.workspace;
|
|
35
45
|
}
|
|
@@ -41,6 +51,17 @@ export default class Env extends Command {
|
|
|
41
51
|
projectRootDir,
|
|
42
52
|
workspace,
|
|
43
53
|
});
|
|
54
|
+
if (args.name) {
|
|
55
|
+
if (env[args.name] === undefined) {
|
|
56
|
+
this.error(`Env var ${args.name} not found`);
|
|
57
|
+
}
|
|
58
|
+
this.log(env[args.name]);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (list) {
|
|
62
|
+
this.log(Object.keys(env).join('\n'));
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
44
65
|
logEnv(env);
|
|
45
66
|
}
|
|
46
67
|
}
|
package/oclif.manifest.json
CHANGED
|
@@ -180,11 +180,19 @@
|
|
|
180
180
|
},
|
|
181
181
|
"env": {
|
|
182
182
|
"aliases": [],
|
|
183
|
-
"args": {
|
|
183
|
+
"args": {
|
|
184
|
+
"name": {
|
|
185
|
+
"description": "name of the env to display",
|
|
186
|
+
"name": "name",
|
|
187
|
+
"required": false
|
|
188
|
+
}
|
|
189
|
+
},
|
|
184
190
|
"description": "Print project environment variables.",
|
|
185
191
|
"examples": [
|
|
186
192
|
"<%= config.bin %> <%= command.id %>",
|
|
187
|
-
"<%= config.bin %> <%= command.id %>
|
|
193
|
+
"<%= config.bin %> <%= command.id %> myEnv",
|
|
194
|
+
"<%= config.bin %> <%= command.id %> -w dev",
|
|
195
|
+
"<%= config.bin %> <%= command.id %> -w dev -l"
|
|
188
196
|
],
|
|
189
197
|
"flags": {
|
|
190
198
|
"chdir": {
|
|
@@ -195,6 +203,14 @@
|
|
|
195
203
|
"multiple": false,
|
|
196
204
|
"type": "option"
|
|
197
205
|
},
|
|
206
|
+
"list": {
|
|
207
|
+
"char": "l",
|
|
208
|
+
"description": "list only the env vars without values",
|
|
209
|
+
"name": "list",
|
|
210
|
+
"required": false,
|
|
211
|
+
"allowNo": false,
|
|
212
|
+
"type": "boolean"
|
|
213
|
+
},
|
|
198
214
|
"workspace": {
|
|
199
215
|
"char": "w",
|
|
200
216
|
"description": "name of the workspace to print the env vars for",
|
|
@@ -728,5 +744,5 @@
|
|
|
728
744
|
]
|
|
729
745
|
}
|
|
730
746
|
},
|
|
731
|
-
"version": "0.6.
|
|
747
|
+
"version": "0.6.4"
|
|
732
748
|
}
|