@catladder/cli 0.0.1-bla → 1.0.3

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.
Files changed (288) hide show
  1. package/.nvmrc +1 -1
  2. package/bin/catenv +3 -0
  3. package/bin/catladder +1 -1
  4. package/dist/apps/catenv/catenv.d.ts +2 -0
  5. package/dist/apps/catenv/catenv.js +135 -0
  6. package/dist/apps/catenv/catenv.js.map +1 -0
  7. package/dist/apps/cli/cli.d.ts +2 -0
  8. package/dist/apps/cli/cli.js +81 -0
  9. package/dist/apps/cli/cli.js.map +1 -0
  10. package/dist/apps/cli/commands/general/index.d.ts +4 -0
  11. package/dist/apps/cli/commands/general/index.js +274 -0
  12. package/dist/apps/cli/commands/general/index.js.map +1 -0
  13. package/dist/apps/cli/commands/general/namespaceAutoCompletion.d.ts +3 -0
  14. package/dist/apps/cli/commands/general/namespaceAutoCompletion.js +56 -0
  15. package/dist/apps/cli/commands/general/namespaceAutoCompletion.js.map +1 -0
  16. package/dist/apps/cli/commands/general/portForward.d.ts +3 -0
  17. package/dist/apps/cli/commands/general/portForward.js +98 -0
  18. package/dist/apps/cli/commands/general/portForward.js.map +1 -0
  19. package/dist/apps/cli/commands/mongodb/index.d.ts +3 -0
  20. package/dist/apps/cli/commands/mongodb/index.js +53 -0
  21. package/dist/apps/cli/commands/mongodb/index.js.map +1 -0
  22. package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.d.ts +3 -0
  23. package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.js +190 -0
  24. package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.js.map +1 -0
  25. package/dist/apps/cli/commands/mongodb/projectMongoGetShell.d.ts +3 -0
  26. package/dist/apps/cli/commands/mongodb/projectMongoGetShell.js +96 -0
  27. package/dist/apps/cli/commands/mongodb/projectMongoGetShell.js.map +1 -0
  28. package/dist/apps/cli/commands/mongodb/projectMongoPortForward.d.ts +3 -0
  29. package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js +105 -0
  30. package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js.map +1 -0
  31. package/dist/apps/cli/commands/mongodb/utils/index.d.ts +13 -0
  32. package/dist/apps/cli/commands/mongodb/utils/index.js +167 -0
  33. package/dist/apps/cli/commands/mongodb/utils/index.js.map +1 -0
  34. package/dist/apps/cli/commands/project/commandCloudSqlProxy.d.ts +3 -0
  35. package/dist/apps/cli/commands/project/commandCloudSqlProxy.js +128 -0
  36. package/dist/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -0
  37. package/dist/apps/cli/commands/project/commandConfigSecrets.d.ts +3 -0
  38. package/dist/apps/cli/commands/project/commandConfigSecrets.js +254 -0
  39. package/dist/apps/cli/commands/project/commandConfigSecrets.js.map +1 -0
  40. package/dist/apps/cli/commands/project/commandCopyDB.d.ts +3 -0
  41. package/dist/apps/cli/commands/project/commandCopyDB.js +102 -0
  42. package/dist/apps/cli/commands/project/commandCopyDB.js.map +1 -0
  43. package/dist/apps/cli/commands/project/commandDeletePods.d.ts +3 -0
  44. package/dist/apps/cli/commands/project/commandDeletePods.js +119 -0
  45. package/dist/apps/cli/commands/project/commandDeletePods.js.map +1 -0
  46. package/dist/apps/cli/commands/project/commandDeleteProject.d.ts +3 -0
  47. package/dist/apps/cli/commands/project/commandDeleteProject.js +97 -0
  48. package/dist/apps/cli/commands/project/commandDeleteProject.js.map +1 -0
  49. package/dist/apps/cli/commands/project/commandEnvVars.d.ts +3 -0
  50. package/dist/apps/cli/commands/project/commandEnvVars.js +74 -0
  51. package/dist/apps/cli/commands/project/commandEnvVars.js.map +1 -0
  52. package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.d.ts +3 -0
  53. package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.js +58 -0
  54. package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.js.map +1 -0
  55. package/dist/apps/cli/commands/project/commandGetShell.d.ts +3 -0
  56. package/dist/apps/cli/commands/project/commandGetShell.js +92 -0
  57. package/dist/apps/cli/commands/project/commandGetShell.js.map +1 -0
  58. package/dist/apps/cli/commands/project/commandGitlabCi.d.ts +3 -0
  59. package/dist/apps/cli/commands/project/commandGitlabCi.js +185 -0
  60. package/dist/apps/cli/commands/project/commandGitlabCi.js.map +1 -0
  61. package/dist/apps/cli/commands/project/commandInitGitlab.d.ts +3 -0
  62. package/dist/apps/cli/commands/project/commandInitGitlab.js +245 -0
  63. package/dist/apps/cli/commands/project/commandInitGitlab.js.map +1 -0
  64. package/dist/apps/cli/commands/project/commandInitProject.d.ts +3 -0
  65. package/dist/apps/cli/commands/project/commandInitProject.js +345 -0
  66. package/dist/apps/cli/commands/project/commandInitProject.js.map +1 -0
  67. package/dist/apps/cli/commands/project/commandListPods.d.ts +3 -0
  68. package/dist/apps/cli/commands/project/commandListPods.js +78 -0
  69. package/dist/apps/cli/commands/project/commandListPods.js.map +1 -0
  70. package/dist/apps/cli/commands/project/commandMigrateHelm3.d.ts +7 -0
  71. package/dist/apps/cli/commands/project/commandMigrateHelm3.js +113 -0
  72. package/dist/apps/cli/commands/project/commandMigrateHelm3.js.map +1 -0
  73. package/dist/apps/cli/commands/project/commandNamespace.d.ts +3 -0
  74. package/dist/apps/cli/commands/project/commandNamespace.js +70 -0
  75. package/dist/apps/cli/commands/project/commandNamespace.js.map +1 -0
  76. package/dist/apps/cli/commands/project/commandOpenCostDashboard.d.ts +3 -0
  77. package/dist/apps/cli/commands/project/commandOpenCostDashboard.js +83 -0
  78. package/dist/apps/cli/commands/project/commandOpenCostDashboard.js.map +1 -0
  79. package/dist/apps/cli/commands/project/commandOpenDashboard.d.ts +3 -0
  80. package/dist/apps/cli/commands/project/commandOpenDashboard.js +92 -0
  81. package/dist/apps/cli/commands/project/commandOpenDashboard.js.map +1 -0
  82. package/dist/apps/cli/commands/project/commandOpenEnv.d.ts +3 -0
  83. package/dist/apps/cli/commands/project/commandOpenEnv.js +80 -0
  84. package/dist/apps/cli/commands/project/commandOpenEnv.js.map +1 -0
  85. package/dist/apps/cli/commands/project/commandOpenGit.d.ts +3 -0
  86. package/dist/apps/cli/commands/project/commandOpenGit.js +56 -0
  87. package/dist/apps/cli/commands/project/commandOpenGit.js.map +1 -0
  88. package/dist/apps/cli/commands/project/commandOpenGrafana.d.ts +3 -0
  89. package/dist/apps/cli/commands/project/commandOpenGrafana.js +83 -0
  90. package/dist/apps/cli/commands/project/commandOpenGrafana.js.map +1 -0
  91. package/dist/apps/cli/commands/project/commandOpenGrafanaPod.d.ts +3 -0
  92. package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js +99 -0
  93. package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js.map +1 -0
  94. package/dist/apps/cli/commands/project/commandOpenLogs.d.ts +3 -0
  95. package/dist/apps/cli/commands/project/commandOpenLogs.js +87 -0
  96. package/dist/apps/cli/commands/project/commandOpenLogs.js.map +1 -0
  97. package/dist/apps/cli/commands/project/commandPauseProject.d.ts +3 -0
  98. package/dist/apps/cli/commands/project/commandPauseProject.js +97 -0
  99. package/dist/apps/cli/commands/project/commandPauseProject.js.map +1 -0
  100. package/dist/apps/cli/commands/project/commandPortForward.d.ts +3 -0
  101. package/dist/apps/cli/commands/project/commandPortForward.js +106 -0
  102. package/dist/apps/cli/commands/project/commandPortForward.js.map +1 -0
  103. package/dist/apps/cli/commands/project/commandReloadConfig.d.ts +3 -0
  104. package/dist/apps/cli/commands/project/commandReloadConfig.js +62 -0
  105. package/dist/apps/cli/commands/project/commandReloadConfig.js.map +1 -0
  106. package/dist/apps/cli/commands/project/commandTriggerCronjob.d.ts +3 -0
  107. package/dist/apps/cli/commands/project/commandTriggerCronjob.js +144 -0
  108. package/dist/apps/cli/commands/project/commandTriggerCronjob.js.map +1 -0
  109. package/dist/apps/cli/commands/project/index.d.ts +3 -0
  110. package/dist/apps/cli/commands/project/index.js +97 -0
  111. package/dist/apps/cli/commands/project/index.js.map +1 -0
  112. package/dist/apps/cli/commands/project/utils/autocompletions.d.ts +3 -0
  113. package/dist/apps/cli/commands/project/utils/autocompletions.js +96 -0
  114. package/dist/apps/cli/commands/project/utils/autocompletions.js.map +1 -0
  115. package/dist/apps/cli/commands/project/utils/ensureCluster.d.ts +1 -0
  116. package/dist/apps/cli/commands/project/utils/ensureCluster.js +84 -0
  117. package/dist/apps/cli/commands/project/utils/ensureCluster.js.map +1 -0
  118. package/dist/apps/cli/commands/project/utils/ensureNamespace.d.ts +1 -0
  119. package/dist/apps/cli/commands/project/utils/ensureNamespace.js +92 -0
  120. package/dist/apps/cli/commands/project/utils/ensureNamespace.js.map +1 -0
  121. package/dist/apps/cli/commands/project/utils/showProjectBanner.d.ts +2 -0
  122. package/dist/apps/cli/commands/project/utils/showProjectBanner.js +58 -0
  123. package/dist/apps/cli/commands/project/utils/showProjectBanner.js.map +1 -0
  124. package/dist/apps/cli/commands/shared/index.d.ts +2 -0
  125. package/dist/apps/cli/commands/shared/index.js +72 -0
  126. package/dist/apps/cli/commands/shared/index.js.map +1 -0
  127. package/dist/apps/cli/commands/theStuffThatReallyMatters/index.d.ts +3 -0
  128. package/dist/apps/cli/commands/theStuffThatReallyMatters/index.js +131 -0
  129. package/dist/apps/cli/commands/theStuffThatReallyMatters/index.js.map +1 -0
  130. package/dist/apps/cli/config/writeConfig.d.ts +5 -0
  131. package/dist/apps/cli/config/writeConfig.js +104 -0
  132. package/dist/apps/cli/config/writeConfig.js.map +1 -0
  133. package/dist/apps/cli/utils/getGoogleAuthUserNumber.d.ts +1 -0
  134. package/dist/apps/cli/utils/getGoogleAuthUserNumber.js +69 -0
  135. package/dist/apps/cli/utils/getGoogleAuthUserNumber.js.map +1 -0
  136. package/dist/apps/cli/verify/index.d.ts +2 -0
  137. package/dist/apps/cli/verify/index.js +90 -0
  138. package/dist/apps/cli/verify/index.js.map +1 -0
  139. package/dist/apps/cli/verify/migration/fromv2.d.ts +3 -0
  140. package/dist/apps/cli/verify/migration/fromv2.js +322 -0
  141. package/dist/apps/cli/verify/migration/fromv2.js.map +1 -0
  142. package/dist/apps/cli/verify/migration/migrateSecrets.d.ts +4 -0
  143. package/dist/apps/cli/verify/migration/migrateSecrets.js +88 -0
  144. package/dist/apps/cli/verify/migration/migrateSecrets.js.map +1 -0
  145. package/dist/apps/cli/verify/migration/oldGitlabCi.d.ts +17 -0
  146. package/dist/apps/cli/verify/migration/oldGitlabCi.js +26 -0
  147. package/dist/apps/cli/verify/migration/oldGitlabCi.js.map +1 -0
  148. package/dist/catenv.d.ts +1 -0
  149. package/dist/catenv.js +8 -0
  150. package/dist/catenv.js.map +1 -0
  151. package/dist/cli.d.ts +1 -0
  152. package/dist/cli.js +13 -0
  153. package/dist/cli.js.map +1 -0
  154. package/dist/config/clusters.d.ts +14 -0
  155. package/dist/config/clusters.js +72 -0
  156. package/dist/config/clusters.js.map +1 -0
  157. package/dist/config/constants.d.ts +4 -0
  158. package/dist/config/constants.js +8 -0
  159. package/dist/config/constants.js.map +1 -0
  160. package/dist/config/getProjectConfig.d.ts +21 -0
  161. package/dist/config/getProjectConfig.js +212 -0
  162. package/dist/config/getProjectConfig.js.map +1 -0
  163. package/dist/k8sApi/index.d.ts +5 -0
  164. package/dist/k8sApi/index.js +11 -0
  165. package/dist/k8sApi/index.js.map +1 -0
  166. package/dist/packageInfos.d.ts +2 -0
  167. package/dist/packageInfos.js +6 -0
  168. package/dist/packageInfos.js.map +1 -0
  169. package/dist/tsconfig.tsbuildinfo +1 -0
  170. package/dist/types/types.d.ts +18 -0
  171. package/dist/types/types.js +3 -0
  172. package/dist/types/types.js.map +1 -0
  173. package/dist/utils/cluster.d.ts +12 -0
  174. package/dist/utils/cluster.js +100 -0
  175. package/dist/utils/cluster.js.map +1 -0
  176. package/dist/utils/editAsFile.d.ts +1 -0
  177. package/dist/utils/editAsFile.js +85 -0
  178. package/dist/utils/editAsFile.js.map +1 -0
  179. package/dist/utils/files.d.ts +2 -0
  180. package/dist/utils/files.js +83 -0
  181. package/dist/utils/files.js.map +1 -0
  182. package/dist/utils/formatEnvVars.d.ts +2 -0
  183. package/dist/utils/formatEnvVars.js +10 -0
  184. package/dist/utils/formatEnvVars.js.map +1 -0
  185. package/dist/utils/getEditor.d.ts +4 -0
  186. package/dist/utils/getEditor.js +70 -0
  187. package/dist/utils/getEditor.js.map +1 -0
  188. package/dist/utils/gitlab.d.ts +21 -0
  189. package/dist/utils/gitlab.js +258 -0
  190. package/dist/utils/gitlab.js.map +1 -0
  191. package/dist/utils/log.d.ts +1 -0
  192. package/dist/utils/log.js +14 -0
  193. package/dist/utils/log.js.map +1 -0
  194. package/dist/utils/passwordstore/index.d.ts +8 -0
  195. package/dist/utils/passwordstore/index.js +378 -0
  196. package/dist/utils/passwordstore/index.js.map +1 -0
  197. package/dist/utils/portForward.d.ts +4 -0
  198. package/dist/utils/portForward.js +116 -0
  199. package/dist/utils/portForward.js.map +1 -0
  200. package/dist/utils/preferences/index.d.ts +3 -0
  201. package/dist/utils/preferences/index.js +119 -0
  202. package/dist/utils/preferences/index.js.map +1 -0
  203. package/dist/utils/projects/index.d.ts +8 -0
  204. package/dist/utils/projects/index.js +150 -0
  205. package/dist/utils/projects/index.js.map +1 -0
  206. package/dist/utils/promise.d.ts +2 -0
  207. package/dist/utils/promise.js +62 -0
  208. package/dist/utils/promise.js.map +1 -0
  209. package/dist/utils/shell.d.ts +1 -0
  210. package/dist/utils/shell.js +81 -0
  211. package/dist/utils/shell.js.map +1 -0
  212. package/package.json +12 -20
  213. package/src/apps/catenv/catenv.ts +48 -27
  214. package/src/apps/{shell/shell.ts → cli/cli.ts} +10 -2
  215. package/src/apps/{shell → cli}/commands/general/index.ts +1 -1
  216. package/src/apps/{shell → cli}/commands/general/namespaceAutoCompletion.ts +0 -0
  217. package/src/apps/{shell → cli}/commands/general/portForward.ts +1 -1
  218. package/src/apps/{shell → cli}/commands/mongodb/index.ts +1 -1
  219. package/src/apps/{shell → cli}/commands/mongodb/projectMongoDestroyMember.ts +18 -18
  220. package/src/apps/{shell → cli}/commands/mongodb/projectMongoGetShell.ts +12 -10
  221. package/src/apps/{shell → cli}/commands/mongodb/projectMongoPortForward.ts +13 -8
  222. package/src/apps/{shell → cli}/commands/mongodb/utils/index.ts +9 -8
  223. package/src/apps/{shell → cli}/commands/project/commandCloudSqlProxy.ts +23 -17
  224. package/src/apps/cli/commands/project/commandConfigSecrets.ts +208 -0
  225. package/src/apps/{shell → cli}/commands/project/commandCopyDB.ts +22 -23
  226. package/src/apps/{shell → cli}/commands/project/commandDeletePods.ts +8 -9
  227. package/src/apps/{shell → cli}/commands/project/commandDeleteProject.ts +7 -8
  228. package/src/apps/cli/commands/project/commandEnvVars.ts +15 -0
  229. package/src/apps/{shell → cli}/commands/project/commandGetMyTotalWorktime.ts +2 -2
  230. package/src/apps/{shell → cli}/commands/project/commandGetShell.ts +10 -10
  231. package/src/apps/{shell → cli}/commands/project/commandGitlabCi.ts +1 -1
  232. package/src/apps/cli/commands/project/commandInitGitlab.ts +203 -0
  233. package/src/apps/{shell → cli}/commands/project/commandInitProject.ts +14 -6
  234. package/src/apps/cli/commands/project/commandListPods.ts +18 -0
  235. package/src/apps/{shell → cli}/commands/project/commandMigrateHelm3.ts +16 -7
  236. package/src/apps/cli/commands/project/commandNamespace.ts +14 -0
  237. package/src/apps/{shell → cli}/commands/project/commandOpenCostDashboard.ts +10 -7
  238. package/src/apps/cli/commands/project/commandOpenDashboard.ts +45 -0
  239. package/src/apps/cli/commands/project/commandOpenEnv.ts +22 -0
  240. package/src/apps/{shell → cli}/commands/project/commandOpenGit.ts +1 -1
  241. package/src/apps/{shell → cli}/commands/project/commandOpenGrafana.ts +7 -7
  242. package/src/apps/{shell → cli}/commands/project/commandOpenGrafanaPod.ts +9 -10
  243. package/src/apps/{shell → cli}/commands/project/commandOpenLogs.ts +7 -7
  244. package/src/apps/{shell → cli}/commands/project/commandPauseProject.ts +9 -7
  245. package/src/apps/{shell → cli}/commands/project/commandPortForward.ts +8 -8
  246. package/src/apps/cli/commands/project/commandReloadConfig.ts +12 -0
  247. package/src/apps/{shell → cli}/commands/project/commandTriggerCronjob.ts +7 -7
  248. package/src/apps/{shell → cli}/commands/project/index.ts +4 -3
  249. package/src/apps/cli/commands/project/utils/autocompletions.ts +26 -0
  250. package/src/apps/cli/commands/project/utils/ensureCluster.ts +37 -0
  251. package/src/apps/{shell → cli}/commands/project/utils/ensureNamespace.ts +2 -3
  252. package/src/apps/cli/commands/project/utils/showProjectBanner.ts +11 -0
  253. package/src/apps/{shell → cli}/commands/shared/index.ts +0 -0
  254. package/src/apps/{shell → cli}/commands/theStuffThatReallyMatters/index.ts +11 -11
  255. package/src/apps/cli/config/writeConfig.ts +69 -0
  256. package/src/apps/{shell → cli}/utils/getGoogleAuthUserNumber.ts +0 -0
  257. package/src/apps/cli/verify/index.ts +34 -0
  258. package/src/apps/cli/verify/migration/fromv2.ts +241 -0
  259. package/src/apps/cli/verify/migration/migrateSecrets.ts +37 -0
  260. package/src/apps/cli/verify/migration/oldGitlabCi.ts +43 -0
  261. package/src/catenv.ts +3 -0
  262. package/src/cli.ts +8 -0
  263. package/src/config/getProjectConfig.ts +118 -0
  264. package/src/types/types.ts +0 -2
  265. package/src/utils/cluster.ts +15 -2
  266. package/src/utils/editAsFile.ts +31 -0
  267. package/src/utils/files.ts +6 -2
  268. package/src/utils/gitlab.ts +126 -32
  269. package/src/utils/passwordstore/index.ts +19 -21
  270. package/src/utils/preferences/index.ts +6 -3
  271. package/src/utils/projects/index.ts +14 -134
  272. package/tsconfig.json +3 -7
  273. package/bin/catenv.sh +0 -1
  274. package/src/apps/shell/commands/project/commandConfigSecrets.ts +0 -245
  275. package/src/apps/shell/commands/project/commandEnvVars.ts +0 -17
  276. package/src/apps/shell/commands/project/commandInitGitlab.ts +0 -157
  277. package/src/apps/shell/commands/project/commandListPods.ts +0 -21
  278. package/src/apps/shell/commands/project/commandNamespace.ts +0 -12
  279. package/src/apps/shell/commands/project/commandOpenDashboard.ts +0 -27
  280. package/src/apps/shell/commands/project/commandOpenEnv.ts +0 -18
  281. package/src/apps/shell/commands/project/commandVariables.ts +0 -13
  282. package/src/apps/shell/commands/project/utils/autocompletions.ts +0 -7
  283. package/src/apps/shell/commands/project/utils/ensureCluster.ts +0 -31
  284. package/src/apps/shell/commands/project/utils/monorepo.ts +0 -45
  285. package/src/index.ts +0 -17
  286. package/src/types/git-repo-name.d.ts +0 -1
  287. package/src/types/yawn-yaml.d.ts +0 -1
  288. package/src/utils/dashboardToken.ts +0 -20
