@cloud-cli/env 1.3.5 → 1.5.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/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { help } from "@cloud-cli/cli";
1
2
  export interface EnvEntry {
2
3
  app: string;
3
4
  key: string;
@@ -26,7 +27,7 @@ declare function setVar(options: AppKeyValue): {
26
27
  value: string;
27
28
  };
28
29
  declare function removeVar(options: AppKeyValue): boolean;
29
- declare function getVar(options: Omit<AppKeyValue, 'value'>): EnvEntry;
30
+ declare function getVar(options: Omit<AppKeyValue, "value">): EnvEntry;
30
31
  declare const _default: {
31
32
  get: typeof getVar;
32
33
  set: typeof setVar;
@@ -34,5 +35,6 @@ declare const _default: {
34
35
  show: typeof show;
35
36
  apps: typeof apps;
36
37
  list: typeof list;
38
+ [help]: () => string;
37
39
  };
38
40
  export default _default;
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { getStorage } from '@cloud-cli/cli';
2
- const appNotSpecifiedError = new Error('App not specified');
3
- const keyNotSpecifiedError = new Error('Key not specified');
4
- const { get, set, remove, getAll } = getStorage('env');
1
+ import { getStorage, help } from "@cloud-cli/cli";
2
+ const appNotSpecifiedError = new Error("App not specified");
3
+ const keyNotSpecifiedError = new Error("Key not specified");
4
+ const { get, set, remove, getAll } = getStorage("env");
5
5
  const readName = (options) => {
6
6
  options.app = options.app || options.name || options._?.[0];
7
7
  };
@@ -72,4 +72,19 @@ export default {
72
72
  show,
73
73
  apps,
74
74
  list,
75
+ [help]: () => `Manage environment variables
76
+
77
+ Available commands:
78
+ env.get --app <app> --key <key> - Get an app environment variable
79
+ env.set --app <app> --key <key> --value <value> - Set an environment variable
80
+ env.remove --app <app> --key <key> - Remove an environment variable
81
+ env.show --app <app> - Show all environment variables for an app
82
+ env.list [--app <app>] [--key <key>] - List matching environment variables
83
+ env.apps - List all defined apps
84
+
85
+ Options:
86
+ name - App name
87
+ app - Application name
88
+ key - Environment variable key
89
+ value - Environment variable value`,
75
90
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud-cli/env",
3
- "version": "1.3.5",
3
+ "version": "1.5.0",
4
4
  "description": "Storage for app environment variables",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -29,6 +29,6 @@
29
29
  "access": "public"
30
30
  },
31
31
  "peerDependencies": {
32
- "@cloud-cli/cli": "^2.0.0"
32
+ "@cloud-cli/cli": "^2.2.0"
33
33
  }
34
34
  }