@catladder/cli 0.0.0-new-cli-80ac360a → 0.0.0-new-cli-a65ec262
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 +2 -2
- package/dist/bundles/catenv/index.js +4341 -27
- package/dist/bundles/cli/index.js +15981 -771
- package/dist/cli/src/apps/catenv/catenv.d.ts +1 -0
- package/dist/cli/src/apps/catenv/catenv.js +1 -1
- package/dist/cli/src/apps/catenv/catenv.js.map +1 -1
- package/dist/cli/src/apps/catenv/printVariables.js +0 -10
- package/dist/cli/src/apps/catenv/printVariables.js.map +1 -1
- package/dist/cli/src/catenv.js +13 -16
- package/dist/cli/src/catenv.js.map +1 -1
- package/dist/cli/src/cli.js +24 -5
- package/dist/cli/src/cli.js.map +1 -1
- package/dist/cli/src/commands/cloudSQL/commandRestoreDb.js +1 -1
- package/dist/cli/src/commands/cloudSQL/commandRestoreDb.js.map +1 -1
- package/dist/cli/src/commands/fun/commandDadjoke.js +1 -1
- package/dist/cli/src/commands/fun/commandDadjoke.js.map +1 -1
- package/dist/cli/src/commands/fun/commandStarwars.js +1 -1
- package/dist/cli/src/commands/fun/commandStarwars.js.map +1 -1
- package/dist/cli/src/commands/general/commandKubeCurrentContext.js +1 -1
- package/dist/cli/src/commands/general/commandKubeGetShell.js +1 -1
- package/dist/cli/src/commands/general/commandKubeListNamespaces.js +1 -1
- package/dist/cli/src/commands/general/commandKubeListPods.js +1 -1
- package/dist/cli/src/commands/general/commandKubeListSecrets.js +1 -1
- package/dist/cli/src/commands/general/commandKubePortForward.js +1 -1
- package/dist/cli/src/commands/general/commandKubeStopPortforward.js +1 -1
- package/dist/cli/src/commands/index.d.ts +3 -0
- package/dist/cli/src/commands/index.js +23 -1
- package/dist/cli/src/commands/index.js.map +1 -1
- package/dist/cli/src/commands/mongodb/commandMongoDestroyMember.js +1 -1
- package/dist/cli/src/commands/mongodb/commandMongoGetShell.js +1 -1
- package/dist/cli/src/commands/mongodb/commandMongoPortForward.js +1 -1
- package/dist/cli/src/commands/project/commandCloudSqlProxy.js +1 -1
- package/dist/cli/src/commands/project/commandCloudSqlProxy.js.map +1 -1
- package/dist/cli/src/commands/project/commandConfigSecrets.js +1 -1
- package/dist/cli/src/commands/project/commandDeletePods.js +1 -1
- package/dist/cli/src/commands/project/commandDeleteProject.js +1 -1
- package/dist/cli/src/commands/project/commandEnvVars.js +1 -1
- package/dist/cli/src/commands/project/commandGetMyTotalWorktime.js +1 -1
- package/dist/cli/src/commands/project/commandGetMyTotalWorktime.js.map +1 -1
- package/dist/cli/src/commands/project/commandGetShell.js +1 -1
- package/dist/cli/src/commands/project/commandGitlabCi.js +2 -2
- package/dist/cli/src/commands/project/commandListPods.js +1 -1
- package/dist/cli/src/commands/project/commandNamespace.js +1 -1
- package/dist/cli/src/commands/project/commandOpenEnv.js +1 -1
- package/dist/cli/src/commands/project/commandOpenGit.js +1 -1
- package/dist/cli/src/commands/project/commandOpenLogs.js +1 -1
- package/dist/cli/src/commands/project/commandPauseProject.js +1 -1
- package/dist/cli/src/commands/project/commandPortForward.js +1 -1
- package/dist/cli/src/commands/project/commandProjectRestoreDb.js +1 -1
- package/dist/cli/src/commands/project/commandProjectRestoreDb.js.map +1 -1
- package/dist/cli/src/commands/project/commandRenewToken.js +1 -1
- package/dist/cli/src/commands/project/commandSecretsClearBackups.js +1 -1
- package/dist/cli/src/commands/project/commandSecurityEvaluate.js +2 -2
- package/dist/cli/src/commands/project/commandSecurityEvaluate.js.map +1 -1
- package/dist/cli/src/commands/project/commandSetup.js +1 -1
- package/dist/cli/src/commands/project/commandTriggerCronjob.js +2 -2
- package/dist/cli/src/commands/project/commandTriggerCronjob.js.map +1 -1
- package/dist/cli/src/commands/security/commandSecurityAuditCiJob.d.ts +27 -0
- package/dist/cli/src/commands/security/commandSecurityAuditCiJob.js +83 -0
- package/dist/cli/src/commands/security/commandSecurityAuditCiJob.js.map +1 -0
- package/dist/cli/src/commands/security/commandSecurityAuditCreate.d.ts +22 -0
- package/dist/cli/src/commands/security/commandSecurityAuditCreate.js +60 -0
- package/dist/cli/src/commands/security/commandSecurityAuditCreate.js.map +1 -0
- package/dist/cli/src/commands/security/commandSecurityAuditEvaluate.d.ts +7 -0
- package/dist/cli/src/commands/security/commandSecurityAuditEvaluate.js +35 -0
- package/dist/cli/src/commands/security/commandSecurityAuditEvaluate.js.map +1 -0
- package/dist/cli/src/completion.js +49 -36
- package/dist/cli/src/completion.js.map +1 -1
- package/dist/cli/src/security/auditDocument.js.map +1 -0
- package/dist/cli/src/security/createSecurityAuditMergeRequest.js.map +1 -0
- package/dist/cli/src/security/evaluateSecurityAudit.js.map +1 -0
- package/dist/pipeline/src/build/types.d.ts +1 -1
- package/dist/pipeline/src/constants.js +1 -1
- package/dist/pipeline/src/context/getEnvironmentVariables.d.ts +1 -1
- package/dist/pipeline/src/deploy/types/index.d.ts +2 -2
- package/dist/pipeline/src/types/config.d.ts +3 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -6
- package/scripts/bundle +0 -2
- package/src/apps/catenv/catenv.ts +4 -2
- package/src/apps/catenv/printVariables.ts +0 -8
- package/src/catenv.ts +18 -19
- package/src/cli.ts +29 -5
- package/src/commands/cloudSQL/commandRestoreDb.ts +1 -1
- package/src/commands/fun/commandDadjoke.ts +1 -1
- package/src/commands/fun/commandStarwars.ts +1 -1
- package/src/commands/general/commandKubeCurrentContext.ts +1 -1
- package/src/commands/general/commandKubeGetShell.ts +1 -1
- package/src/commands/general/commandKubeListNamespaces.ts +1 -1
- package/src/commands/general/commandKubeListPods.ts +1 -1
- package/src/commands/general/commandKubeListSecrets.ts +1 -1
- package/src/commands/general/commandKubePortForward.ts +1 -1
- package/src/commands/general/commandKubeStopPortforward.ts +1 -1
- package/src/commands/index.ts +5 -0
- package/src/commands/mongodb/commandMongoDestroyMember.ts +1 -1
- package/src/commands/mongodb/commandMongoGetShell.ts +1 -1
- package/src/commands/mongodb/commandMongoPortForward.ts +1 -1
- package/src/commands/project/commandCloudSqlProxy.ts +1 -1
- package/src/commands/project/commandConfigSecrets.ts +1 -1
- package/src/commands/project/commandDeletePods.ts +1 -1
- package/src/commands/project/commandDeleteProject.ts +1 -1
- package/src/commands/project/commandEnvVars.ts +1 -1
- package/src/commands/project/commandGetMyTotalWorktime.ts +1 -1
- package/src/commands/project/commandGetShell.ts +1 -1
- package/src/commands/project/commandGitlabCi.ts +2 -2
- package/src/commands/project/commandListPods.ts +1 -1
- package/src/commands/project/commandNamespace.ts +1 -1
- package/src/commands/project/commandOpenEnv.ts +1 -1
- package/src/commands/project/commandOpenGit.ts +1 -1
- package/src/commands/project/commandOpenLogs.ts +1 -1
- package/src/commands/project/commandPauseProject.ts +1 -1
- package/src/commands/project/commandPortForward.ts +1 -1
- package/src/commands/project/commandProjectRestoreDb.ts +1 -1
- package/src/commands/project/commandRenewToken.ts +1 -1
- package/src/commands/project/commandSecretsClearBackups.ts +1 -1
- package/src/commands/project/commandSecurityEvaluate.ts +2 -2
- package/src/commands/project/commandSetup.ts +1 -1
- package/src/commands/project/commandTriggerCronjob.ts +2 -2
- package/src/commands/security/commandSecurityAuditCiJob.ts +91 -0
- package/src/commands/security/commandSecurityAuditCreate.ts +58 -0
- package/src/commands/security/commandSecurityAuditEvaluate.ts +30 -0
- package/src/completion.ts +53 -45
- package/bin/catci +0 -3
- package/bin/catci-dev +0 -3
- package/dist/bundles/catci/index.js +0 -71714
- package/dist/cli/src/apps/catci/catci.d.ts +0 -1
- package/dist/cli/src/apps/catci/catci.js +0 -33
- package/dist/cli/src/apps/catci/catci.js.map +0 -1
- package/dist/cli/src/apps/catci/commands/security/auditDocument.js.map +0 -1
- package/dist/cli/src/apps/catci/commands/security/commands.d.ts +0 -2
- package/dist/cli/src/apps/catci/commands/security/commands.js +0 -118
- package/dist/cli/src/apps/catci/commands/security/commands.js.map +0 -1
- package/dist/cli/src/apps/catci/commands/security/createSecurityAuditMergeRequest.js.map +0 -1
- package/dist/cli/src/apps/catci/commands/security/evaluateSecurityAudit.js.map +0 -1
- package/dist/cli/src/catci.d.ts +0 -1
- package/dist/cli/src/catci.js +0 -7
- package/dist/cli/src/catci.js.map +0 -1
- package/src/apps/catci/catci.ts +0 -26
- package/src/apps/catci/commands/security/commands.ts +0 -161
- package/src/catci.ts +0 -3
- /package/dist/cli/src/{apps/catci/commands/security → security}/auditDocument.d.ts +0 -0
- /package/dist/cli/src/{apps/catci/commands/security → security}/auditDocument.js +0 -0
- /package/dist/cli/src/{apps/catci/commands/security → security}/createSecurityAuditMergeRequest.d.ts +0 -0
- /package/dist/cli/src/{apps/catci/commands/security → security}/createSecurityAuditMergeRequest.js +0 -0
- /package/dist/cli/src/{apps/catci/commands/security → security}/evaluateSecurityAudit.d.ts +0 -0
- /package/dist/cli/src/{apps/catci/commands/security → security}/evaluateSecurityAudit.js +0 -0
- /package/dist/cli/src/{apps/catci/commands/security → security}/topics.json +0 -0
- /package/src/{apps/catci/commands/security → security}/auditDocument.ts +0 -0
- /package/src/{apps/catci/commands/security → security}/createSecurityAuditMergeRequest.ts +0 -0
- /package/src/{apps/catci/commands/security → security}/evaluateSecurityAudit.ts +0 -0
- /package/src/{apps/catci/commands/security → security}/topics.json +0 -0
package/package.json
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
}
|
|
54
54
|
],
|
|
55
55
|
"license": "MIT",
|
|
56
|
-
"version": "0.0.0-new-cli-
|
|
56
|
+
"version": "0.0.0-new-cli-a65ec262",
|
|
57
57
|
"scripts": {
|
|
58
58
|
"lint": "eslint \"src/**/*.ts\"",
|
|
59
59
|
"lint:fix": "eslint \"src/**/*.ts\" --fix",
|
|
@@ -66,7 +66,6 @@
|
|
|
66
66
|
"build:watch": "tsc-watch --onSuccess \"yarn dev:own-catenv\""
|
|
67
67
|
},
|
|
68
68
|
"bin": {
|
|
69
|
-
"catci": "./bin/catci",
|
|
70
69
|
"catenv": "./bin/catenv",
|
|
71
70
|
"catladder": "./bin/catladder"
|
|
72
71
|
},
|
|
@@ -80,6 +79,7 @@
|
|
|
80
79
|
"@babel/core": "^7.29.0",
|
|
81
80
|
"@babel/plugin-syntax-typescript": "^7.28.6",
|
|
82
81
|
"@gitbeaker/rest": "^39.28.0",
|
|
82
|
+
"@inquirer/prompts": "^8.4.3",
|
|
83
83
|
"@kubernetes/client-node": "^0.16.2",
|
|
84
84
|
"@tsconfig/node14": "^1.0.1",
|
|
85
85
|
"@types/common-tags": "^1.8.4",
|
|
@@ -90,13 +90,13 @@
|
|
|
90
90
|
"@types/request": "^2.48.12",
|
|
91
91
|
"@types/tmp": "^0.2.3",
|
|
92
92
|
"@types/update-notifier": "^2.5.0",
|
|
93
|
-
"@types/vorpal": "^1.12.0",
|
|
94
93
|
"@types/websocket": "^0.0.40",
|
|
95
94
|
"@types/yargs": "^17.0.33",
|
|
96
95
|
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
|
|
97
96
|
"child-process-promise": "^2.2.1",
|
|
98
97
|
"clipboardy": "^2.0.0",
|
|
99
98
|
"command-exists-promise": "^2.0.2",
|
|
99
|
+
"commander": "^14.0.3",
|
|
100
100
|
"common-tags": "^1.8.2",
|
|
101
101
|
"connection-string-parser": "^1.0.4",
|
|
102
102
|
"date-fns": "^3.6.0",
|
|
@@ -111,12 +111,9 @@
|
|
|
111
111
|
"tsc-alias": "^1.8.16",
|
|
112
112
|
"tsc-watch": "^7.2.0",
|
|
113
113
|
"typescript": "^5.4.5",
|
|
114
|
-
"vorpal": "^1.12.0",
|
|
115
114
|
"yaml": "^2.5.0"
|
|
116
115
|
},
|
|
117
116
|
"dependencies": {
|
|
118
|
-
"@inquirer/prompts": "^8.4.3",
|
|
119
|
-
"commander": "^14.0.3",
|
|
120
117
|
"tsx": "^4.21.0"
|
|
121
118
|
},
|
|
122
119
|
"stableVersion": "0.0.0"
|
package/scripts/bundle
CHANGED
|
@@ -2,5 +2,3 @@
|
|
|
2
2
|
ncc build dist/cli/src/catenv.js -o dist/bundles/catenv -e 'tsx/cjs/api' $( ((SHOULD_MINIFY == 1)) && printf %s '-m')
|
|
3
3
|
|
|
4
4
|
ncc build dist/cli/src/cli.js -o dist/bundles/cli -e 'tsx/cjs/api' $( ((SHOULD_MINIFY == 1)) && printf %s '-m')
|
|
5
|
-
|
|
6
|
-
ncc build dist/cli/src/catci.js -o dist/bundles/catci -e 'tsx/cjs/api' $( ((SHOULD_MINIFY == 1)) && printf %s '-m')
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
|
|
12
12
|
type Options = {
|
|
13
13
|
verbose?: boolean;
|
|
14
|
+
printVariables?: boolean;
|
|
14
15
|
};
|
|
15
16
|
export default async (choice?: Choice, options?: Options) => {
|
|
16
17
|
const config = await getProjectConfig();
|
|
@@ -28,7 +29,8 @@ export default async (choice?: Choice, options?: Options) => {
|
|
|
28
29
|
writeDotEnvFiles(context, choice),
|
|
29
30
|
|
|
30
31
|
writeDTsFiles(context, choice),
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
options?.printVariables
|
|
33
|
+
? printVariables(context, choice)
|
|
34
|
+
: Promise.resolve(),
|
|
33
35
|
]);
|
|
34
36
|
};
|
|
@@ -14,10 +14,6 @@ const getAllVariablesToPrint = async (config: Config, choice?: Choice) => {
|
|
|
14
14
|
);
|
|
15
15
|
|
|
16
16
|
if (currentComponent) {
|
|
17
|
-
// don't print vars if dotenv is enabled
|
|
18
|
-
if (config.components[currentComponent].dotEnv ?? true) {
|
|
19
|
-
return {};
|
|
20
|
-
}
|
|
21
17
|
return await getEnvVarsResolved(null, env, currentComponent);
|
|
22
18
|
} else {
|
|
23
19
|
// when in a monorep and not in a subapp, merge all env vars.
|
|
@@ -25,10 +21,6 @@ const getAllVariablesToPrint = async (config: Config, choice?: Choice) => {
|
|
|
25
21
|
// so we also add prefixed variants
|
|
26
22
|
return await Object.keys(config.components).reduce(
|
|
27
23
|
async (acc, componentName) => {
|
|
28
|
-
// don't print vars if dotenv is enabled
|
|
29
|
-
if (config.components[componentName].dotEnv ?? true) {
|
|
30
|
-
return await acc;
|
|
31
|
-
}
|
|
32
24
|
const subappvars = await getEnvVarsResolved(null, env, componentName);
|
|
33
25
|
delete subappvars["_ALL_ENV_VAR_KEYS"];
|
|
34
26
|
return {
|
package/src/catenv.ts
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
1
2
|
import catenv from "./apps/catenv/catenv";
|
|
2
|
-
|
|
3
3
|
import { parseChoice } from "./config/parseChoice";
|
|
4
|
+
import packageInfos from "./packageInfos";
|
|
4
5
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const helpFlags = ["--help", "-h", "help"];
|
|
8
|
-
if (args.some((arg) => helpFlags.includes(arg))) {
|
|
9
|
-
const docLink =
|
|
10
|
-
"https://git.panter.ch/catladder/catladder/-/blob/main/docs/1_VARS.md";
|
|
11
|
-
console.log(
|
|
12
|
-
`\nUsage: catenv [env|env:component] [-v|--verbose]\n\nEnv variable and catenv documentation:\n${docLink}`,
|
|
13
|
-
);
|
|
14
|
-
process.exit(0);
|
|
15
|
-
}
|
|
6
|
+
const program = new Command();
|
|
16
7
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
program
|
|
9
|
+
.name("catenv")
|
|
10
|
+
.description("Environment variable and pipeline generation via direnv")
|
|
11
|
+
.version(packageInfos.version)
|
|
12
|
+
.argument("[envComponent]", "env or env:component")
|
|
13
|
+
.option("-v, --verbose", "verbose output")
|
|
14
|
+
.action((envComponent: string | undefined, opts: { verbose?: boolean }) => {
|
|
15
|
+
catenv(envComponent ? parseChoice(envComponent) : null, {
|
|
16
|
+
verbose: opts.verbose ?? false,
|
|
17
|
+
}).then(() => {
|
|
18
|
+
// we have to exit manually, because we have some file watches
|
|
19
|
+
process.exit();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
// we have to exit manually, because we have some file watches
|
|
23
|
-
process.exit();
|
|
24
|
-
});
|
|
23
|
+
program.parse();
|
package/src/cli.ts
CHANGED
|
@@ -24,8 +24,28 @@ program
|
|
|
24
24
|
// Collect all command defs for completion
|
|
25
25
|
const allCommandDefs: CommandDef[] = [];
|
|
26
26
|
|
|
27
|
+
// Cache for intermediate subcommand groups (e.g., "project", "project cloudsql")
|
|
28
|
+
const subcommandCache = new Map<string, Command>();
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get or create a chain of nested subcommands.
|
|
32
|
+
* E.g., for ["project", "cloudsql"], ensures program.command("project").command("cloudsql") exists.
|
|
33
|
+
*/
|
|
34
|
+
function getOrCreateParent(parts: string[]): Command {
|
|
35
|
+
if (parts.length === 0) return program;
|
|
36
|
+
|
|
37
|
+
const key = parts.join(" ");
|
|
38
|
+
if (subcommandCache.has(key)) return subcommandCache.get(key)!;
|
|
39
|
+
|
|
40
|
+
const parent = getOrCreateParent(parts.slice(0, -1));
|
|
41
|
+
const cmd = parent.command(parts[parts.length - 1]);
|
|
42
|
+
subcommandCache.set(key, cmd);
|
|
43
|
+
return cmd;
|
|
44
|
+
}
|
|
45
|
+
|
|
27
46
|
/**
|
|
28
47
|
* Register a CommandDef with Commander.js.
|
|
48
|
+
* - Command name can contain spaces for nesting (e.g., "project cloudsql proxy")
|
|
29
49
|
* - Inputs with `positional: true` become Commander positional args
|
|
30
50
|
* - Other inputs become optional --flags
|
|
31
51
|
* - --inputs accepts JSON for programmatic use
|
|
@@ -45,15 +65,19 @@ function registerCommand(def: CommandDef): void {
|
|
|
45
65
|
}
|
|
46
66
|
}
|
|
47
67
|
|
|
48
|
-
//
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
68
|
+
// Split name into parent groups + leaf command
|
|
69
|
+
const nameParts = def.name.split(" ");
|
|
70
|
+
const parentParts = nameParts.slice(0, -1);
|
|
71
|
+
const leafName = nameParts[nameParts.length - 1];
|
|
72
|
+
|
|
73
|
+
// Build leaf command string with positional args
|
|
74
|
+
let cmdStr = leafName;
|
|
52
75
|
for (const [name] of positionalInputs) {
|
|
53
76
|
cmdStr += ` [${name}]`;
|
|
54
77
|
}
|
|
55
78
|
|
|
56
|
-
const
|
|
79
|
+
const parent = getOrCreateParent(parentParts);
|
|
80
|
+
const cmd = parent.command(cmdStr).description(def.description);
|
|
57
81
|
|
|
58
82
|
// Add --flag for each non-positional input
|
|
59
83
|
for (const [name, inputDef] of flagInputs) {
|
|
@@ -4,7 +4,7 @@ import type { CloudSqlBackgroundProxy } from "../../gcloud/cloudSql/startProxy";
|
|
|
4
4
|
import { startCloudSqlProxyInBackground } from "../../gcloud/cloudSql/startProxy";
|
|
5
5
|
|
|
6
6
|
export const commandRestoreDb = defineCommand({
|
|
7
|
-
name: "
|
|
7
|
+
name: "cloudsql restore-db",
|
|
8
8
|
description: "restore a db from one source to another target",
|
|
9
9
|
group: "cloudSQL",
|
|
10
10
|
inputs: {
|
|
@@ -2,7 +2,7 @@ import { spawn } from "child-process-promise";
|
|
|
2
2
|
import { defineCommand } from "../../core/defineCommand";
|
|
3
3
|
|
|
4
4
|
export const commandStarwars = defineCommand({
|
|
5
|
-
name: "starwars",
|
|
5
|
+
name: "fun starwars",
|
|
6
6
|
description: "Long time ago... in a galaxy far far away...",
|
|
7
7
|
group: "fun",
|
|
8
8
|
inputs: {},
|
|
@@ -2,7 +2,7 @@ import { defineCommand } from "../../core/defineCommand";
|
|
|
2
2
|
import { getCurrentContext } from "../../utils/cluster";
|
|
3
3
|
|
|
4
4
|
export const commandKubeCurrentContext = defineCommand({
|
|
5
|
-
name: "kube
|
|
5
|
+
name: "kube current-context",
|
|
6
6
|
description: "show current kubernetes context",
|
|
7
7
|
group: "general",
|
|
8
8
|
inputs: {},
|
|
@@ -4,7 +4,7 @@ import { getk8sApi } from "../../k8sApi";
|
|
|
4
4
|
import { getShell } from "../../utils/shell";
|
|
5
5
|
|
|
6
6
|
export const commandKubeGetShell = defineCommand({
|
|
7
|
-
name: "kube
|
|
7
|
+
name: "kube get-shell",
|
|
8
8
|
description: "get a shell to a pod in the environment",
|
|
9
9
|
group: "general",
|
|
10
10
|
inputs: {
|
|
@@ -2,7 +2,7 @@ import { defineCommand } from "../../core/defineCommand";
|
|
|
2
2
|
import { getk8sApi } from "../../k8sApi";
|
|
3
3
|
|
|
4
4
|
export const commandKubeListNamespaces = defineCommand({
|
|
5
|
-
name: "kube
|
|
5
|
+
name: "kube list-namespaces",
|
|
6
6
|
description: "list all namespaces",
|
|
7
7
|
group: "general",
|
|
8
8
|
inputs: {},
|
|
@@ -2,7 +2,7 @@ import { defineCommand } from "../../core/defineCommand";
|
|
|
2
2
|
import { getk8sApi } from "../../k8sApi";
|
|
3
3
|
|
|
4
4
|
export const commandKubeListPods = defineCommand({
|
|
5
|
-
name: "kube
|
|
5
|
+
name: "kube list-pods",
|
|
6
6
|
description: "list all pods of namespace",
|
|
7
7
|
group: "general",
|
|
8
8
|
inputs: {
|
|
@@ -2,7 +2,7 @@ import { defineCommand } from "../../core/defineCommand";
|
|
|
2
2
|
import { getk8sApi } from "../../k8sApi";
|
|
3
3
|
|
|
4
4
|
export const commandKubeListSecrets = defineCommand({
|
|
5
|
-
name: "kube
|
|
5
|
+
name: "kube list-secrets",
|
|
6
6
|
description: "show secrets",
|
|
7
7
|
group: "general",
|
|
8
8
|
inputs: {
|
|
@@ -3,7 +3,7 @@ import { getk8sApi } from "../../k8sApi";
|
|
|
3
3
|
import { startKubePortForward } from "../../kubernetes/portForward";
|
|
4
4
|
|
|
5
5
|
export const commandKubePortForward = defineCommand({
|
|
6
|
-
name: "kube
|
|
6
|
+
name: "kube port-forward",
|
|
7
7
|
description: "start port-forwarding",
|
|
8
8
|
group: "general",
|
|
9
9
|
inputs: {
|
|
@@ -2,7 +2,7 @@ import { defineCommand } from "../../core/defineCommand";
|
|
|
2
2
|
import { stopPortForward } from "../../utils/portForwards";
|
|
3
3
|
|
|
4
4
|
export const commandKubeStopPortforward = defineCommand({
|
|
5
|
-
name: "kube
|
|
5
|
+
name: "kube stop-portforward",
|
|
6
6
|
description: "stop a running port forward",
|
|
7
7
|
group: "general",
|
|
8
8
|
inputs: {
|
package/src/commands/index.ts
CHANGED
|
@@ -41,6 +41,11 @@ export { commandMongoDestroyMember } from "./mongodb/commandMongoDestroyMember";
|
|
|
41
41
|
// CloudSQL commands
|
|
42
42
|
export { commandRestoreDb } from "./cloudSQL/commandRestoreDb";
|
|
43
43
|
|
|
44
|
+
// Security commands
|
|
45
|
+
export { commandSecurityAuditCiJob } from "./security/commandSecurityAuditCiJob";
|
|
46
|
+
export { commandSecurityAuditEvaluate } from "./security/commandSecurityAuditEvaluate";
|
|
47
|
+
export { commandSecurityAuditCreate } from "./security/commandSecurityAuditCreate";
|
|
48
|
+
|
|
44
49
|
// Fun commands
|
|
45
50
|
export { commandDadjoke } from "./fun/commandDadjoke";
|
|
46
51
|
export { commandStarwars } from "./fun/commandStarwars";
|
|
@@ -34,7 +34,7 @@ const removeFinalizerAndDelete = async (
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
export const commandMongoDestroyMember = defineCommand({
|
|
37
|
-
name: "project
|
|
37
|
+
name: "project mongo destroy-member",
|
|
38
38
|
description: "DESTROY a member of a replicaset in order to reinitialize it",
|
|
39
39
|
group: "mongodb",
|
|
40
40
|
inputs: {
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import { envAndComponents } from "../../apps/cli/commands/project/utils/autocompletions";
|
|
10
10
|
|
|
11
11
|
export const commandMongoGetShell = defineCommand({
|
|
12
|
-
name: "project
|
|
12
|
+
name: "project mongo get-shell",
|
|
13
13
|
description: "get a shell to a mongodb in the environment",
|
|
14
14
|
group: "mongodb",
|
|
15
15
|
inputs: {
|
|
@@ -9,7 +9,7 @@ import clipboard from "clipboardy";
|
|
|
9
9
|
import { envAndComponents } from "../../apps/cli/commands/project/utils/autocompletions";
|
|
10
10
|
|
|
11
11
|
export const commandMongoPortForward = defineCommand({
|
|
12
|
-
name: "project
|
|
12
|
+
name: "project mongo port-forward",
|
|
13
13
|
description: "port forward to a mongodb",
|
|
14
14
|
group: "mongodb",
|
|
15
15
|
inputs: {
|
|
@@ -91,7 +91,7 @@ const getJdbcUrl = (
|
|
|
91
91
|
`DATABASE_JDBC_URL="jdbc:postgresql://localhost:${localPort}/${DB_NAME}?schema=public&user=${DB_USER}&password=${DB_PASSWORD}"`;
|
|
92
92
|
|
|
93
93
|
export const commandCloudSqlProxy = defineCommand({
|
|
94
|
-
name: "project
|
|
94
|
+
name: "project cloudsql proxy",
|
|
95
95
|
description: "proxy to cloud sql db",
|
|
96
96
|
group: "project",
|
|
97
97
|
inputs: {
|
|
@@ -7,7 +7,7 @@ import { envAndComponents } from "../../apps/cli/commands/project/utils/autocomp
|
|
|
7
7
|
// Full migration to CommandIO would require reworking the editor flow,
|
|
8
8
|
// so for now we bridge it.
|
|
9
9
|
export const commandConfigSecrets = defineCommand({
|
|
10
|
-
name: "project
|
|
10
|
+
name: "project config-secrets",
|
|
11
11
|
description: "setup/update secrets stored in pass",
|
|
12
12
|
group: "project",
|
|
13
13
|
inputs: {
|
|
@@ -7,7 +7,7 @@ import { ensureCluster } from "../../apps/cli/commands/project/utils/ensureClust
|
|
|
7
7
|
import { envAndComponents } from "../../apps/cli/commands/project/utils/autocompletions";
|
|
8
8
|
|
|
9
9
|
export const commandDeletePods = defineCommand({
|
|
10
|
-
name: "project
|
|
10
|
+
name: "project delete-pods",
|
|
11
11
|
description: "delete / restart pods",
|
|
12
12
|
group: "project",
|
|
13
13
|
|
|
@@ -4,7 +4,7 @@ import { getProjectNamespace } from "../../utils/projects";
|
|
|
4
4
|
import { envAndComponents } from "../../apps/cli/commands/project/utils/autocompletions";
|
|
5
5
|
|
|
6
6
|
export const commandDeleteProject = defineCommand({
|
|
7
|
-
name: "project
|
|
7
|
+
name: "project delete",
|
|
8
8
|
description: "deletes a environment of a project (it deletes the namespace)",
|
|
9
9
|
group: "project",
|
|
10
10
|
inputs: {
|
|
@@ -3,7 +3,7 @@ import { getEnvVarsResolved, parseChoice } from "../../config/getProjectConfig";
|
|
|
3
3
|
import { envAndComponents } from "../../apps/cli/commands/project/utils/autocompletions";
|
|
4
4
|
|
|
5
5
|
export const commandEnvVars = defineCommand({
|
|
6
|
-
name: "project
|
|
6
|
+
name: "project env-vars",
|
|
7
7
|
description: "list env vars",
|
|
8
8
|
group: "project",
|
|
9
9
|
inputs: {
|
|
@@ -2,7 +2,7 @@ import { spawn } from "child-process-promise";
|
|
|
2
2
|
import { defineCommand } from "../../core/defineCommand";
|
|
3
3
|
|
|
4
4
|
export const commandGetMyTotalWorktime = defineCommand({
|
|
5
|
-
name: "project
|
|
5
|
+
name: "project worktime",
|
|
6
6
|
description: "show the total worktime that you spent on a project",
|
|
7
7
|
group: "project",
|
|
8
8
|
inputs: {},
|
|
@@ -7,7 +7,7 @@ import { ensureCluster } from "../../apps/cli/commands/project/utils/ensureClust
|
|
|
7
7
|
import { envAndComponents } from "../../apps/cli/commands/project/utils/autocompletions";
|
|
8
8
|
|
|
9
9
|
export const commandGetShell = defineCommand({
|
|
10
|
-
name: "project
|
|
10
|
+
name: "project get-shell",
|
|
11
11
|
description: "get a shell to a pod in the environment",
|
|
12
12
|
group: "project",
|
|
13
13
|
inputs: {
|
|
@@ -61,7 +61,7 @@ const findJobById = async (io: any, jobName: string) => {
|
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
export const commandCiJobOpen = defineCommand({
|
|
64
|
-
name: "project
|
|
64
|
+
name: "project ci job-open",
|
|
65
65
|
description: "Open a Job",
|
|
66
66
|
group: "project",
|
|
67
67
|
inputs: {
|
|
@@ -79,7 +79,7 @@ export const commandCiJobOpen = defineCommand({
|
|
|
79
79
|
});
|
|
80
80
|
|
|
81
81
|
export const commandCiJobLog = defineCommand({
|
|
82
|
-
name: "project
|
|
82
|
+
name: "project ci job-log",
|
|
83
83
|
description: "Show a job's log",
|
|
84
84
|
group: "project",
|
|
85
85
|
inputs: {
|
|
@@ -6,7 +6,7 @@ import { ensureCluster } from "../../apps/cli/commands/project/utils/ensureClust
|
|
|
6
6
|
import { envAndComponents } from "../../apps/cli/commands/project/utils/autocompletions";
|
|
7
7
|
|
|
8
8
|
export const commandListPods = defineCommand({
|
|
9
|
-
name: "project
|
|
9
|
+
name: "project list-pods",
|
|
10
10
|
description: "list pods of local project",
|
|
11
11
|
group: "project",
|
|
12
12
|
inputs: {
|
|
@@ -3,7 +3,7 @@ import { getProjectNamespace } from "../../utils/projects";
|
|
|
3
3
|
import { envAndComponents } from "../../apps/cli/commands/project/utils/autocompletions";
|
|
4
4
|
|
|
5
5
|
export const commandNamespace = defineCommand({
|
|
6
|
-
name: "project
|
|
6
|
+
name: "project namespace",
|
|
7
7
|
description: "show namespace of local project",
|
|
8
8
|
group: "project",
|
|
9
9
|
inputs: {
|
|
@@ -5,7 +5,7 @@ import { ensureCluster } from "../../apps/cli/commands/project/utils/ensureClust
|
|
|
5
5
|
import { envAndComponents } from "../../apps/cli/commands/project/utils/autocompletions";
|
|
6
6
|
|
|
7
7
|
export const commandOpenEnv = defineCommand({
|
|
8
|
-
name: "project
|
|
8
|
+
name: "project open env",
|
|
9
9
|
description: "open the live environment",
|
|
10
10
|
group: "project",
|
|
11
11
|
inputs: {
|
|
@@ -2,7 +2,7 @@ import { exec } from "child-process-promise";
|
|
|
2
2
|
import { defineCommand } from "../../core/defineCommand";
|
|
3
3
|
|
|
4
4
|
export const commandOpenGit = defineCommand({
|
|
5
|
-
name: "project
|
|
5
|
+
name: "project open git",
|
|
6
6
|
description: "open the repo on gitlab / github in your browser",
|
|
7
7
|
group: "project",
|
|
8
8
|
inputs: {},
|
|
@@ -7,7 +7,7 @@ import { openGoogleCloudLogs } from "../../kubernetes/openKubernetesDashboards";
|
|
|
7
7
|
import { envAndComponents } from "../../apps/cli/commands/project/utils/autocompletions";
|
|
8
8
|
|
|
9
9
|
export const commandOpenLogs = defineCommand({
|
|
10
|
-
name: "project
|
|
10
|
+
name: "project open logs",
|
|
11
11
|
description: "open google cloud logs (stackdriver logs)",
|
|
12
12
|
group: "project",
|
|
13
13
|
inputs: {
|
|
@@ -4,7 +4,7 @@ import { getProjectNamespace } from "../../utils/projects";
|
|
|
4
4
|
import { envAndComponents } from "../../apps/cli/commands/project/utils/autocompletions";
|
|
5
5
|
|
|
6
6
|
export const commandPauseProject = defineCommand({
|
|
7
|
-
name: "project
|
|
7
|
+
name: "project pause",
|
|
8
8
|
description: "halts all running pods (scales to 0)",
|
|
9
9
|
group: "project",
|
|
10
10
|
inputs: {
|
|
@@ -12,7 +12,7 @@ import open from "open";
|
|
|
12
12
|
import { envAndComponents } from "../../apps/cli/commands/project/utils/autocompletions";
|
|
13
13
|
|
|
14
14
|
export const commandPortForward = defineCommand({
|
|
15
|
-
name: "project
|
|
15
|
+
name: "project port-forward",
|
|
16
16
|
description: "start port-forwarding",
|
|
17
17
|
group: "project",
|
|
18
18
|
inputs: {
|
|
@@ -23,7 +23,7 @@ const hasCloudSql = (context: ComponentContext) => {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
export const commandProjectRestoreDb = defineCommand({
|
|
26
|
-
name: "project
|
|
26
|
+
name: "project cloudsql restore-db",
|
|
27
27
|
description: "restores a project db from one source to another target",
|
|
28
28
|
group: "project",
|
|
29
29
|
inputs: {
|
|
@@ -2,7 +2,7 @@ import { defineCommand } from "../../core/defineCommand";
|
|
|
2
2
|
import { setupAccessTokens } from "../../apps/cli/commands/project/setup/setupAccessTokens";
|
|
3
3
|
|
|
4
4
|
export const commandRenewToken = defineCommand({
|
|
5
|
-
name: "project
|
|
5
|
+
name: "project renew-token",
|
|
6
6
|
description: "Configures the project access token for semantic release.",
|
|
7
7
|
group: "project",
|
|
8
8
|
inputs: {},
|
|
@@ -2,7 +2,7 @@ import { defineCommand } from "../../core/defineCommand";
|
|
|
2
2
|
import { clearBackups } from "../../utils/gitlab";
|
|
3
3
|
|
|
4
4
|
export const commandSecretsClearBackups = defineCommand({
|
|
5
|
-
name: "project
|
|
5
|
+
name: "project secrets-clear-backups",
|
|
6
6
|
description: "clears all backups",
|
|
7
7
|
group: "project",
|
|
8
8
|
inputs: {
|
|
@@ -2,11 +2,11 @@ import { defineCommand } from "../../core/defineCommand";
|
|
|
2
2
|
import {
|
|
3
3
|
evaluateSecurityAudit,
|
|
4
4
|
makeSecurityAuditOverview,
|
|
5
|
-
} from "../../
|
|
5
|
+
} from "../../security/evaluateSecurityAudit";
|
|
6
6
|
import { getGitRoot } from "../../utils/projects";
|
|
7
7
|
|
|
8
8
|
export const commandSecurityEvaluate = defineCommand({
|
|
9
|
-
name: "project
|
|
9
|
+
name: "project security-evaluate",
|
|
10
10
|
description: "evaluate project's security audit document",
|
|
11
11
|
group: "project",
|
|
12
12
|
inputs: {},
|
|
@@ -2,7 +2,7 @@ import { defineCommand } from "../../core/defineCommand";
|
|
|
2
2
|
import { setupProject } from "../../apps/cli/commands/project/setup";
|
|
3
3
|
|
|
4
4
|
export const commandSetup = defineCommand({
|
|
5
|
-
name: "project
|
|
5
|
+
name: "project setup",
|
|
6
6
|
description:
|
|
7
7
|
"Initializes all environments and creates required resources, service accounts, etc.",
|
|
8
8
|
group: "project",
|
|
@@ -46,7 +46,7 @@ const runCronjob = async (
|
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
export const commandTriggerCronjobGeneral = defineCommand({
|
|
49
|
-
name: "trigger-cronjob",
|
|
49
|
+
name: "kube trigger-cronjob",
|
|
50
50
|
description: "trigger cronjob",
|
|
51
51
|
group: "general",
|
|
52
52
|
inputs: {
|
|
@@ -69,7 +69,7 @@ export const commandTriggerCronjobGeneral = defineCommand({
|
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
export const commandTriggerCronjobProject = defineCommand({
|
|
72
|
-
name: "project
|
|
72
|
+
name: "project trigger-cronjob",
|
|
73
73
|
description: "trigger cronjob",
|
|
74
74
|
group: "project",
|
|
75
75
|
inputs: {
|