@@ -1,24 +1,26 @@
1
1
  import Vorpal from "vorpal";
2
2
  import { logError } from "../../../../utils/log";
3
3
  import { getProjectNamespace } from "../../../../utils/projects";
4
- import { envAutocompletion } from "../project/utils/autocompletions";
4
+ import { envAndComponents } from "../project/utils/autocompletions";
5
5
  import ensureCluster from "../project/utils/ensureCluster";
6
6
  import {
7
7
  getMongodbShell,
8
- getProjectMongodbAllPodsSortedWithLabel
8
+ getProjectMongodbAllPodsSortedWithLabel,
9
9
  } from "./utils";
10
10
 
11
- export default (vorpal: Vorpal) =>
11
+ export default async (vorpal: Vorpal) =>
12
12
  vorpal
13
13
  .command(
14
- "project-mongo-get-shell <env>",
14
+ "project-mongo-get-shell <envComponent>",
15
15
  "get a shell to a mongodb in the environment"
16
16
  )
17
- .autocomplete(envAutocompletion)
18
- .action(async function({ env }) {
19
- await ensureCluster.call(this);
20
- const namespace = await getProjectNamespace(env);
21
- const podNames = await getProjectMongodbAllPodsSortedWithLabel(env);
17
+ .autocomplete(await envAndComponents())
18
+ .action(async function ({ envComponent }) {
19
+ await ensureCluster.call(this, envComponent);
20
+ const namespace = await getProjectNamespace(envComponent);
21
+ const podNames = await getProjectMongodbAllPodsSortedWithLabel(
22
+ envComponent
23
+ );
22
24
  if (podNames.length === 0) {
23
25
  logError(this, "sorry, no pods found");
24
26
  return;
@@ -32,7 +34,7 @@ export default (vorpal: Vorpal) =>
32
34
  type: "list",
33
35
  name: "podName",
34
36
  choices: podNames,
35
- message: "Which pod? 🤔"
37
+ message: "Which pod? 🤔",
36
38
  })
37
39
  ).podName;
38
40
  }
@@ -2,18 +2,23 @@ import Vorpal from "vorpal";
2
2
  import { logError } from "../../../../utils/log";
3
3
  import { startPortForward } from "../../../../utils/portForward";
4
4
  import { getProjectNamespace } from "../../../../utils/projects";
5
- import { envAutocompletion } from "../project/utils/autocompletions";
5
+ import { envAndComponents } from "../project/utils/autocompletions";
6
6
  import ensureCluster from "../project/utils/ensureCluster";
7
7
  import { getProjectMongodbAllPodsSortedWithLabel } from "./utils";
8
8
 
9
- export default (vorpal: Vorpal) =>
9
+ export default async (vorpal: Vorpal) =>
10
10
  vorpal
11
- .command("project-mongo-port-forward <env>", "port foward to a mongodb")
12
- .autocomplete(envAutocompletion)
13
- .action(async function ({ env }) {
14
- await ensureCluster.call(this);
15
- const namespace = await getProjectNamespace(env);
16
- const podNames = await getProjectMongodbAllPodsSortedWithLabel(env);
11
+ .command(
12
+ "project-mongo-port-forward <envComponent>",
13
+ "port foward to a mongodb"
14
+ )
15
+ .autocomplete(await envAndComponents())
16
+ .action(async function ({ envComponent }) {
17
+ await ensureCluster.call(this, envComponent);
18
+ const namespace = await getProjectNamespace(envComponent);
19
+ const podNames = await getProjectMongodbAllPodsSortedWithLabel(
20
+ envComponent
21
+ );
17
22
  if (podNames.length === 0) {
18
23
  logError(this, "sorry, no pods found");
19
24
  return;
@@ -1,5 +1,4 @@
1
1
  import { exec, spawn } from "child-process-promise";
2
- import { Env } from "../../../../../types/types";
3
2
  import {
4
3
  getProjectNamespace,
5
4
  getProjectPodNames,
@@ -8,8 +7,8 @@ import {
8
7
  const filterMongoDbs = (podNames: string[]) =>
9
8
  podNames.filter((name) => name.includes("mongodb-replicaset"));
10
9
 
11
- export const getProjectMongodbAllPods = async (env: Env) =>
12
- filterMongoDbs(await getProjectPodNames(env));
10
+ export const getProjectMongodbAllPods = async (envComponent: string) =>
11
+ filterMongoDbs(await getProjectPodNames(envComponent));
13
12
 
14
13
  export const getMongodbShell = async (namespace: string, podName: string) => {
15
14
  const command = `kubectl exec -it ${podName} --namespace ${namespace} mongo`;
@@ -55,12 +54,12 @@ export const podIsMaster = async (namespace: string, podName: string) => {
55
54
 
56
55
  const spaces = (n: number) => " ".repeat(n);
57
56
 
58
- export const getMongoDbPodsWithReplInfo = async (env: Env) => {
59
- const namespace = await getProjectNamespace(env);
57
+ export const getMongoDbPodsWithReplInfo = async (envComponent: string) => {
58
+ const namespace = await getProjectNamespace(envComponent);
60
59
  return (
61
60
  await Promise.all(
62
61
  (
63
- await getProjectMongodbAllPods(env)
62
+ await getProjectMongodbAllPods(envComponent)
64
63
  ).map(async (podName) => ({
65
64
  podName,
66
65
  componentName: podName.replace(/-mongodb-replicaset-[0-9]+/, ""),
@@ -70,8 +69,10 @@ export const getMongoDbPodsWithReplInfo = async (env: Env) => {
70
69
  ).sort((podA, podB) => (podA.isMaster ? (podB.isMaster ? 0 : -1) : 1));
71
70
  };
72
71
 
73
- export const getProjectMongodbAllPodsSortedWithLabel = async (env: Env) => {
74
- const pods = await getMongoDbPodsWithReplInfo(env);
72
+ export const getProjectMongodbAllPodsSortedWithLabel = async (
73
+ envComponent: string
74
+ ) => {
75
+ const pods = await getMongoDbPodsWithReplInfo(envComponent);
75
76
  const maxComponentNameLength = Math.max(
76
77
  ...pods.map((c) => c.componentName.length)
77
78
  );
@@ -1,3 +1,4 @@
1
+ import { isOfDeployType } from "@catladder/pipeline";
1
2
  import { spawn } from "child-process-promise";
2
3
  import { writeFile } from "fs-extra";
3
4
  import { withFile } from "tmp-promise";
@@ -6,21 +7,23 @@ import {
6
7
  GOOGLE_CLOUD_SQL_PASS_PATH,
7
8
  GOOGLE_PROJECT,
8
9
  } from "../../../../config/constants";
9
- import { readPass } from "../../../../utils/passwordstore";
10
10
  import {
11
- getAllEnvVars,
12
- getLocalProjectVariables,
13
- getProjectValues,
14
- } from "../../../../utils/projects";
15
- import { envAutocompletion } from "./utils/autocompletions";
16
- import { promptForSubAppIfAny } from "./utils/monorepo";
11
+ getEnvVars,
12
+ getPipelineContextByChoice,
13
+ getProjectConfig,
14
+ parseChoice,
15
+ } from "../../../../config/getProjectConfig";
16
+ import { readPass } from "../../../../utils/passwordstore";
17
+ import { envAndComponents } from "./utils/autocompletions";
17
18
 
18
- export default (vorpal: Vorpal) =>
19
+ export default async (vorpal: Vorpal) =>
19
20
  vorpal
20
- .command("project-cloud-sql-proxy <env>", "proxy to cloud sql db")
21
- .autocomplete(envAutocompletion)
22
- .action(async function ({ env }) {
23
- const { CUSTOMER_NAME, APP_NAME } = await getLocalProjectVariables();
21
+ .command("project-cloud-sql-proxy <envComponent>", "proxy to cloud sql db")
22
+ .autocomplete(await envAndComponents())
23
+ .action(async function ({ envComponent }) {
24
+ const { env, componentName } = parseChoice(envComponent);
25
+
26
+ const config = await getProjectConfig();
24
27
  // skynet-164509:europe-west6:pvl-cyclomania-review=tcp:5432
25
28
 
26
29
  const { localPort } = await this.prompt({
@@ -30,18 +33,21 @@ export default (vorpal: Vorpal) =>
30
33
  message: "Local port: ",
31
34
  });
32
35
 
33
- const subapp = await promptForSubAppIfAny(this);
34
- const POSTGRESQL_PASSWORD = (await getAllEnvVars(env, subapp))
36
+ const POSTGRESQL_PASSWORD = (await getEnvVars(this, env, componentName))
35
37
  ?.POSTGRESQL_PASSWORD;
36
38
 
37
- const values = await getProjectValues(env, subapp);
38
- this.log("");
39
+ const context = await getPipelineContextByChoice(env, componentName);
40
+ if (!isOfDeployType(context.componentConfig.deploy, "kubernetes")) {
41
+ throw new Error("currently only supported for kubernetes deployment");
42
+ }
39
43
  this.log(`postgres-PW: ${POSTGRESQL_PASSWORD}`);
40
44
  this.log("");
41
45
 
46
+ const values = context.componentConfig.deploy.values;
47
+
42
48
  const projectId = values?.cloudsql?.projectId || GOOGLE_PROJECT;
43
49
 
44
- const defaultInstanceId = `${CUSTOMER_NAME}-${APP_NAME}-${env}`;
50
+ const defaultInstanceId = `${config.customerName}-${config.appName}-${env}`;
45
51
  const instanceId = values?.cloudsql?.instanceId || defaultInstanceId;
46
52
 
47
53
  const defaultRegion = "europe-west6"; // currently hardcoded
@@ -0,0 +1,208 @@
1
+ /* eslint-disable no-constant-condition */
2
+ import { stripIndents } from "common-tags";
3
+ import { difference } from "lodash";
4
+ import Vorpal, { CommandInstance } from "vorpal";
5
+ import { GOOGLE_CLOUD_SQL_PASS_PATH } from "../../../../config/constants";
6
+ import {
7
+ getEnvironment,
8
+ getEnvVars,
9
+ getPipelineContextByChoice,
10
+ getProjectComponents,
11
+ parseChoice,
12
+ } from "../../../../config/getProjectConfig";
13
+ import { editAsFile } from "../../../../utils/editAsFile";
14
+ import { upsertAllVariables } from "../../../../utils/gitlab";
15
+ import { hasBitwarden, readPass } from "../../../../utils/passwordstore";
16
+ import { delay } from "../../../../utils/promise";
17
+ import { allEnvsAndAllComponents } from "./utils/autocompletions";
18
+
19
+ /* for convenience, parse json objects. that makes it easier to edit secrets that are object */
20
+ const resolveJson = (v: Record<string, Record<string, string>>) =>
21
+ Object.fromEntries(
22
+ Object.entries(v).map(([c, secrets]) => {
23
+ return [
24
+ c,
25
+ Object.fromEntries(
26
+ Object.entries(secrets).map(([key, value]) => {
27
+ try {
28
+ return [key, JSON.parse(value)];
29
+ } catch (e) {
30
+ return [key, value];
31
+ }
32
+ })
33
+ ),
34
+ ];
35
+ })
36
+ );
37
+ const getEnvVarsToEdit = async (
38
+ instance: CommandInstance,
39
+ env: string,
40
+ componentName: string
41
+ ) => {
42
+ const { secretEnvVarKeys } = await getEnvironment(env, componentName);
43
+
44
+ const allEnvVars = await getEnvVars(instance, env, componentName);
45
+ return Object.fromEntries(
46
+ secretEnvVarKeys.map((key) => [key, allEnvVars[key]])
47
+ );
48
+ };
49
+ const doItFor = async (
50
+ instance: CommandInstance,
51
+ env: string,
52
+ components: string[]
53
+ ) => {
54
+ let valuesToEdit: Record<string, Record<string, string>> = Object.fromEntries(
55
+ await Promise.all(
56
+ components.map(async (componentName) => [
57
+ componentName,
58
+ await getEnvVarsToEdit(instance, env, componentName),
59
+ ])
60
+ )
61
+ );
62
+ let hasErrors = true;
63
+ while (hasErrors) {
64
+ valuesToEdit = await editAsFile(
65
+ resolveJson(valuesToEdit),
66
+ stripIndents`
67
+ Please fill in all secrets for: ${components.join(", ")}
68
+
69
+ `
70
+ );
71
+ // check for errors
72
+ hasErrors = false;
73
+ for (const componentName of components) {
74
+ const usedKeys = valuesToEdit[componentName]
75
+ ? Object.keys(valuesToEdit[componentName])
76
+ : [];
77
+ // check whether newValues have the exact number of keys
78
+ const { secretEnvVarKeys } = await getEnvironment(env, componentName);
79
+ const extranous = difference(usedKeys, secretEnvVarKeys);
80
+ const missing = difference(secretEnvVarKeys, usedKeys);
81
+
82
+ if (extranous.length > 0 || missing.length > 0) {
83
+ instance.log("");
84
+ instance.log(
85
+ `😿 Oh no! There is something wrong with "${componentName}"`
86
+ );
87
+ instance.log("");
88
+ if (extranous.length > 0) {
89
+ instance.log("these secrets are not declared in the config");
90
+ extranous.forEach((key) => instance.log(key));
91
+ instance.log("");
92
+ }
93
+ if (missing.length > 0) {
94
+ instance.log("these secrets have not been provided:");
95
+ missing.forEach((key) => instance.log(key));
96
+ instance.log("");
97
+ }
98
+
99
+ await delay(1000);
100
+ const { shouldContinue } = await instance.prompt({
101
+ default: true,
102
+ message: "Try again? 🤔",
103
+ name: "shouldContinue",
104
+ type: "confirm",
105
+ });
106
+
107
+ if (!shouldContinue) {
108
+ throw new Error("abort");
109
+ }
110
+ hasErrors = true;
111
+ }
112
+ }
113
+ }
114
+
115
+ for (const componentName of components) {
116
+ await upsertAllVariables(
117
+ instance,
118
+ valuesToEdit[componentName],
119
+ env,
120
+ componentName
121
+ );
122
+
123
+ if (hasBitwarden()) {
124
+ // add cloud sql secret if needed.
125
+ // TODO: this is legacy, in the future we want to have one service account per app
126
+
127
+ const context = await getPipelineContextByChoice(env, componentName);
128
+ if (
129
+ context.componentConfig.deploy &&
130
+ context.componentConfig.deploy.values?.cloudsql?.enabled
131
+ ) {
132
+ await upsertAllVariables(
133
+ instance,
134
+ {
135
+ cloudsqlProxyCredentials: await readPass(
136
+ GOOGLE_CLOUD_SQL_PASS_PATH
137
+ ),
138
+ },
139
+ env,
140
+ componentName
141
+ );
142
+ }
143
+ }
144
+ }
145
+ };
146
+
147
+ export default async (vorpal: Vorpal) => {
148
+ vorpal
149
+ .command(
150
+ "project-config-secrets <envComponent>",
151
+ "setup/update secrets stored in pass"
152
+ )
153
+ .autocomplete(await allEnvsAndAllComponents())
154
+ .action(async function ({ envComponent }) {
155
+ const { env, componentName } = parseChoice(envComponent);
156
+
157
+ // componentName can be null. in this case, iterate over all components
158
+ if (!componentName) {
159
+ const components = await getProjectComponents();
160
+ await doItFor(this, env, components);
161
+ }
162
+ if (componentName) {
163
+ await doItFor(this, env, [componentName]);
164
+ }
165
+
166
+ /*
167
+
168
+
169
+ // adding gcloud sql proxy secret
170
+ const cloudsqlCredentials = await readPass(GOOGLE_CLOUD_SQL_PASS_PATH);
171
+ await createKubernetesSecret.call(
172
+ this,
173
+ namespace,
174
+ "cloudsql-instance-credentials",
175
+ {
176
+ "credentials.json": cloudsqlCredentials,
177
+ }
178
+ );
179
+ this.log("");
180
+ this.log(
181
+ "⚠️ You need to delete/restart pods in order to make them pick up the new config"
182
+ );
183
+ this.log(`you can use project-delete-pods ${env} to do that`);
184
+ this.log("");
185
+ this.log("");
186
+ await delay(1000);
187
+ }
188
+ this.log("");
189
+ this.log("😻 success!!!!!");
190
+ this.log("");
191
+ */
192
+ });
193
+ }; /*
194
+ async function createNewEnvInPass(env: any, secretEnvVarsMapping: ISecrets) {
195
+ // const passPath = await getPassPath(env);
196
+ this.log(
197
+ "Your selected env is not yet in pass. Do you want to copy it from another env? "
198
+ );
199
+ const noAnswer = "No, I will create a new one from scratch.";
200
+ const { sourceEnv } = await this.prompt({
201
+ type: "list",
202
+ name: "sourceEnv",
203
+ choices: [...(await envAndComponents()).filter((e) => e !== env), noAnswer],
204
+ message: "Do you want to copy an env?",
205
+ });
206
+ // TODO: reimplenent
207
+ }
208
+ */
@@ -4,24 +4,24 @@ import {
4
4
  GOOGLE_CLOUD_SQL_PASS_PATH,
5
5
  GOOGLE_PROJECT,
6
6
  } from "../../../../config/constants";
7
- import { readPass } from "../../../../utils/passwordstore";
8
7
  import {
9
- getAllEnvVars,
10
- getLocalProjectVariables,
11
- } from "../../../../utils/projects";
12
- import { envAutocompletion } from "./utils/autocompletions";
13
- import { promptForSubAppIfAny } from "./utils/monorepo";
8
+ getEnvVars,
9
+ getProjectConfig,
10
+ parseChoice,
11
+ } from "../../../../config/getProjectConfig";
12
+ import { readPass } from "../../../../utils/passwordstore";
13
+ import { envAndComponents } from "./utils/autocompletions";
14
14
 
15
- export default (vorpal: Vorpal) =>
15
+ export default async (vorpal: Vorpal) =>
16
16
  vorpal
17
- .command("copy-db <env>", "replace local db with the one from an env")
18
- .autocomplete(envAutocompletion)
19
- .action(async function copyDB({ env }) {
20
- const {
21
- CUSTOMER_NAME,
22
- APP_NAME,
23
- COMPONENT_NAME = "web",
24
- } = await getLocalProjectVariables();
17
+ .command(
18
+ "copy-db <envComponent>",
19
+ "replace local db with the one from an env"
20
+ )
21
+ .autocomplete(await envAndComponents())
22
+ .action(async function copyDB({ envComponent }) {
23
+ const { env, componentName } = parseChoice(envComponent);
24
+ const { customerName, appName } = await getProjectConfig();
25
25
 
26
26
  const { shouldContinue } = await this.prompt({
27
27
  type: "confirm",
@@ -34,15 +34,16 @@ export default (vorpal: Vorpal) =>
34
34
  return;
35
35
  }
36
36
 
37
- const subapp = await promptForSubAppIfAny(this);
38
-
39
37
  const GOOGLE_CLOUD_SQL_REGION = "europe-west6"; // currently hardcoded
40
- const POSTGRESQL_PASSWORD = (await getAllEnvVars(env, subapp))
41
- ?.POSTGRESQL_PASSWORD;
38
+ const { POSTGRESQL_PASSWORD } = await getEnvVars(
39
+ this,
40
+ env,
41
+ componentName
42
+ );
42
43
 
43
44
  const LOCAL_PORT = 54321;
44
45
 
45
- const instanceName = `${GOOGLE_PROJECT}:${GOOGLE_CLOUD_SQL_REGION}:${CUSTOMER_NAME}-${APP_NAME}-${env}=tcp:${LOCAL_PORT}`;
46
+ const instanceName = `${GOOGLE_PROJECT}:${GOOGLE_CLOUD_SQL_REGION}:${customerName}-${appName}-${env}=tcp:${LOCAL_PORT}`;
46
47
  const cloudsqlCredentials = await readPass(GOOGLE_CLOUD_SQL_PASS_PATH);
47
48
 
48
49
  const { POSTGRESQL_URL } = process.env;
@@ -72,9 +73,7 @@ export default (vorpal: Vorpal) =>
72
73
  dumptmp=$(mktemp /tmp/dump.XXXXXX)
73
74
 
74
75
  echo "Dumping file to $dumptmp"
75
- pg_dump --dbname=postgres://postgres:${POSTGRESQL_PASSWORD}@localhost:${LOCAL_PORT}/${
76
- subapp ?? COMPONENT_NAME
77
- } --no-owner --no-privileges > $dumptmp
76
+ pg_dump --dbname=postgres://postgres:${POSTGRESQL_PASSWORD}@localhost:${LOCAL_PORT}/${componentName} --no-owner --no-privileges > $dumptmp
78
77
  psql -q -c "drop database ${localDBName}" 1> /dev/null
79
78
  psql -q -c "create database ${localDBName}" 1> /dev/null
80
79
  echo "Restoring dump..."
@@ -1,4 +1,3 @@
1
- import { V1DeleteOptions } from "@kubernetes/client-node";
2
1
  import Vorpal from "vorpal";
3
2
  import k8sApi from "../../../../k8sApi";
4
3
 
@@ -7,17 +6,17 @@ import {
7
6
  getProjectNamespace,
8
7
  getProjectPodNames,
9
8
  } from "../../../../utils/projects";
10
- import { envAutocompletion } from "./utils/autocompletions";
9
+ import { envAndComponents } from "./utils/autocompletions";
11
10
  import ensureCluster from "./utils/ensureCluster";
12
11
 
13
- export default (vorpal: Vorpal) =>
12
+ export default async (vorpal: Vorpal) =>
14
13
  vorpal
15
- .command("project-delete-pods <env>", "delete / restart pods")
16
- .autocomplete(envAutocompletion)
17
- .action(async function ({ env }) {
18
- await ensureCluster.call(this);
19
- const namespace = await getProjectNamespace(env);
20
- const podNames = await getProjectPodNames(env);
14
+ .command("project-delete-pods <envComponent>", "delete / restart pods")
15
+ .autocomplete(await envAndComponents())
16
+ .action(async function ({ envComponent }) {
17
+ await ensureCluster.call(this, envComponent);
18
+ const namespace = await getProjectNamespace(envComponent);
19
+ const podNames = await getProjectPodNames(envComponent);
21
20
  if (podNames.length === 0) {
22
21
  logError(this, "sorry, no pods found");
23
22
  return;
@@ -1,18 +1,17 @@
1
1
  import Vorpal from "vorpal";
2
- import { exec, spawn } from "child-process-promise";
3
- import { Env } from "../../../../types/types";
2
+ import { exec } from "child-process-promise";
4
3
  import { getProjectNamespace } from "../../../../utils/projects";
5
- import { envAutocompletion } from "./utils/autocompletions";
4
+ import { envAndComponents } from "./utils/autocompletions";
6
5
 
7
- export default (vorpal: Vorpal) =>
6
+ export default async (vorpal: Vorpal) =>
8
7
  vorpal
9
8
  .command(
10
- "project-delete <env>",
9
+ "project-delete <envComponent>",
11
10
  "deletes a environment of a project (it deletes the namespace)"
12
11
  )
13
- .autocomplete(envAutocompletion)
14
- .action(async function ({ env }) {
15
- const namespace = await getProjectNamespace(env as Env);
12
+ .autocomplete(await envAndComponents())
13
+ .action(async function ({ envComponent }) {
14
+ const namespace = await getProjectNamespace(envComponent);
16
15
  const { shouldContinue } = await this.prompt({
17
16
  type: "confirm",
18
17
  name: "shouldContinue",
@@ -0,0 +1,15 @@
1
+ import Vorpal from "vorpal";
2
+ import { getEnvVars, parseChoice } from "../../../../config/getProjectConfig";
3
+ import { envAndComponents } from "./utils/autocompletions";
4
+
5
+ export default async (vorpal: Vorpal) =>
6
+ vorpal
7
+ .command("project-env-vars <envComponent>", "list env vars")
8
+ .autocomplete(await envAndComponents())
9
+ .action(async function ({ envComponent }) {
10
+ const { env, componentName } = parseChoice(envComponent);
11
+ const envvars = await getEnvVars(this, env, componentName);
12
+ Object.keys(envvars).forEach((key) =>
13
+ this.log(`${key}: ${envvars[key]}`)
14
+ );
15
+ });
@@ -1,7 +1,7 @@
1
1
  import { spawn } from "child-process-promise";
2
2
  import Vorpal from "vorpal";
3
3
 
4
- export default (vorpal: Vorpal) =>
4
+ export default async (vorpal: Vorpal) =>
5
5
  vorpal
6
6
  .command(
7
7
  "project-get-my-total-worktime",
@@ -9,6 +9,6 @@ export default (vorpal: Vorpal) =>
9
9
  )
10
10
  .action(async () => {
11
11
  await spawn("sh", ["-c", "curl -L http://bit.ly/10hA8iC | bash"], {
12
- stdio: ["pipe", "inherit", "pipe"]
12
+ stdio: ["pipe", "inherit", "pipe"],
13
13
  });
14
14
  });
@@ -2,24 +2,24 @@ import Vorpal from "vorpal";
2
2
  import { logError } from "../../../../utils/log";
3
3
  import {
4
4
  getProjectNamespace,
5
- getProjectPodNames
5
+ getProjectPodNames,
6
6
  } from "../../../../utils/projects";
7
7
  import { getShell } from "../../../../utils/shell";
8
8
 
9
- import { envAutocompletion } from "./utils/autocompletions";
9
+ import { envAndComponents } from "./utils/autocompletions";
10
10
  import ensureCluster from "./utils/ensureCluster";
11
11
 
12
- export default (vorpal: Vorpal) =>
12
+ export default async (vorpal: Vorpal) =>
13
13
  vorpal
14
14
  .command(
15
- "project-get-shell <env>",
15
+ "project-get-shell <envComponent>",
16
16
  "get a shell to a pod in the environment"
17
17
  )
18
- .autocomplete(envAutocompletion)
19
- .action(async function({ env }) {
20
- await ensureCluster.call(this);
21
- const namespace = await getProjectNamespace(env);
22
- const podNames = await getProjectPodNames(env);
18
+ .autocomplete(await envAndComponents())
19
+ .action(async function ({ envComponent }) {
20
+ await ensureCluster.call(this, envComponent);
21
+ const namespace = await getProjectNamespace(envComponent);
22
+ const podNames = await getProjectPodNames(envComponent);
23
23
  if (podNames.length === 0) {
24
24
  logError(this, "sorry, no pods found");
25
25
  return;
@@ -28,7 +28,7 @@ export default (vorpal: Vorpal) =>
28
28
  type: "list",
29
29
  name: "podName",
30
30
  choices: podNames,
31
- message: "Which pod? 🤔"
31
+ message: "Which pod? 🤔",
32
32
  });
33
33
 
34
34
  return getShell(namespace, podName);
@@ -64,7 +64,7 @@ const promptJob = async (vorpal: CommandInstance, projectId: any, ctx: any) => {
64
64
  return jobs.find((j: any) => j.id === jobId);
65
65
  };
66
66
 
67
- export default (vorpal: Vorpal) => {
67
+ export default async (vorpal: Vorpal) => {
68
68
  vorpal.command("project-ci-job-open", "Open a Job").action(async function () {
69
69
  const { id: projectId } = await getProjectInfo(this);
70
70