hereya-cli 0.6.2 → 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 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.2 linux-x64 node-v20.13.1
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)
@@ -43,7 +43,7 @@ USAGE
43
43
  * [`hereya up`](#hereya-up)
44
44
  * [`hereya workspace create NAME`](#hereya-workspace-create-name)
45
45
  * [`hereya workspace delete NAME`](#hereya-workspace-delete-name)
46
- * [`hereya workspace env`](#hereya-workspace-env)
46
+ * [`hereya workspace env [NAME]`](#hereya-workspace-env-name)
47
47
  * [`hereya workspace install PACKAGE`](#hereya-workspace-install-package)
48
48
  * [`hereya workspace uninstall PACKAGE`](#hereya-workspace-uninstall-package)
49
49
 
@@ -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.2/src/commands/add/index.ts)_
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.2/src/commands/bootstrap/index.ts)_
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.2/src/commands/deploy/index.ts)_
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.2/src/commands/down/index.ts)_
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.2/src/commands/env/index.ts)_
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.2/src/commands/init/index.ts)_
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.2/src/commands/remote/exec/index.ts)_
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.2/src/commands/remove/index.ts)_
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.2/src/commands/run/index.ts)_
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.2/src/commands/undeploy/index.ts)_
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.2/src/commands/up/index.ts)_
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.2/src/commands/workspace/create/index.ts)_
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,17 +371,21 @@ 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.2/src/commands/workspace/delete/index.ts)_
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
- ## `hereya workspace env`
376
+ ## `hereya workspace env [NAME]`
369
377
 
370
378
  Print workspace env vars.
371
379
 
372
380
  ```
373
381
  USAGE
374
- $ hereya workspace env -w <value>
382
+ $ hereya workspace env [NAME] -w <value> [-l]
383
+
384
+ ARGUMENTS
385
+ NAME name of the env to display
375
386
 
376
387
  FLAGS
388
+ -l, --list list only the env vars without values
377
389
  -w, --workspace=<value> (required) name of the workspace to print env vars for
378
390
 
379
391
  DESCRIPTION
@@ -381,9 +393,11 @@ DESCRIPTION
381
393
 
382
394
  EXAMPLES
383
395
  $ hereya workspace env -w dev
396
+
397
+ $ hereya workspace env myEnv -w dev
384
398
  ```
385
399
 
386
- _See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.2/src/commands/workspace/env/index.ts)_
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)_
387
401
 
388
402
  ## `hereya workspace install PACKAGE`
389
403
 
@@ -409,7 +423,7 @@ EXAMPLES
409
423
  $ hereya workspace install hereya/aws-cognito
410
424
  ```
411
425
 
412
- _See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.2/src/commands/workspace/install/index.ts)_
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)_
413
427
 
414
428
  ## `hereya workspace uninstall PACKAGE`
415
429
 
@@ -435,5 +449,5 @@ EXAMPLES
435
449
  $ hereya workspace uninstall hereya/aws-cognito
436
450
  ```
437
451
 
438
- _See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.6.2/src/commands/workspace/uninstall/index.ts)_
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)_
439
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
  }
@@ -1,8 +1,12 @@
1
1
  import { Command } from '@oclif/core';
2
2
  export default class WorkspaceEnv 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: {
9
+ list: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
6
10
  workspace: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
7
11
  };
8
12
  run(): Promise<void>;
@@ -1,12 +1,21 @@
1
- import { Command, Flags } from '@oclif/core';
1
+ import { Args, Command, Flags } from '@oclif/core';
2
2
  import { getBackend } from '../../../backend/index.js';
3
3
  import { logEnv } from '../../../lib/env-utils.js';
4
4
  export default class WorkspaceEnv extends Command {
5
+ static args = {
6
+ name: Args.string({ description: 'name of the env to display', required: false }),
7
+ };
5
8
  static description = 'Print workspace env vars.';
6
9
  static examples = [
7
10
  '<%= config.bin %> <%= command.id %> -w dev',
11
+ '<%= config.bin %> <%= command.id %> myEnv -w dev',
8
12
  ];
9
13
  static flags = {
14
+ list: Flags.boolean({
15
+ char: 'l',
16
+ description: 'list only the env vars without values',
17
+ required: false,
18
+ }),
10
19
  workspace: Flags.string({
11
20
  char: 'w',
12
21
  description: 'name of the workspace to print env vars for',
@@ -14,7 +23,7 @@ export default class WorkspaceEnv extends Command {
14
23
  }),
15
24
  };
16
25
  async run() {
17
- const { flags } = await this.parse(WorkspaceEnv);
26
+ const { args, flags } = await this.parse(WorkspaceEnv);
18
27
  const backend = await getBackend();
19
28
  const getWorkspaceEnvOutput = await backend.getWorkspaceEnv({
20
29
  workspace: flags.workspace,
@@ -23,6 +32,17 @@ export default class WorkspaceEnv extends Command {
23
32
  this.error(getWorkspaceEnvOutput.reason);
24
33
  }
25
34
  const { env } = getWorkspaceEnvOutput;
35
+ if (args.name) {
36
+ if (env[args.name] === undefined) {
37
+ this.error(`Env var ${args.name} not found`);
38
+ }
39
+ this.log(env[args.name]);
40
+ return;
41
+ }
42
+ if (flags.list) {
43
+ this.log(Object.keys(env).join('\n'));
44
+ return;
45
+ }
26
46
  logEnv(env);
27
47
  }
28
48
  }
@@ -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 %> -w dev"
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",
@@ -563,12 +579,27 @@
563
579
  },
564
580
  "workspace:env": {
565
581
  "aliases": [],
566
- "args": {},
582
+ "args": {
583
+ "name": {
584
+ "description": "name of the env to display",
585
+ "name": "name",
586
+ "required": false
587
+ }
588
+ },
567
589
  "description": "Print workspace env vars.",
568
590
  "examples": [
569
- "<%= config.bin %> <%= command.id %> -w dev"
591
+ "<%= config.bin %> <%= command.id %> -w dev",
592
+ "<%= config.bin %> <%= command.id %> myEnv -w dev"
570
593
  ],
571
594
  "flags": {
595
+ "list": {
596
+ "char": "l",
597
+ "description": "list only the env vars without values",
598
+ "name": "list",
599
+ "required": false,
600
+ "allowNo": false,
601
+ "type": "boolean"
602
+ },
572
603
  "workspace": {
573
604
  "char": "w",
574
605
  "description": "name of the workspace to print env vars for",
@@ -713,5 +744,5 @@
713
744
  ]
714
745
  }
715
746
  },
716
- "version": "0.6.2"
747
+ "version": "0.6.4"
717
748
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hereya-cli",
3
3
  "description": "Infrastructure as Package",
4
- "version": "0.6.2",
4
+ "version": "0.6.4",
5
5
  "author": "Hereya Developers",
6
6
  "bin": {
7
7
  "hereya": "./bin/run.js"