@geekmidas/cli 9.0.2 → 10.0.0-alpha.1
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 +66 -122
- package/dist/{CachedStateProvider-BdX7klRc.cjs → CachedStateProvider-BLo7zv7S.cjs} +1 -1
- package/dist/CachedStateProvider-BxoAm-B2.mjs +3 -0
- package/dist/{CachedStateProvider-klLWZXWF.cjs → CachedStateProvider-CqPdW7CB.cjs} +1 -1
- package/dist/{CachedStateProvider-klLWZXWF.cjs.map → CachedStateProvider-CqPdW7CB.cjs.map} +1 -1
- package/dist/{CachedStateProvider-CzyFct42.mjs → CachedStateProvider-DTniehMP.mjs} +1 -1
- package/dist/{CachedStateProvider-CzyFct42.mjs.map → CachedStateProvider-DTniehMP.mjs.map} +1 -1
- package/dist/{HostingerProvider-B2ZYz7Yc.mjs → HostingerProvider-Cft7lEYr.mjs} +4 -3
- package/dist/HostingerProvider-Cft7lEYr.mjs.map +1 -0
- package/dist/{HostingerProvider-CrHfsgz9.cjs → HostingerProvider-h3EbEp-Z.cjs} +4 -3
- package/dist/HostingerProvider-h3EbEp-Z.cjs.map +1 -0
- package/dist/{LocalStateProvider-CP49rjzt.mjs → LocalStateProvider-Bn6tS-oL.mjs} +1 -1
- package/dist/{LocalStateProvider-CP49rjzt.mjs.map → LocalStateProvider-Bn6tS-oL.mjs.map} +1 -1
- package/dist/{LocalStateProvider-CalzNfNA.cjs → LocalStateProvider-Db9SEjyH.cjs} +1 -1
- package/dist/{LocalStateProvider-CalzNfNA.cjs.map → LocalStateProvider-Db9SEjyH.cjs.map} +1 -1
- package/dist/{Route53Provider-tlgBzrRQ.mjs → Route53Provider-RdpUDJQk.mjs} +1 -1
- package/dist/{Route53Provider-tlgBzrRQ.mjs.map → Route53Provider-RdpUDJQk.mjs.map} +1 -1
- package/dist/{Route53Provider-DwgXiLxt.cjs → Route53Provider-di2fMM5N.cjs} +1 -1
- package/dist/{Route53Provider-DwgXiLxt.cjs.map → Route53Provider-di2fMM5N.cjs.map} +1 -1
- package/dist/{SSMStateProvider-BlrTiV5m.mjs → SSMStateProvider-BRt2py-A.mjs} +1 -1
- package/dist/{SSMStateProvider-BlrTiV5m.mjs.map → SSMStateProvider-BRt2py-A.mjs.map} +1 -1
- package/dist/{SSMStateProvider-Bt6r8CTL.cjs → SSMStateProvider-DyX8s9HI.cjs} +1 -1
- package/dist/{SSMStateProvider-Bt6r8CTL.cjs.map → SSMStateProvider-DyX8s9HI.cjs.map} +1 -1
- package/dist/{backup-provisioner-Xunq-p_8.mjs → backup-provisioner-Bgj5Vi_L.mjs} +2 -2
- package/dist/{backup-provisioner-Xunq-p_8.mjs.map → backup-provisioner-Bgj5Vi_L.mjs.map} +1 -1
- package/dist/{backup-provisioner-B3HBN-2k.cjs → backup-provisioner-BrsHwYG0.cjs} +2 -2
- package/dist/{backup-provisioner-B3HBN-2k.cjs.map → backup-provisioner-BrsHwYG0.cjs.map} +1 -1
- package/dist/{bundler-Dufq3uvI.cjs → bundler-BY1OmV1e.cjs} +44 -14
- package/dist/bundler-BY1OmV1e.cjs.map +1 -0
- package/dist/{bundler-DkA4qzUD.mjs → bundler-Be8Zg4Wd.mjs} +45 -15
- package/dist/bundler-Be8Zg4Wd.mjs.map +1 -0
- package/dist/config-D8o6I_7Z.mjs +469 -0
- package/dist/config-D8o6I_7Z.mjs.map +1 -0
- package/dist/config-DbPE1KXF.cjs +535 -0
- package/dist/config-DbPE1KXF.cjs.map +1 -0
- package/dist/config.cjs +3 -2
- package/dist/config.d.cts +2 -2
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts +2 -2
- package/dist/config.d.mts.map +1 -1
- package/dist/config.mjs +3 -2
- package/dist/{credentials-s1kLcIzK.mjs → credentials-B5zRHdAl.mjs} +21 -6
- package/dist/credentials-B5zRHdAl.mjs.map +1 -0
- package/dist/{credentials-C8DWtnMY.cjs → credentials-BapzjyV5.cjs} +26 -5
- package/dist/credentials-BapzjyV5.cjs.map +1 -0
- package/dist/credentials-Dh0Q6HzY.mjs +2548 -0
- package/dist/credentials-Dh0Q6HzY.mjs.map +1 -0
- package/dist/credentials-K961ThG3.cjs +2680 -0
- package/dist/credentials-K961ThG3.cjs.map +1 -0
- package/dist/deploy/sniffer-routes-worker.cjs +6 -2
- package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
- package/dist/deploy/sniffer-routes-worker.mjs +6 -2
- package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
- package/dist/discover-CAlFgYec.mjs +229 -0
- package/dist/discover-CAlFgYec.mjs.map +1 -0
- package/dist/discover-DTmFeloL.cjs +271 -0
- package/dist/discover-DTmFeloL.cjs.map +1 -0
- package/dist/dokploy-api-BS2xnJLZ.mjs +3 -0
- package/dist/{dokploy-api-CqOIKHme.cjs → dokploy-api-BsVH0y_s.cjs} +141 -32
- package/dist/dokploy-api-BsVH0y_s.cjs.map +1 -0
- package/dist/dokploy-api-BuxDRo3l.cjs +3 -0
- package/dist/{dokploy-api-sfZFlWuE.mjs → dokploy-api-aTFPz7_4.mjs} +141 -32
- package/dist/dokploy-api-aTFPz7_4.mjs.map +1 -0
- package/dist/emit-CbcRolsa.cjs +236 -0
- package/dist/emit-CbcRolsa.cjs.map +1 -0
- package/dist/emit-CiZS_5Ub.mjs +206 -0
- package/dist/emit-CiZS_5Ub.mjs.map +1 -0
- package/dist/{encryption-MfXAiFTm.cjs → encryption-C6jaU0hE.cjs} +1 -1
- package/dist/{encryption-MfXAiFTm.cjs.map → encryption-C6jaU0hE.cjs.map} +1 -1
- package/dist/{encryption-BVS7Vmzs.cjs → encryption-CHzzeR8a.cjs} +1 -1
- package/dist/encryption-CQUncu7v.mjs +3 -0
- package/dist/{encryption-CO5Q4Bhf.mjs → encryption-D-abyhZx.mjs} +1 -1
- package/dist/{encryption-CO5Q4Bhf.mjs.map → encryption-D-abyhZx.mjs.map} +1 -1
- package/dist/fullstack-secrets-C-GGohke.cjs +111 -0
- package/dist/fullstack-secrets-C-GGohke.cjs.map +1 -0
- package/dist/fullstack-secrets-D1o9-G5l.mjs +87 -0
- package/dist/fullstack-secrets-D1o9-G5l.mjs.map +1 -0
- package/dist/{fullstack-secrets-BYzi6Hwl.cjs → generator-CNzBw7g5.cjs} +1 -114
- package/dist/generator-CNzBw7g5.cjs.map +1 -0
- package/dist/{fullstack-secrets-l8s3II_H.mjs → generator-VE2JrFlY.mjs} +2 -85
- package/dist/generator-VE2JrFlY.mjs.map +1 -0
- package/dist/index-BThUzEIp.d.mts +175 -0
- package/dist/index-BThUzEIp.d.mts.map +1 -0
- package/dist/index-CHB4tSzX.d.cts +175 -0
- package/dist/index-CHB4tSzX.d.cts.map +1 -0
- package/dist/index.cjs +2530 -1810
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +2506 -1786
- package/dist/index.mjs.map +1 -1
- package/dist/{openapi-Cfwi0fqF.mjs → openapi-CgpMWMmM.mjs} +174 -95
- package/dist/openapi-CgpMWMmM.mjs.map +1 -0
- package/dist/{openapi-BzNOC7_i.cjs → openapi-CljONd_M.cjs} +175 -108
- package/dist/openapi-CljONd_M.cjs.map +1 -0
- package/dist/{openapi-react-query-C4iIvpPf.mjs → openapi-react-query-Byltvm_7.mjs} +2 -2
- package/dist/openapi-react-query-Byltvm_7.mjs.map +1 -0
- package/dist/{openapi-react-query-CYWik72n.cjs → openapi-react-query-CmJ1xDbn.cjs} +2 -2
- package/dist/openapi-react-query-CmJ1xDbn.cjs.map +1 -0
- package/dist/openapi-react-query.cjs +1 -1
- package/dist/openapi-react-query.mjs +1 -1
- package/dist/openapi.cjs +4 -3
- package/dist/openapi.d.cts +1 -1
- package/dist/openapi.d.mts +1 -1
- package/dist/openapi.mjs +4 -3
- package/dist/reconcile/public.cjs +9 -0
- package/dist/reconcile/public.d.cts +125 -0
- package/dist/reconcile/public.d.cts.map +1 -0
- package/dist/reconcile/public.d.mts +125 -0
- package/dist/reconcile/public.d.mts.map +1 -0
- package/dist/reconcile/public.mjs +4 -0
- package/dist/{reconcile-B2FoJE0a.mjs → reconcile-CFs8C_1a.mjs} +5 -4
- package/dist/reconcile-CFs8C_1a.mjs.map +1 -0
- package/dist/{reconcile-BzqKJ2Rt.cjs → reconcile-D0pimNiy.cjs} +5 -4
- package/dist/reconcile-D0pimNiy.cjs.map +1 -0
- package/dist/setup-CJiQM2pX.cjs +473 -0
- package/dist/setup-CJiQM2pX.cjs.map +1 -0
- package/dist/setup-DMtU3p41.cjs +11 -0
- package/dist/setup-DOsYueeQ.mjs +443 -0
- package/dist/setup-DOsYueeQ.mjs.map +1 -0
- package/dist/setup-DSutDAlt.mjs +11 -0
- package/dist/{storage-B1wvztiJ.cjs → storage-BJmzYxt8.cjs} +1 -1
- package/dist/{storage-B1wvztiJ.cjs.map → storage-BJmzYxt8.cjs.map} +1 -1
- package/dist/{storage-DOEtT2Hr.cjs → storage-BM9hGpgv.cjs} +1 -1
- package/dist/{storage-dbb9RyBl.mjs → storage-Bi24WfoW.mjs} +1 -1
- package/dist/{storage-dbb9RyBl.mjs.map → storage-Bi24WfoW.mjs.map} +1 -1
- package/dist/{storage-Cs4WBsc4.mjs → storage-CYlGwWTj.mjs} +1 -1
- package/dist/{sync-CSooqRQ8.mjs → sync-CmEuNZsB.mjs} +2 -2
- package/dist/{sync-CSooqRQ8.mjs.map → sync-CmEuNZsB.mjs.map} +1 -1
- package/dist/sync-D306yOWu.cjs +4 -0
- package/dist/{sync-o_CtEbvR.cjs → sync-SizaChmC.cjs} +2 -2
- package/dist/{sync-o_CtEbvR.cjs.map → sync-SizaChmC.cjs.map} +1 -1
- package/dist/{sync-B5UHXwRM.mjs → sync-hOqAWHR6.mjs} +1 -1
- package/dist/{index-Bw548Bta.d.mts → types-C-arnQ1r.d.mts} +590 -143
- package/dist/types-C-arnQ1r.d.mts.map +1 -0
- package/dist/{index-DTpkeFb8.d.cts → types-abJQuk7m.d.cts} +590 -143
- package/dist/types-abJQuk7m.d.cts.map +1 -0
- package/dist/workspace/index.cjs +5 -1
- package/dist/workspace/index.d.cts +3 -3
- package/dist/workspace/index.d.mts +3 -3
- package/dist/workspace/index.mjs +2 -2
- package/dist/{workspace-D-37Ylqo.mjs → workspace-7FqprxuJ.mjs} +117 -30
- package/dist/workspace-7FqprxuJ.mjs.map +1 -0
- package/dist/workspace-8acupeaI.cjs +9 -0
- package/dist/{workspace-CQTT7HJQ.cjs → workspace-XvqO9jIv.cjs} +139 -28
- package/dist/workspace-XvqO9jIv.cjs.map +1 -0
- package/dist/workspace-yP5AHnrn.mjs +8 -0
- package/package.json +26 -9
- package/CHANGELOG.md +0 -650
- package/FUNCTION_CRON_SUPPORT.md +0 -266
- package/dist/CachedStateProvider-GcGziXh1.mjs +0 -3
- package/dist/HostingerProvider-B2ZYz7Yc.mjs.map +0 -1
- package/dist/HostingerProvider-CrHfsgz9.cjs.map +0 -1
- package/dist/bundler-DkA4qzUD.mjs.map +0 -1
- package/dist/bundler-Dufq3uvI.cjs.map +0 -1
- package/dist/config-Bbu1JKvf.mjs +0 -211
- package/dist/config-Bbu1JKvf.mjs.map +0 -1
- package/dist/config-DujV8DbR.cjs +0 -253
- package/dist/config-DujV8DbR.cjs.map +0 -1
- package/dist/credentials-C8DWtnMY.cjs.map +0 -1
- package/dist/credentials-s1kLcIzK.mjs.map +0 -1
- package/dist/dokploy-api-BPYkG-ZZ.cjs +0 -3
- package/dist/dokploy-api-BiSzWM4v.mjs +0 -3
- package/dist/dokploy-api-CqOIKHme.cjs.map +0 -1
- package/dist/dokploy-api-sfZFlWuE.mjs.map +0 -1
- package/dist/encryption-Bd_m4q3g.mjs +0 -3
- package/dist/fullstack-secrets-BYzi6Hwl.cjs.map +0 -1
- package/dist/fullstack-secrets-l8s3II_H.mjs.map +0 -1
- package/dist/index-Bw548Bta.d.mts.map +0 -1
- package/dist/index-DTpkeFb8.d.cts.map +0 -1
- package/dist/openapi-BzNOC7_i.cjs.map +0 -1
- package/dist/openapi-Cfwi0fqF.mjs.map +0 -1
- package/dist/openapi-react-query-C4iIvpPf.mjs.map +0 -1
- package/dist/openapi-react-query-CYWik72n.cjs.map +0 -1
- package/dist/reconcile-B2FoJE0a.mjs.map +0 -1
- package/dist/reconcile-BzqKJ2Rt.cjs.map +0 -1
- package/dist/setup-DDXUXzzl.mjs +0 -765
- package/dist/setup-DDXUXzzl.mjs.map +0 -1
- package/dist/setup-DLwhfyt-.cjs +0 -8
- package/dist/setup-Dh-B7YTX.mjs +0 -8
- package/dist/setup-WZ-xqAQO.cjs +0 -849
- package/dist/setup-WZ-xqAQO.cjs.map +0 -1
- package/dist/sync-BLA94rgC.cjs +0 -4
- package/dist/types-B3GQUg3k.d.mts +0 -280
- package/dist/types-B3GQUg3k.d.mts.map +0 -1
- package/dist/types-BWQDiooe.d.cts +0 -280
- package/dist/types-BWQDiooe.d.cts.map +0 -1
- package/dist/workspace-CQTT7HJQ.cjs.map +0 -1
- package/dist/workspace-D-37Ylqo.mjs.map +0 -1
- package/docs/OPENAPI_TYPESCRIPT_DESIGN.md +0 -408
- package/docs/dev-server-resilience-design.md +0 -189
- package/docs/manifest-refactor-design.md +0 -287
- package/examples/cron-example.ts +0 -45
- package/examples/env.ts +0 -33
- package/examples/function-example.ts +0 -40
- package/examples/gkm.config.json +0 -22
- package/examples/gkm.config.ts +0 -14
- package/examples/gkm.minimal.config.json +0 -7
- package/examples/gkm.production.config.json +0 -27
- package/examples/logger.ts +0 -10
- package/scripts/sync-versions.ts +0 -108
- package/src/__tests__/EndpointGenerator.hooks.spec.ts +0 -204
- package/src/__tests__/config.spec.ts +0 -422
- package/src/__tests__/loadEnvFiles.spec.ts +0 -131
- package/src/__tests__/normalizeHooksConfig.spec.ts +0 -63
- package/src/__tests__/openapi-react-query.spec.ts +0 -506
- package/src/__tests__/openapi.spec.ts +0 -625
- package/src/__tests__/test-helpers.ts +0 -181
- package/src/auth/__tests__/credentials.spec.ts +0 -331
- package/src/auth/__tests__/index.spec.ts +0 -237
- package/src/auth/credentials.ts +0 -286
- package/src/auth/index.ts +0 -233
- package/src/build/__tests__/bundler.spec.ts +0 -446
- package/src/build/__tests__/endpoint-analyzer.spec.ts +0 -623
- package/src/build/__tests__/handler-templates.spec.ts +0 -1287
- package/src/build/__tests__/index-new.spec.ts +0 -550
- package/src/build/__tests__/manifests.spec.ts +0 -583
- package/src/build/__tests__/partitions.spec.ts +0 -110
- package/src/build/__tests__/workspace-build.spec.ts +0 -215
- package/src/build/bundler.ts +0 -256
- package/src/build/endpoint-analyzer.ts +0 -236
- package/src/build/handler-templates.ts +0 -1253
- package/src/build/index.ts +0 -616
- package/src/build/manifests.ts +0 -285
- package/src/build/partitions.ts +0 -58
- package/src/build/providerResolver.ts +0 -184
- package/src/build/types.ts +0 -104
- package/src/config.ts +0 -330
- package/src/credentials/__tests__/fullDockerPorts.spec.ts +0 -144
- package/src/credentials/__tests__/helpers.ts +0 -112
- package/src/credentials/__tests__/prepareEntryCredentials.spec.ts +0 -125
- package/src/credentials/__tests__/readonlyDockerPorts.spec.ts +0 -190
- package/src/credentials/__tests__/workspaceCredentials.spec.ts +0 -209
- package/src/credentials/index.ts +0 -843
- package/src/debug.ts +0 -68
- package/src/deploy/CachedStateProvider.ts +0 -86
- package/src/deploy/LocalStateProvider.ts +0 -57
- package/src/deploy/SSMStateProvider.ts +0 -117
- package/src/deploy/StateProvider.ts +0 -175
- package/src/deploy/__tests__/CachedStateProvider.spec.ts +0 -235
- package/src/deploy/__tests__/HostingerProvider.spec.ts +0 -347
- package/src/deploy/__tests__/LocalStateProvider.spec.ts +0 -130
- package/src/deploy/__tests__/Route53Provider.spec.ts +0 -425
- package/src/deploy/__tests__/SSMStateProvider.spec.ts +0 -201
- package/src/deploy/__tests__/__fixtures__/entry-apps/async-entry.ts +0 -24
- package/src/deploy/__tests__/__fixtures__/entry-apps/nested-config-entry.ts +0 -24
- package/src/deploy/__tests__/__fixtures__/entry-apps/no-env-entry.ts +0 -12
- package/src/deploy/__tests__/__fixtures__/entry-apps/simple-entry.ts +0 -14
- package/src/deploy/__tests__/__fixtures__/entry-apps/throwing-entry.ts +0 -16
- package/src/deploy/__tests__/__fixtures__/env-parsers/non-function-export.ts +0 -10
- package/src/deploy/__tests__/__fixtures__/env-parsers/optional-env-parser.ts +0 -21
- package/src/deploy/__tests__/__fixtures__/env-parsers/parseable-env-parser.ts +0 -18
- package/src/deploy/__tests__/__fixtures__/env-parsers/throwing-env-parser.ts +0 -16
- package/src/deploy/__tests__/__fixtures__/env-parsers/valid-env-parser.ts +0 -16
- package/src/deploy/__tests__/__fixtures__/route-apps/endpoints/auth.ts +0 -16
- package/src/deploy/__tests__/__fixtures__/route-apps/endpoints/health.ts +0 -13
- package/src/deploy/__tests__/__fixtures__/route-apps/endpoints/users.ts +0 -15
- package/src/deploy/__tests__/__fixtures__/route-apps/services.ts +0 -55
- package/src/deploy/__tests__/backup-provisioner.spec.ts +0 -428
- package/src/deploy/__tests__/createDnsProvider.spec.ts +0 -195
- package/src/deploy/__tests__/createStateProvider.spec.ts +0 -126
- package/src/deploy/__tests__/dns-orchestration.spec.ts +0 -192
- package/src/deploy/__tests__/dns-verification.spec.ts +0 -229
- package/src/deploy/__tests__/docker.spec.ts +0 -149
- package/src/deploy/__tests__/dokploy-api.spec.ts +0 -697
- package/src/deploy/__tests__/dokploy.spec.ts +0 -435
- package/src/deploy/__tests__/domain.spec.ts +0 -235
- package/src/deploy/__tests__/env-resolver.spec.ts +0 -903
- package/src/deploy/__tests__/index.spec.ts +0 -1091
- package/src/deploy/__tests__/init.spec.ts +0 -793
- package/src/deploy/__tests__/secrets.spec.ts +0 -303
- package/src/deploy/__tests__/sniffer.spec.ts +0 -838
- package/src/deploy/__tests__/state-e2e.spec.ts +0 -387
- package/src/deploy/__tests__/state.spec.ts +0 -876
- package/src/deploy/__tests__/undeploy.spec.ts +0 -758
- package/src/deploy/backup-provisioner.ts +0 -316
- package/src/deploy/dns/DnsProvider.ts +0 -201
- package/src/deploy/dns/HostingerProvider.ts +0 -174
- package/src/deploy/dns/Route53Provider.ts +0 -340
- package/src/deploy/dns/hostinger-api.ts +0 -261
- package/src/deploy/dns/index.ts +0 -627
- package/src/deploy/docker.ts +0 -260
- package/src/deploy/dokploy-api.ts +0 -1101
- package/src/deploy/dokploy.ts +0 -177
- package/src/deploy/domain.ts +0 -134
- package/src/deploy/env-resolver.ts +0 -305
- package/src/deploy/index.ts +0 -2094
- package/src/deploy/init.ts +0 -427
- package/src/deploy/secrets.ts +0 -187
- package/src/deploy/sniffer-envkit-patch.ts +0 -61
- package/src/deploy/sniffer-hooks.ts +0 -57
- package/src/deploy/sniffer-loader.ts +0 -28
- package/src/deploy/sniffer-routes-worker.ts +0 -104
- package/src/deploy/sniffer-worker.ts +0 -75
- package/src/deploy/sniffer.ts +0 -578
- package/src/deploy/state-commands.ts +0 -274
- package/src/deploy/state.ts +0 -482
- package/src/deploy/types.ts +0 -102
- package/src/deploy/undeploy.ts +0 -407
- package/src/dev/__tests__/entry-integration.spec.ts +0 -347
- package/src/dev/__tests__/entry.spec.ts +0 -144
- package/src/dev/__tests__/index.spec.ts +0 -2084
- package/src/dev/index.ts +0 -1649
- package/src/docker/__tests__/compose.spec.ts +0 -1142
- package/src/docker/__tests__/templates.spec.ts +0 -694
- package/src/docker/compose.ts +0 -808
- package/src/docker/index.ts +0 -523
- package/src/docker/templates.ts +0 -1067
- package/src/exec/index.ts +0 -118
- package/src/generators/CronGenerator.ts +0 -105
- package/src/generators/EndpointGenerator.ts +0 -954
- package/src/generators/FunctionGenerator.ts +0 -117
- package/src/generators/Generator.ts +0 -147
- package/src/generators/OpenApiTsGenerator.ts +0 -821
- package/src/generators/QueueGenerator.ts +0 -245
- package/src/generators/SubscriberGenerator.ts +0 -282
- package/src/generators/TopicGenerator.ts +0 -45
- package/src/generators/__tests__/CronGenerator.spec.ts +0 -445
- package/src/generators/__tests__/EndpointGenerator.spec.ts +0 -544
- package/src/generators/__tests__/FunctionGenerator.spec.ts +0 -256
- package/src/generators/__tests__/Generator.bustCache.spec.ts +0 -72
- package/src/generators/__tests__/OpenApiTsGenerator.registry.spec.ts +0 -98
- package/src/generators/__tests__/OpenApiTsGenerator.responseType.spec.ts +0 -56
- package/src/generators/__tests__/QueueGenerator.spec.ts +0 -141
- package/src/generators/__tests__/SubscriberGenerator.spec.ts +0 -410
- package/src/generators/index.ts +0 -11
- package/src/index.ts +0 -972
- package/src/init/__tests__/generators.spec.ts +0 -1070
- package/src/init/__tests__/init.spec.ts +0 -577
- package/src/init/__tests__/utils.spec.ts +0 -104
- package/src/init/generators/auth.ts +0 -225
- package/src/init/generators/config.ts +0 -316
- package/src/init/generators/docker.ts +0 -388
- package/src/init/generators/env.ts +0 -62
- package/src/init/generators/index.ts +0 -6
- package/src/init/generators/mobile-expo.ts +0 -576
- package/src/init/generators/models.ts +0 -153
- package/src/init/generators/monorepo.ts +0 -475
- package/src/init/generators/package.ts +0 -95
- package/src/init/generators/source.ts +0 -15
- package/src/init/generators/test.ts +0 -178
- package/src/init/generators/ui.ts +0 -1473
- package/src/init/generators/web-tanstack.ts +0 -348
- package/src/init/generators/web.ts +0 -363
- package/src/init/index.ts +0 -542
- package/src/init/templates/api.ts +0 -404
- package/src/init/templates/index.ts +0 -342
- package/src/init/templates/minimal.ts +0 -207
- package/src/init/templates/serverless.ts +0 -148
- package/src/init/templates/worker.ts +0 -216
- package/src/init/utils.ts +0 -197
- package/src/init/versions.ts +0 -52
- package/src/openapi-react-query.ts +0 -288
- package/src/openapi.ts +0 -259
- package/src/secrets/__tests__/encryption.spec.ts +0 -226
- package/src/secrets/__tests__/generator.spec.ts +0 -575
- package/src/secrets/__tests__/index.spec.ts +0 -91
- package/src/secrets/__tests__/reconcile.spec.ts +0 -123
- package/src/secrets/__tests__/storage.spec.ts +0 -645
- package/src/secrets/encryption.ts +0 -91
- package/src/secrets/generator.ts +0 -329
- package/src/secrets/index.ts +0 -417
- package/src/secrets/keystore.ts +0 -144
- package/src/secrets/reconcile.ts +0 -53
- package/src/secrets/storage.ts +0 -337
- package/src/secrets/sync.ts +0 -136
- package/src/secrets/types.ts +0 -70
- package/src/setup/__tests__/auto-setup.spec.ts +0 -147
- package/src/setup/__tests__/reconcile-secrets.spec.ts +0 -439
- package/src/setup/fullstack-secrets.ts +0 -140
- package/src/setup/index.ts +0 -411
- package/src/test/__tests__/__fixtures__/workspace.ts +0 -104
- package/src/test/__tests__/api.spec.ts +0 -199
- package/src/test/__tests__/auth.spec.ts +0 -162
- package/src/test/__tests__/index.spec.ts +0 -502
- package/src/test/__tests__/web.spec.ts +0 -210
- package/src/test/index.ts +0 -198
- package/src/types.ts +0 -363
- package/src/upgrade/__tests__/index.spec.ts +0 -354
- package/src/upgrade/index.ts +0 -253
- package/src/workspace/__tests__/client-generator.spec.ts +0 -326
- package/src/workspace/__tests__/index.spec.ts +0 -766
- package/src/workspace/__tests__/publicEnv.spec.ts +0 -64
- package/src/workspace/__tests__/schema.spec.ts +0 -737
- package/src/workspace/__tests__/type-inference.spec.ts +0 -251
- package/src/workspace/client-generator.ts +0 -109
- package/src/workspace/index.ts +0 -433
- package/src/workspace/publicEnv.ts +0 -57
- package/src/workspace/schema.ts +0 -861
- package/src/workspace/types.ts +0 -943
- package/tsconfig.json +0 -9
- package/tsdown.config.ts +0 -22
package/src/index.ts
DELETED
|
@@ -1,972 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env -S npx tsx
|
|
2
|
-
|
|
3
|
-
import { Command } from 'commander';
|
|
4
|
-
import pkg from '../package.json';
|
|
5
|
-
import { loginCommand, logoutCommand, whoamiCommand } from './auth';
|
|
6
|
-
import { buildCommand } from './build/index';
|
|
7
|
-
import { enableDebug, formatError } from './debug';
|
|
8
|
-
import { type DeployProvider, deployCommand } from './deploy/index';
|
|
9
|
-
import { deployInitCommand, deployListCommand } from './deploy/init';
|
|
10
|
-
import {
|
|
11
|
-
stateDiffCommand,
|
|
12
|
-
statePullCommand,
|
|
13
|
-
statePushCommand,
|
|
14
|
-
stateShowCommand,
|
|
15
|
-
} from './deploy/state-commands';
|
|
16
|
-
import { devCommand, execCommand } from './dev/index';
|
|
17
|
-
import { type DockerOptions, dockerCommand } from './docker/index';
|
|
18
|
-
import { type InitOptions, initCommand } from './init/index';
|
|
19
|
-
import { openapiCommand } from './openapi';
|
|
20
|
-
import { generateReactQueryCommand } from './openapi-react-query';
|
|
21
|
-
import {
|
|
22
|
-
secretsImportCommand,
|
|
23
|
-
secretsInitCommand,
|
|
24
|
-
secretsRotateCommand,
|
|
25
|
-
secretsSetCommand,
|
|
26
|
-
secretsShowCommand,
|
|
27
|
-
} from './secrets';
|
|
28
|
-
import { type SetupOptions, setupCommand } from './setup/index';
|
|
29
|
-
import { type TestOptions, testCommand } from './test/index';
|
|
30
|
-
import type { ComposeServiceName, LegacyProvider, MainProvider } from './types';
|
|
31
|
-
import { type UpgradeOptions, upgradeCommand } from './upgrade/index';
|
|
32
|
-
|
|
33
|
-
const program = new Command();
|
|
34
|
-
|
|
35
|
-
program
|
|
36
|
-
.name('gkm')
|
|
37
|
-
.description('GeekMidas backend framework CLI')
|
|
38
|
-
.version(pkg.version)
|
|
39
|
-
.option('--cwd <path>', 'Change working directory')
|
|
40
|
-
.option('--debug', 'Enable debug mode (verbose errors with stack traces)')
|
|
41
|
-
.hook('preAction', () => {
|
|
42
|
-
const opts = program.opts();
|
|
43
|
-
if (opts.debug) enableDebug();
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
program
|
|
47
|
-
.command('init')
|
|
48
|
-
.description('Scaffold a new project')
|
|
49
|
-
.argument('[name]', 'Project name')
|
|
50
|
-
.option(
|
|
51
|
-
'--template <template>',
|
|
52
|
-
'Project template (minimal, api, serverless, worker)',
|
|
53
|
-
)
|
|
54
|
-
.option('--skip-install', 'Skip dependency installation', false)
|
|
55
|
-
.option('-y, --yes', 'Skip prompts, use defaults', false)
|
|
56
|
-
.option('--monorepo', 'Setup as monorepo with packages/models', false)
|
|
57
|
-
.option('--api-path <path>', 'API app path in monorepo (default: apps/api)')
|
|
58
|
-
.option('--pm <manager>', 'Package manager (pnpm, npm, yarn, bun)')
|
|
59
|
-
.action(async (name: string | undefined, options: InitOptions) => {
|
|
60
|
-
try {
|
|
61
|
-
const globalOptions = program.opts();
|
|
62
|
-
if (globalOptions.cwd) {
|
|
63
|
-
process.chdir(globalOptions.cwd);
|
|
64
|
-
}
|
|
65
|
-
await initCommand(name, options);
|
|
66
|
-
} catch (error) {
|
|
67
|
-
console.error(formatError(error));
|
|
68
|
-
process.exit(1);
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
program
|
|
73
|
-
.command('setup')
|
|
74
|
-
.description('Setup development environment (secrets, Docker, database)')
|
|
75
|
-
.option('--stage <stage>', 'Stage name', 'development')
|
|
76
|
-
.option('--force', 'Regenerate secrets even if they exist')
|
|
77
|
-
.option('--skip-docker', 'Skip starting Docker services')
|
|
78
|
-
.option('-y, --yes', 'Skip prompts')
|
|
79
|
-
.action(async (options: SetupOptions) => {
|
|
80
|
-
try {
|
|
81
|
-
const globalOptions = program.opts();
|
|
82
|
-
if (globalOptions.cwd) {
|
|
83
|
-
process.chdir(globalOptions.cwd);
|
|
84
|
-
}
|
|
85
|
-
await setupCommand(options);
|
|
86
|
-
} catch (error) {
|
|
87
|
-
console.error(formatError(error));
|
|
88
|
-
process.exit(1);
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
program
|
|
93
|
-
.command('build')
|
|
94
|
-
.description('Build handlers from endpoints, functions, and crons')
|
|
95
|
-
.option(
|
|
96
|
-
'--provider <provider>',
|
|
97
|
-
'Target provider for generated handlers (aws, server)',
|
|
98
|
-
)
|
|
99
|
-
.option(
|
|
100
|
-
'--providers <providers>',
|
|
101
|
-
'[DEPRECATED] Use --provider instead. Target providers for generated handlers (comma-separated)',
|
|
102
|
-
)
|
|
103
|
-
.option(
|
|
104
|
-
'--enable-openapi',
|
|
105
|
-
'Enable OpenAPI documentation generation for server builds',
|
|
106
|
-
)
|
|
107
|
-
.option('--production', 'Build for production (no dev tools, bundled output)')
|
|
108
|
-
.option('--skip-bundle', 'Skip bundling step in production build')
|
|
109
|
-
.option('--stage <stage>', 'Inject encrypted secrets for deployment stage')
|
|
110
|
-
.option(
|
|
111
|
-
'--mark-optional',
|
|
112
|
-
'Suffix optional env vars with ? in manifest envVars field (e.g. PORT?)',
|
|
113
|
-
)
|
|
114
|
-
.action(
|
|
115
|
-
async (options: {
|
|
116
|
-
provider?: string;
|
|
117
|
-
providers?: string;
|
|
118
|
-
enableOpenapi?: boolean;
|
|
119
|
-
production?: boolean;
|
|
120
|
-
skipBundle?: boolean;
|
|
121
|
-
stage?: string;
|
|
122
|
-
markOptional?: boolean;
|
|
123
|
-
}) => {
|
|
124
|
-
try {
|
|
125
|
-
const globalOptions = program.opts();
|
|
126
|
-
if (globalOptions.cwd) {
|
|
127
|
-
process.chdir(globalOptions.cwd);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// Handle new single provider option
|
|
131
|
-
if (options.provider) {
|
|
132
|
-
if (!['aws', 'server'].includes(options.provider)) {
|
|
133
|
-
process.exit(1);
|
|
134
|
-
}
|
|
135
|
-
await buildCommand({
|
|
136
|
-
provider: options.provider as MainProvider,
|
|
137
|
-
enableOpenApi: options.enableOpenapi || false,
|
|
138
|
-
production: options.production || false,
|
|
139
|
-
skipBundle: options.skipBundle || false,
|
|
140
|
-
stage: options.stage,
|
|
141
|
-
markOptional: options.markOptional || false,
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
// Handle legacy providers option
|
|
145
|
-
else if (options.providers) {
|
|
146
|
-
const providerList = [
|
|
147
|
-
...new Set(options.providers.split(',').map((p) => p.trim())),
|
|
148
|
-
] as LegacyProvider[];
|
|
149
|
-
await buildCommand({
|
|
150
|
-
providers: providerList,
|
|
151
|
-
enableOpenApi: options.enableOpenapi || false,
|
|
152
|
-
production: options.production || false,
|
|
153
|
-
skipBundle: options.skipBundle || false,
|
|
154
|
-
stage: options.stage,
|
|
155
|
-
markOptional: options.markOptional || false,
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
// Default to config-driven build
|
|
159
|
-
else {
|
|
160
|
-
await buildCommand({
|
|
161
|
-
enableOpenApi: options.enableOpenapi || false,
|
|
162
|
-
production: options.production || false,
|
|
163
|
-
skipBundle: options.skipBundle || false,
|
|
164
|
-
stage: options.stage,
|
|
165
|
-
markOptional: options.markOptional || false,
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
} catch (error) {
|
|
169
|
-
console.error(formatError(error));
|
|
170
|
-
process.exit(1);
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
);
|
|
174
|
-
|
|
175
|
-
program
|
|
176
|
-
.command('dev')
|
|
177
|
-
.description('Start development server with automatic reload')
|
|
178
|
-
.option('-p, --port <port>', 'Port to run the development server on')
|
|
179
|
-
.option('--entry <file>', 'Entry file to run (bypasses gkm config)')
|
|
180
|
-
.option('--watch', 'Watch for file changes (default: true with --entry)')
|
|
181
|
-
.option('--no-watch', 'Disable file watching')
|
|
182
|
-
.option(
|
|
183
|
-
'--enable-openapi',
|
|
184
|
-
'Enable OpenAPI documentation for development server',
|
|
185
|
-
true,
|
|
186
|
-
)
|
|
187
|
-
.action(
|
|
188
|
-
async (options: {
|
|
189
|
-
port?: string;
|
|
190
|
-
entry?: string;
|
|
191
|
-
watch?: boolean;
|
|
192
|
-
enableOpenapi?: boolean;
|
|
193
|
-
}) => {
|
|
194
|
-
try {
|
|
195
|
-
const globalOptions = program.opts();
|
|
196
|
-
if (globalOptions.cwd) {
|
|
197
|
-
process.chdir(globalOptions.cwd);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
await devCommand({
|
|
201
|
-
port: options.port ? Number.parseInt(options.port, 10) : 3000,
|
|
202
|
-
portExplicit: !!options.port,
|
|
203
|
-
enableOpenApi: options.enableOpenapi ?? true,
|
|
204
|
-
entry: options.entry,
|
|
205
|
-
watch: options.watch,
|
|
206
|
-
});
|
|
207
|
-
} catch (error) {
|
|
208
|
-
console.error(formatError(error));
|
|
209
|
-
process.exit(1);
|
|
210
|
-
}
|
|
211
|
-
},
|
|
212
|
-
);
|
|
213
|
-
|
|
214
|
-
program
|
|
215
|
-
.command('exec')
|
|
216
|
-
.description('Run a command with secrets injected into Credentials')
|
|
217
|
-
.argument('<command...>', 'Command to run (use -- before command)')
|
|
218
|
-
.action(async (commandArgs: string[]) => {
|
|
219
|
-
try {
|
|
220
|
-
const globalOptions = program.opts();
|
|
221
|
-
if (globalOptions.cwd) {
|
|
222
|
-
process.chdir(globalOptions.cwd);
|
|
223
|
-
}
|
|
224
|
-
await execCommand(commandArgs);
|
|
225
|
-
} catch (error) {
|
|
226
|
-
console.error(formatError(error));
|
|
227
|
-
process.exit(1);
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
program
|
|
232
|
-
.command('test')
|
|
233
|
-
.description('Run tests with secrets loaded from environment')
|
|
234
|
-
.option('--stage <stage>', 'Stage to load secrets from', 'development')
|
|
235
|
-
.option('--run', 'Run tests once without watch mode')
|
|
236
|
-
.option('--watch', 'Enable watch mode')
|
|
237
|
-
.option('--coverage', 'Generate coverage report')
|
|
238
|
-
.option('--ui', 'Open Vitest UI')
|
|
239
|
-
.option(
|
|
240
|
-
'--auto-setup',
|
|
241
|
-
'Generate a fresh stage (secrets + key) from the workspace config when none exists (for CI; also via GKM_AUTO_SETUP)',
|
|
242
|
-
)
|
|
243
|
-
.argument('[pattern]', 'Pattern to filter tests')
|
|
244
|
-
.action(async (pattern: string | undefined, options: TestOptions) => {
|
|
245
|
-
try {
|
|
246
|
-
const globalOptions = program.opts();
|
|
247
|
-
if (globalOptions.cwd) {
|
|
248
|
-
process.chdir(globalOptions.cwd);
|
|
249
|
-
}
|
|
250
|
-
await testCommand({ ...options, pattern });
|
|
251
|
-
} catch (error) {
|
|
252
|
-
console.error(formatError(error));
|
|
253
|
-
process.exit(1);
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
|
|
257
|
-
program
|
|
258
|
-
.command('cron')
|
|
259
|
-
.description('Manage cron jobs')
|
|
260
|
-
.action(() => {
|
|
261
|
-
const globalOptions = program.opts();
|
|
262
|
-
if (globalOptions.cwd) {
|
|
263
|
-
process.chdir(globalOptions.cwd);
|
|
264
|
-
}
|
|
265
|
-
process.stdout.write('Cron management - coming soon\n');
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
program
|
|
269
|
-
.command('function')
|
|
270
|
-
.description('Manage serverless functions')
|
|
271
|
-
.action(() => {
|
|
272
|
-
const globalOptions = program.opts();
|
|
273
|
-
if (globalOptions.cwd) {
|
|
274
|
-
process.chdir(globalOptions.cwd);
|
|
275
|
-
}
|
|
276
|
-
process.stdout.write('Serverless function management - coming soon\n');
|
|
277
|
-
});
|
|
278
|
-
|
|
279
|
-
program
|
|
280
|
-
.command('api')
|
|
281
|
-
.description('Manage REST API endpoints')
|
|
282
|
-
.action(() => {
|
|
283
|
-
const globalOptions = program.opts();
|
|
284
|
-
if (globalOptions.cwd) {
|
|
285
|
-
process.chdir(globalOptions.cwd);
|
|
286
|
-
}
|
|
287
|
-
process.stdout.write('REST API management - coming soon\n');
|
|
288
|
-
});
|
|
289
|
-
|
|
290
|
-
program
|
|
291
|
-
.command('openapi')
|
|
292
|
-
.description('Generate OpenAPI specification from endpoints')
|
|
293
|
-
.option(
|
|
294
|
-
'--app <name>',
|
|
295
|
-
'Workspace mode: generate for a single named backend app',
|
|
296
|
-
)
|
|
297
|
-
.action(async (options: { app?: string }) => {
|
|
298
|
-
try {
|
|
299
|
-
const globalOptions = program.opts();
|
|
300
|
-
if (globalOptions.cwd) {
|
|
301
|
-
process.chdir(globalOptions.cwd);
|
|
302
|
-
}
|
|
303
|
-
await openapiCommand({ app: options.app });
|
|
304
|
-
} catch (error) {
|
|
305
|
-
console.error(formatError(error));
|
|
306
|
-
process.exit(1);
|
|
307
|
-
}
|
|
308
|
-
});
|
|
309
|
-
|
|
310
|
-
program
|
|
311
|
-
.command('generate:react-query')
|
|
312
|
-
.description('Generate React Query hooks from OpenAPI specification')
|
|
313
|
-
.option('--input <path>', 'Input OpenAPI spec file path', 'openapi.json')
|
|
314
|
-
.option(
|
|
315
|
-
'--output <path>',
|
|
316
|
-
'Output file path for generated hooks',
|
|
317
|
-
'src/api/hooks.ts',
|
|
318
|
-
)
|
|
319
|
-
.option('--name <name>', 'API name prefix for generated code', 'API')
|
|
320
|
-
.action(
|
|
321
|
-
async (options: { input?: string; output?: string; name?: string }) => {
|
|
322
|
-
try {
|
|
323
|
-
const globalOptions = program.opts();
|
|
324
|
-
if (globalOptions.cwd) {
|
|
325
|
-
process.chdir(globalOptions.cwd);
|
|
326
|
-
}
|
|
327
|
-
await generateReactQueryCommand(options);
|
|
328
|
-
} catch (error) {
|
|
329
|
-
console.error(formatError(error));
|
|
330
|
-
process.exit(1);
|
|
331
|
-
}
|
|
332
|
-
},
|
|
333
|
-
);
|
|
334
|
-
|
|
335
|
-
program
|
|
336
|
-
.command('docker')
|
|
337
|
-
.description('Generate Docker deployment files')
|
|
338
|
-
.option('--build', 'Build Docker image after generating files')
|
|
339
|
-
.option('--push', 'Push image to registry after building')
|
|
340
|
-
.option('--tag <tag>', 'Image tag', 'latest')
|
|
341
|
-
.option('--registry <registry>', 'Container registry URL')
|
|
342
|
-
.option('--slim', 'Use slim Dockerfile (assumes pre-built bundle exists)')
|
|
343
|
-
.option('--turbo', 'Use turbo prune for monorepo optimization')
|
|
344
|
-
.option('--turbo-package <name>', 'Package name for turbo prune')
|
|
345
|
-
.action(async (options: DockerOptions) => {
|
|
346
|
-
try {
|
|
347
|
-
const globalOptions = program.opts();
|
|
348
|
-
if (globalOptions.cwd) {
|
|
349
|
-
process.chdir(globalOptions.cwd);
|
|
350
|
-
}
|
|
351
|
-
await dockerCommand(options);
|
|
352
|
-
} catch (error) {
|
|
353
|
-
console.error(formatError(error));
|
|
354
|
-
process.exit(1);
|
|
355
|
-
}
|
|
356
|
-
});
|
|
357
|
-
|
|
358
|
-
program
|
|
359
|
-
.command('prepack')
|
|
360
|
-
.description('Generate Docker files for production deployment')
|
|
361
|
-
.option('--build', 'Build Docker image after generating files')
|
|
362
|
-
.option('--push', 'Push image to registry after building')
|
|
363
|
-
.option('--tag <tag>', 'Image tag', 'latest')
|
|
364
|
-
.option('--registry <registry>', 'Container registry URL')
|
|
365
|
-
.option('--slim', 'Build locally first, then use slim Dockerfile')
|
|
366
|
-
.option('--skip-bundle', 'Skip bundling step (only with --slim)')
|
|
367
|
-
.option('--turbo', 'Use turbo prune for monorepo optimization')
|
|
368
|
-
.option('--turbo-package <name>', 'Package name for turbo prune')
|
|
369
|
-
.action(
|
|
370
|
-
async (options: {
|
|
371
|
-
build?: boolean;
|
|
372
|
-
push?: boolean;
|
|
373
|
-
tag?: string;
|
|
374
|
-
registry?: string;
|
|
375
|
-
slim?: boolean;
|
|
376
|
-
skipBundle?: boolean;
|
|
377
|
-
turbo?: boolean;
|
|
378
|
-
turboPackage?: string;
|
|
379
|
-
}) => {
|
|
380
|
-
try {
|
|
381
|
-
const globalOptions = program.opts();
|
|
382
|
-
if (globalOptions.cwd) {
|
|
383
|
-
process.chdir(globalOptions.cwd);
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
if (options.slim) {
|
|
387
|
-
await buildCommand({
|
|
388
|
-
provider: 'server',
|
|
389
|
-
production: true,
|
|
390
|
-
skipBundle: options.skipBundle,
|
|
391
|
-
});
|
|
392
|
-
}
|
|
393
|
-
await dockerCommand({
|
|
394
|
-
build: options.build,
|
|
395
|
-
push: options.push,
|
|
396
|
-
tag: options.tag,
|
|
397
|
-
registry: options.registry,
|
|
398
|
-
slim: options.slim,
|
|
399
|
-
turbo: options.turbo,
|
|
400
|
-
turboPackage: options.turboPackage,
|
|
401
|
-
});
|
|
402
|
-
if (options.slim) {
|
|
403
|
-
} else {
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
if (options.build) {
|
|
407
|
-
const tag = options.tag ?? 'latest';
|
|
408
|
-
const registry = options.registry;
|
|
409
|
-
const _imageRef = registry ? `${registry}/api:${tag}` : `api:${tag}`;
|
|
410
|
-
}
|
|
411
|
-
} catch (error) {
|
|
412
|
-
console.error(formatError(error));
|
|
413
|
-
process.exit(1);
|
|
414
|
-
}
|
|
415
|
-
},
|
|
416
|
-
);
|
|
417
|
-
|
|
418
|
-
// Secrets management commands
|
|
419
|
-
program
|
|
420
|
-
.command('secrets:init')
|
|
421
|
-
.description('Initialize secrets for a deployment stage')
|
|
422
|
-
.requiredOption('--stage <stage>', 'Stage name (e.g., production, staging)')
|
|
423
|
-
.option('--force', 'Overwrite existing secrets')
|
|
424
|
-
.action(async (options: { stage: string; force?: boolean }) => {
|
|
425
|
-
try {
|
|
426
|
-
const globalOptions = program.opts();
|
|
427
|
-
if (globalOptions.cwd) {
|
|
428
|
-
process.chdir(globalOptions.cwd);
|
|
429
|
-
}
|
|
430
|
-
await secretsInitCommand(options);
|
|
431
|
-
} catch (error) {
|
|
432
|
-
console.error(formatError(error));
|
|
433
|
-
process.exit(1);
|
|
434
|
-
}
|
|
435
|
-
});
|
|
436
|
-
|
|
437
|
-
program
|
|
438
|
-
.command('secrets:set')
|
|
439
|
-
.description('Set a custom secret for a stage')
|
|
440
|
-
.argument('<key>', 'Secret key (e.g., API_KEY)')
|
|
441
|
-
.argument('[value]', 'Secret value (reads from stdin if omitted)')
|
|
442
|
-
.requiredOption('--stage <stage>', 'Stage name')
|
|
443
|
-
.action(
|
|
444
|
-
async (
|
|
445
|
-
key: string,
|
|
446
|
-
value: string | undefined,
|
|
447
|
-
options: { stage: string },
|
|
448
|
-
) => {
|
|
449
|
-
try {
|
|
450
|
-
const globalOptions = program.opts();
|
|
451
|
-
if (globalOptions.cwd) {
|
|
452
|
-
process.chdir(globalOptions.cwd);
|
|
453
|
-
}
|
|
454
|
-
await secretsSetCommand(key, value, options);
|
|
455
|
-
} catch (error) {
|
|
456
|
-
console.error(formatError(error));
|
|
457
|
-
process.exit(1);
|
|
458
|
-
}
|
|
459
|
-
},
|
|
460
|
-
);
|
|
461
|
-
|
|
462
|
-
program
|
|
463
|
-
.command('secrets:show')
|
|
464
|
-
.description('Show secrets for a stage')
|
|
465
|
-
.requiredOption('--stage <stage>', 'Stage name')
|
|
466
|
-
.option('--reveal', 'Show actual secret values (not masked)')
|
|
467
|
-
.action(async (options: { stage: string; reveal?: boolean }) => {
|
|
468
|
-
try {
|
|
469
|
-
const globalOptions = program.opts();
|
|
470
|
-
if (globalOptions.cwd) {
|
|
471
|
-
process.chdir(globalOptions.cwd);
|
|
472
|
-
}
|
|
473
|
-
await secretsShowCommand(options);
|
|
474
|
-
} catch (error) {
|
|
475
|
-
console.error(formatError(error));
|
|
476
|
-
process.exit(1);
|
|
477
|
-
}
|
|
478
|
-
});
|
|
479
|
-
|
|
480
|
-
program
|
|
481
|
-
.command('secrets:rotate')
|
|
482
|
-
.description('Rotate service passwords')
|
|
483
|
-
.requiredOption('--stage <stage>', 'Stage name')
|
|
484
|
-
.option(
|
|
485
|
-
'--service <service>',
|
|
486
|
-
'Specific service to rotate (postgres, redis, rabbitmq)',
|
|
487
|
-
)
|
|
488
|
-
.action(async (options: { stage: string; service?: ComposeServiceName }) => {
|
|
489
|
-
try {
|
|
490
|
-
const globalOptions = program.opts();
|
|
491
|
-
if (globalOptions.cwd) {
|
|
492
|
-
process.chdir(globalOptions.cwd);
|
|
493
|
-
}
|
|
494
|
-
await secretsRotateCommand(options);
|
|
495
|
-
} catch (error) {
|
|
496
|
-
console.error(formatError(error));
|
|
497
|
-
process.exit(1);
|
|
498
|
-
}
|
|
499
|
-
});
|
|
500
|
-
|
|
501
|
-
program
|
|
502
|
-
.command('secrets:import')
|
|
503
|
-
.description('Import secrets from a JSON file')
|
|
504
|
-
.argument('<file>', 'JSON file path (e.g., secrets.json)')
|
|
505
|
-
.requiredOption('--stage <stage>', 'Stage name')
|
|
506
|
-
.option('--no-merge', 'Replace all custom secrets instead of merging')
|
|
507
|
-
.action(async (file: string, options: { stage: string; merge?: boolean }) => {
|
|
508
|
-
try {
|
|
509
|
-
const globalOptions = program.opts();
|
|
510
|
-
if (globalOptions.cwd) {
|
|
511
|
-
process.chdir(globalOptions.cwd);
|
|
512
|
-
}
|
|
513
|
-
await secretsImportCommand(file, options);
|
|
514
|
-
} catch (error) {
|
|
515
|
-
console.error(formatError(error));
|
|
516
|
-
process.exit(1);
|
|
517
|
-
}
|
|
518
|
-
});
|
|
519
|
-
|
|
520
|
-
program
|
|
521
|
-
.command('secrets:push')
|
|
522
|
-
.description('Push secrets to remote provider (SSM)')
|
|
523
|
-
.requiredOption('--stage <stage>', 'Stage name')
|
|
524
|
-
.action(async (options: { stage: string }) => {
|
|
525
|
-
try {
|
|
526
|
-
const globalOptions = program.opts();
|
|
527
|
-
if (globalOptions.cwd) {
|
|
528
|
-
process.chdir(globalOptions.cwd);
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
const { loadWorkspaceConfig } = await import('./config');
|
|
532
|
-
const { pushSecrets } = await import('./secrets/sync');
|
|
533
|
-
const { reconcileMissingSecrets } = await import('./secrets/reconcile');
|
|
534
|
-
const { readStageSecrets, writeStageSecrets } = await import(
|
|
535
|
-
'./secrets/storage'
|
|
536
|
-
);
|
|
537
|
-
|
|
538
|
-
const { workspace } = await loadWorkspaceConfig();
|
|
539
|
-
|
|
540
|
-
const secrets = await readStageSecrets(options.stage, workspace.root);
|
|
541
|
-
if (secrets) {
|
|
542
|
-
const result = reconcileMissingSecrets(secrets, workspace);
|
|
543
|
-
if (result) {
|
|
544
|
-
await writeStageSecrets(result.secrets, workspace.root);
|
|
545
|
-
console.log(
|
|
546
|
-
` Reconciled ${result.addedKeys.length} missing secret(s):`,
|
|
547
|
-
);
|
|
548
|
-
for (const key of result.addedKeys) {
|
|
549
|
-
console.log(` + ${key}`);
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
await pushSecrets(options.stage, workspace);
|
|
555
|
-
console.log(`\n✓ Secrets pushed for stage "${options.stage}"`);
|
|
556
|
-
} catch (error) {
|
|
557
|
-
console.error(formatError(error));
|
|
558
|
-
process.exit(1);
|
|
559
|
-
}
|
|
560
|
-
});
|
|
561
|
-
|
|
562
|
-
program
|
|
563
|
-
.command('secrets:pull')
|
|
564
|
-
.description('Pull secrets from remote provider (SSM)')
|
|
565
|
-
.requiredOption('--stage <stage>', 'Stage name')
|
|
566
|
-
.action(async (options: { stage: string }) => {
|
|
567
|
-
try {
|
|
568
|
-
const globalOptions = program.opts();
|
|
569
|
-
if (globalOptions.cwd) {
|
|
570
|
-
process.chdir(globalOptions.cwd);
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
const { loadWorkspaceConfig } = await import('./config');
|
|
574
|
-
const { pullSecrets } = await import('./secrets/sync');
|
|
575
|
-
const { writeStageSecrets } = await import('./secrets/storage');
|
|
576
|
-
const { reconcileMissingSecrets } = await import('./secrets/reconcile');
|
|
577
|
-
|
|
578
|
-
const { workspace } = await loadWorkspaceConfig();
|
|
579
|
-
let secrets = await pullSecrets(options.stage, workspace);
|
|
580
|
-
|
|
581
|
-
if (!secrets) {
|
|
582
|
-
console.error(`No remote secrets found for stage "${options.stage}".`);
|
|
583
|
-
process.exit(1);
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
const result = reconcileMissingSecrets(secrets, workspace);
|
|
587
|
-
if (result) {
|
|
588
|
-
secrets = result.secrets;
|
|
589
|
-
console.log(
|
|
590
|
-
` Reconciled ${result.addedKeys.length} missing secret(s):`,
|
|
591
|
-
);
|
|
592
|
-
for (const key of result.addedKeys) {
|
|
593
|
-
console.log(` + ${key}`);
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
await writeStageSecrets(secrets, workspace.root);
|
|
598
|
-
console.log(`\n✓ Secrets pulled for stage "${options.stage}"`);
|
|
599
|
-
} catch (error) {
|
|
600
|
-
console.error(formatError(error));
|
|
601
|
-
process.exit(1);
|
|
602
|
-
}
|
|
603
|
-
});
|
|
604
|
-
|
|
605
|
-
program
|
|
606
|
-
.command('secrets:reconcile')
|
|
607
|
-
.description('Backfill missing custom secrets from workspace config')
|
|
608
|
-
.option('--stage <stage>', 'Stage name', 'development')
|
|
609
|
-
.action(async (options: { stage: string }) => {
|
|
610
|
-
try {
|
|
611
|
-
const globalOptions = program.opts();
|
|
612
|
-
if (globalOptions.cwd) {
|
|
613
|
-
process.chdir(globalOptions.cwd);
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
const { loadWorkspaceConfig } = await import('./config');
|
|
617
|
-
const { reconcileMissingSecrets } = await import('./secrets/reconcile');
|
|
618
|
-
const { readStageSecrets, writeStageSecrets } = await import(
|
|
619
|
-
'./secrets/storage'
|
|
620
|
-
);
|
|
621
|
-
|
|
622
|
-
const { workspace } = await loadWorkspaceConfig();
|
|
623
|
-
const secrets = await readStageSecrets(options.stage, workspace.root);
|
|
624
|
-
|
|
625
|
-
if (!secrets) {
|
|
626
|
-
console.error(
|
|
627
|
-
`No secrets found for stage "${options.stage}". Run "gkm secrets:init --stage ${options.stage}" first.`,
|
|
628
|
-
);
|
|
629
|
-
process.exit(1);
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
const result = reconcileMissingSecrets(secrets, workspace);
|
|
633
|
-
|
|
634
|
-
if (!result) {
|
|
635
|
-
console.log(`\n✓ Secrets for stage "${options.stage}" are up-to-date`);
|
|
636
|
-
return;
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
await writeStageSecrets(result.secrets, workspace.root);
|
|
640
|
-
console.log(
|
|
641
|
-
`\n✓ Reconciled ${result.addedKeys.length} missing secret(s) for stage "${options.stage}":`,
|
|
642
|
-
);
|
|
643
|
-
for (const key of result.addedKeys) {
|
|
644
|
-
console.log(` + ${key}`);
|
|
645
|
-
}
|
|
646
|
-
} catch (error) {
|
|
647
|
-
console.error(formatError(error));
|
|
648
|
-
process.exit(1);
|
|
649
|
-
}
|
|
650
|
-
});
|
|
651
|
-
|
|
652
|
-
// Deploy command
|
|
653
|
-
program
|
|
654
|
-
.command('deploy')
|
|
655
|
-
.description('Deploy application to a provider')
|
|
656
|
-
.requiredOption(
|
|
657
|
-
'--provider <provider>',
|
|
658
|
-
'Deploy provider (docker, dokploy, aws-lambda)',
|
|
659
|
-
)
|
|
660
|
-
.requiredOption(
|
|
661
|
-
'--stage <stage>',
|
|
662
|
-
'Deployment stage (e.g., production, staging)',
|
|
663
|
-
)
|
|
664
|
-
.option('--tag <tag>', 'Image tag (default: stage-timestamp)')
|
|
665
|
-
.option('--skip-push', 'Skip pushing image to registry')
|
|
666
|
-
.option('--skip-build', 'Skip build step (use existing build)')
|
|
667
|
-
.action(
|
|
668
|
-
async (options: {
|
|
669
|
-
provider: string;
|
|
670
|
-
stage: string;
|
|
671
|
-
tag?: string;
|
|
672
|
-
skipPush?: boolean;
|
|
673
|
-
skipBuild?: boolean;
|
|
674
|
-
}) => {
|
|
675
|
-
try {
|
|
676
|
-
const globalOptions = program.opts();
|
|
677
|
-
if (globalOptions.cwd) {
|
|
678
|
-
process.chdir(globalOptions.cwd);
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
const validProviders = ['docker', 'dokploy', 'aws-lambda'];
|
|
682
|
-
if (!validProviders.includes(options.provider)) {
|
|
683
|
-
console.error(
|
|
684
|
-
`Invalid provider: ${options.provider}\n` +
|
|
685
|
-
`Valid providers: ${validProviders.join(', ')}`,
|
|
686
|
-
);
|
|
687
|
-
process.exit(1);
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
await deployCommand({
|
|
691
|
-
provider: options.provider as DeployProvider,
|
|
692
|
-
stage: options.stage,
|
|
693
|
-
tag: options.tag,
|
|
694
|
-
skipPush: options.skipPush,
|
|
695
|
-
skipBuild: options.skipBuild,
|
|
696
|
-
});
|
|
697
|
-
} catch (error) {
|
|
698
|
-
console.error(formatError(error));
|
|
699
|
-
process.exit(1);
|
|
700
|
-
}
|
|
701
|
-
},
|
|
702
|
-
);
|
|
703
|
-
|
|
704
|
-
// Deploy init command - Initialize Dokploy project and application
|
|
705
|
-
program
|
|
706
|
-
.command('deploy:init')
|
|
707
|
-
.description('Initialize Dokploy deployment (create project and application)')
|
|
708
|
-
.option(
|
|
709
|
-
'--endpoint <url>',
|
|
710
|
-
'Dokploy server URL (uses stored credentials if logged in)',
|
|
711
|
-
)
|
|
712
|
-
.requiredOption('--project <name>', 'Project name (creates if not exists)')
|
|
713
|
-
.requiredOption('--app <name>', 'Application name')
|
|
714
|
-
.option('--project-id <id>', 'Use existing project ID instead of creating')
|
|
715
|
-
.option('--registry-id <id>', 'Configure registry for the application')
|
|
716
|
-
.action(
|
|
717
|
-
async (options: {
|
|
718
|
-
endpoint?: string;
|
|
719
|
-
project: string;
|
|
720
|
-
app: string;
|
|
721
|
-
projectId?: string;
|
|
722
|
-
registryId?: string;
|
|
723
|
-
}) => {
|
|
724
|
-
try {
|
|
725
|
-
const globalOptions = program.opts();
|
|
726
|
-
if (globalOptions.cwd) {
|
|
727
|
-
process.chdir(globalOptions.cwd);
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
await deployInitCommand({
|
|
731
|
-
endpoint: options.endpoint,
|
|
732
|
-
projectName: options.project,
|
|
733
|
-
appName: options.app,
|
|
734
|
-
projectId: options.projectId,
|
|
735
|
-
registryId: options.registryId,
|
|
736
|
-
});
|
|
737
|
-
} catch (error) {
|
|
738
|
-
console.error(formatError(error));
|
|
739
|
-
process.exit(1);
|
|
740
|
-
}
|
|
741
|
-
},
|
|
742
|
-
);
|
|
743
|
-
|
|
744
|
-
// Deploy list command - List Dokploy resources
|
|
745
|
-
program
|
|
746
|
-
.command('deploy:list')
|
|
747
|
-
.description('List Dokploy resources (projects, registries)')
|
|
748
|
-
.option(
|
|
749
|
-
'--endpoint <url>',
|
|
750
|
-
'Dokploy server URL (uses stored credentials if logged in)',
|
|
751
|
-
)
|
|
752
|
-
.option('--projects', 'List projects')
|
|
753
|
-
.option('--registries', 'List registries')
|
|
754
|
-
.action(
|
|
755
|
-
async (options: {
|
|
756
|
-
endpoint?: string;
|
|
757
|
-
projects?: boolean;
|
|
758
|
-
registries?: boolean;
|
|
759
|
-
}) => {
|
|
760
|
-
try {
|
|
761
|
-
const globalOptions = program.opts();
|
|
762
|
-
if (globalOptions.cwd) {
|
|
763
|
-
process.chdir(globalOptions.cwd);
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
if (options.projects) {
|
|
767
|
-
await deployListCommand({
|
|
768
|
-
endpoint: options.endpoint,
|
|
769
|
-
resource: 'projects',
|
|
770
|
-
});
|
|
771
|
-
}
|
|
772
|
-
if (options.registries) {
|
|
773
|
-
await deployListCommand({
|
|
774
|
-
endpoint: options.endpoint,
|
|
775
|
-
resource: 'registries',
|
|
776
|
-
});
|
|
777
|
-
}
|
|
778
|
-
if (!options.projects && !options.registries) {
|
|
779
|
-
// Default to listing both
|
|
780
|
-
await deployListCommand({
|
|
781
|
-
endpoint: options.endpoint,
|
|
782
|
-
resource: 'projects',
|
|
783
|
-
});
|
|
784
|
-
await deployListCommand({
|
|
785
|
-
endpoint: options.endpoint,
|
|
786
|
-
resource: 'registries',
|
|
787
|
-
});
|
|
788
|
-
}
|
|
789
|
-
} catch (error) {
|
|
790
|
-
console.error(formatError(error));
|
|
791
|
-
process.exit(1);
|
|
792
|
-
}
|
|
793
|
-
},
|
|
794
|
-
);
|
|
795
|
-
|
|
796
|
-
// Login command
|
|
797
|
-
program
|
|
798
|
-
.command('login')
|
|
799
|
-
.description('Authenticate with a deployment service')
|
|
800
|
-
.option('--service <service>', 'Service to login to (dokploy)', 'dokploy')
|
|
801
|
-
.option('--token <token>', 'API token (will prompt if not provided)')
|
|
802
|
-
.option('--endpoint <url>', 'Service endpoint URL')
|
|
803
|
-
.action(
|
|
804
|
-
async (options: { service: string; token?: string; endpoint?: string }) => {
|
|
805
|
-
try {
|
|
806
|
-
const globalOptions = program.opts();
|
|
807
|
-
if (globalOptions.cwd) {
|
|
808
|
-
process.chdir(globalOptions.cwd);
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
if (options.service !== 'dokploy') {
|
|
812
|
-
console.error(
|
|
813
|
-
`Unknown service: ${options.service}. Supported: dokploy`,
|
|
814
|
-
);
|
|
815
|
-
process.exit(1);
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
await loginCommand({
|
|
819
|
-
service: options.service as 'dokploy',
|
|
820
|
-
token: options.token,
|
|
821
|
-
endpoint: options.endpoint,
|
|
822
|
-
});
|
|
823
|
-
} catch (error) {
|
|
824
|
-
console.error(formatError(error));
|
|
825
|
-
process.exit(1);
|
|
826
|
-
}
|
|
827
|
-
},
|
|
828
|
-
);
|
|
829
|
-
|
|
830
|
-
// Logout command
|
|
831
|
-
program
|
|
832
|
-
.command('logout')
|
|
833
|
-
.description('Remove stored credentials')
|
|
834
|
-
.option(
|
|
835
|
-
'--service <service>',
|
|
836
|
-
'Service to logout from (dokploy, all)',
|
|
837
|
-
'dokploy',
|
|
838
|
-
)
|
|
839
|
-
.action(async (options: { service: string }) => {
|
|
840
|
-
try {
|
|
841
|
-
const globalOptions = program.opts();
|
|
842
|
-
if (globalOptions.cwd) {
|
|
843
|
-
process.chdir(globalOptions.cwd);
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
await logoutCommand({
|
|
847
|
-
service: options.service as 'dokploy' | 'all',
|
|
848
|
-
});
|
|
849
|
-
} catch (error) {
|
|
850
|
-
console.error(formatError(error));
|
|
851
|
-
process.exit(1);
|
|
852
|
-
}
|
|
853
|
-
});
|
|
854
|
-
|
|
855
|
-
// Whoami command
|
|
856
|
-
program
|
|
857
|
-
.command('whoami')
|
|
858
|
-
.description('Show current authentication status')
|
|
859
|
-
.action(async () => {
|
|
860
|
-
try {
|
|
861
|
-
const globalOptions = program.opts();
|
|
862
|
-
if (globalOptions.cwd) {
|
|
863
|
-
process.chdir(globalOptions.cwd);
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
await whoamiCommand();
|
|
867
|
-
} catch (error) {
|
|
868
|
-
console.error(formatError(error));
|
|
869
|
-
process.exit(1);
|
|
870
|
-
}
|
|
871
|
-
});
|
|
872
|
-
|
|
873
|
-
// State management commands
|
|
874
|
-
program
|
|
875
|
-
.command('state:pull')
|
|
876
|
-
.description('Pull deployment state from remote to local')
|
|
877
|
-
.requiredOption(
|
|
878
|
-
'--stage <stage>',
|
|
879
|
-
'Deployment stage (e.g., production, staging)',
|
|
880
|
-
)
|
|
881
|
-
.action(async (options: { stage: string }) => {
|
|
882
|
-
try {
|
|
883
|
-
const globalOptions = program.opts();
|
|
884
|
-
if (globalOptions.cwd) {
|
|
885
|
-
process.chdir(globalOptions.cwd);
|
|
886
|
-
}
|
|
887
|
-
await statePullCommand(options);
|
|
888
|
-
} catch (error) {
|
|
889
|
-
console.error(formatError(error));
|
|
890
|
-
process.exit(1);
|
|
891
|
-
}
|
|
892
|
-
});
|
|
893
|
-
|
|
894
|
-
program
|
|
895
|
-
.command('state:push')
|
|
896
|
-
.description('Push deployment state from local to remote')
|
|
897
|
-
.requiredOption(
|
|
898
|
-
'--stage <stage>',
|
|
899
|
-
'Deployment stage (e.g., production, staging)',
|
|
900
|
-
)
|
|
901
|
-
.action(async (options: { stage: string }) => {
|
|
902
|
-
try {
|
|
903
|
-
const globalOptions = program.opts();
|
|
904
|
-
if (globalOptions.cwd) {
|
|
905
|
-
process.chdir(globalOptions.cwd);
|
|
906
|
-
}
|
|
907
|
-
await statePushCommand(options);
|
|
908
|
-
} catch (error) {
|
|
909
|
-
console.error(formatError(error));
|
|
910
|
-
process.exit(1);
|
|
911
|
-
}
|
|
912
|
-
});
|
|
913
|
-
|
|
914
|
-
program
|
|
915
|
-
.command('state:show')
|
|
916
|
-
.description('Show deployment state for a stage')
|
|
917
|
-
.requiredOption(
|
|
918
|
-
'--stage <stage>',
|
|
919
|
-
'Deployment stage (e.g., production, staging)',
|
|
920
|
-
)
|
|
921
|
-
.option('--json', 'Output as JSON')
|
|
922
|
-
.action(async (options: { stage: string; json?: boolean }) => {
|
|
923
|
-
try {
|
|
924
|
-
const globalOptions = program.opts();
|
|
925
|
-
if (globalOptions.cwd) {
|
|
926
|
-
process.chdir(globalOptions.cwd);
|
|
927
|
-
}
|
|
928
|
-
await stateShowCommand(options);
|
|
929
|
-
} catch (error) {
|
|
930
|
-
console.error(formatError(error));
|
|
931
|
-
process.exit(1);
|
|
932
|
-
}
|
|
933
|
-
});
|
|
934
|
-
|
|
935
|
-
program
|
|
936
|
-
.command('state:diff')
|
|
937
|
-
.description('Compare local and remote deployment state')
|
|
938
|
-
.requiredOption(
|
|
939
|
-
'--stage <stage>',
|
|
940
|
-
'Deployment stage (e.g., production, staging)',
|
|
941
|
-
)
|
|
942
|
-
.action(async (options: { stage: string }) => {
|
|
943
|
-
try {
|
|
944
|
-
const globalOptions = program.opts();
|
|
945
|
-
if (globalOptions.cwd) {
|
|
946
|
-
process.chdir(globalOptions.cwd);
|
|
947
|
-
}
|
|
948
|
-
await stateDiffCommand(options);
|
|
949
|
-
} catch (error) {
|
|
950
|
-
console.error(formatError(error));
|
|
951
|
-
process.exit(1);
|
|
952
|
-
}
|
|
953
|
-
});
|
|
954
|
-
|
|
955
|
-
program
|
|
956
|
-
.command('upgrade')
|
|
957
|
-
.description('Upgrade all @geekmidas packages to their latest versions')
|
|
958
|
-
.option('--dry-run', 'Show what would be upgraded without making changes')
|
|
959
|
-
.action(async (options: UpgradeOptions) => {
|
|
960
|
-
try {
|
|
961
|
-
const globalOptions = program.opts();
|
|
962
|
-
if (globalOptions.cwd) {
|
|
963
|
-
process.chdir(globalOptions.cwd);
|
|
964
|
-
}
|
|
965
|
-
await upgradeCommand(options);
|
|
966
|
-
} catch (error) {
|
|
967
|
-
console.error(formatError(error));
|
|
968
|
-
process.exit(1);
|
|
969
|
-
}
|
|
970
|
-
});
|
|
971
|
-
|
|
972
|
-
program.parse();
|