@tdk-landscape/tdk-cli-core 1.3.49 → 1.3.50
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/.claude/skills/layer-autoresearch/SKILL.md +48 -0
- package/.claude/skills/tdk-troubleshoot/SKILL.md +222 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +40 -0
- package/.github/ISSUE_TEMPLATE/config.yml +8 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +18 -0
- package/.github/dependabot.yml +33 -0
- package/.github/pull_request_template.md +5 -0
- package/.github/workflows/ci.yml +187 -0
- package/.github/workflows/release-binaries.yml +19 -9
- package/.github/zizmor.yml +9 -0
- package/CODE_OF_CONDUCT.md +9 -0
- package/CONTRIBUTING.md +42 -0
- package/LICENSE +21 -0
- package/README.md +149 -0
- package/SECURITY.md +17 -0
- package/benchmarks/results/container-scale-2026-09-25T20-54-49-736Z.json +45 -0
- package/benchmarks/results/container-scale-2026-09-25T21-01-20-540Z.json +150 -0
- package/benchmarks/results/container-scale-2026-09-25T21-15-01-441Z.json +73 -0
- package/benchmarks/results/container-scale-2026-09-25T22-09-01-630Z.json +77 -0
- package/benchmarks/results/container-scale-2026-09-25T22-18-28-371Z.json +202 -0
- package/cli/README.md +25 -0
- package/cli/biome.json +1 -1
- package/cli/dist/cli.d.ts +3 -0
- package/cli/dist/cli.d.ts.map +1 -0
- package/cli/dist/cli.js +64 -0
- package/cli/dist/cli.js.map +1 -0
- package/cli/dist/commands/completion.d.ts +3 -0
- package/cli/dist/commands/completion.d.ts.map +1 -0
- package/cli/dist/commands/completion.js +294 -0
- package/cli/dist/commands/completion.js.map +1 -0
- package/cli/dist/commands/config.d.ts +3 -0
- package/cli/dist/commands/config.d.ts.map +1 -0
- package/cli/dist/commands/config.js +231 -0
- package/cli/dist/commands/config.js.map +1 -0
- package/cli/dist/commands/doctor.d.ts +19 -0
- package/cli/dist/commands/doctor.d.ts.map +1 -0
- package/cli/dist/commands/doctor.js +745 -0
- package/cli/dist/commands/doctor.js.map +1 -0
- package/cli/dist/commands/down.d.ts +3 -0
- package/cli/dist/commands/down.d.ts.map +1 -0
- package/cli/dist/commands/down.js +32 -0
- package/cli/dist/commands/down.js.map +1 -0
- package/cli/dist/commands/help.d.ts +2 -0
- package/cli/dist/commands/help.d.ts.map +1 -0
- package/cli/dist/commands/help.js +138 -0
- package/cli/dist/commands/help.js.map +1 -0
- package/cli/dist/commands/networks.d.ts +3 -0
- package/cli/dist/commands/networks.d.ts.map +1 -0
- package/cli/dist/commands/networks.js +260 -0
- package/cli/dist/commands/networks.js.map +1 -0
- package/cli/dist/commands/project.d.ts +3 -0
- package/cli/dist/commands/project.d.ts.map +1 -0
- package/cli/dist/commands/project.js +370 -0
- package/cli/dist/commands/project.js.map +1 -0
- package/cli/dist/commands/projects.d.ts +3 -0
- package/cli/dist/commands/projects.d.ts.map +1 -0
- package/cli/dist/commands/projects.js +71 -0
- package/cli/dist/commands/projects.js.map +1 -0
- package/cli/dist/commands/resource.d.ts +69 -0
- package/cli/dist/commands/resource.d.ts.map +1 -0
- package/cli/dist/commands/resource.js +579 -0
- package/cli/dist/commands/resource.js.map +1 -0
- package/cli/dist/commands/resources.d.ts +3 -0
- package/cli/dist/commands/resources.d.ts.map +1 -0
- package/cli/dist/commands/resources.js +73 -0
- package/cli/dist/commands/resources.js.map +1 -0
- package/cli/dist/commands/stack.d.ts +3 -0
- package/cli/dist/commands/stack.d.ts.map +1 -0
- package/cli/dist/commands/stack.js +97 -0
- package/cli/dist/commands/stack.js.map +1 -0
- package/cli/dist/commands/stacks.d.ts +3 -0
- package/cli/dist/commands/stacks.d.ts.map +1 -0
- package/cli/dist/commands/stacks.js +43 -0
- package/cli/dist/commands/stacks.js.map +1 -0
- package/cli/dist/commands/status.d.ts +3 -0
- package/cli/dist/commands/status.d.ts.map +1 -0
- package/cli/dist/commands/status.js +71 -0
- package/cli/dist/commands/status.js.map +1 -0
- package/cli/dist/commands/ui.d.ts +3 -0
- package/cli/dist/commands/ui.d.ts.map +1 -0
- package/cli/dist/commands/ui.js +445 -0
- package/cli/dist/commands/ui.js.map +1 -0
- package/cli/dist/commands/up.d.ts +3 -0
- package/cli/dist/commands/up.d.ts.map +1 -0
- package/cli/dist/commands/up.js +124 -0
- package/cli/dist/commands/up.js.map +1 -0
- package/cli/dist/commands/upgrade.d.ts +11 -0
- package/cli/dist/commands/upgrade.d.ts.map +1 -0
- package/cli/dist/commands/upgrade.js +496 -0
- package/cli/dist/commands/upgrade.js.map +1 -0
- package/cli/dist/commands/version.d.ts +3 -0
- package/cli/dist/commands/version.d.ts.map +1 -0
- package/cli/dist/commands/version.js +9 -0
- package/cli/dist/commands/version.js.map +1 -0
- package/cli/dist/components/Accessible.d.ts +8 -0
- package/cli/dist/components/Accessible.d.ts.map +1 -0
- package/cli/dist/components/Accessible.js +10 -0
- package/cli/dist/components/Accessible.js.map +1 -0
- package/cli/dist/components/BaseTooltip.d.ts +4 -0
- package/cli/dist/components/BaseTooltip.d.ts.map +1 -0
- package/cli/dist/components/BaseTooltip.js +28 -0
- package/cli/dist/components/BaseTooltip.js.map +1 -0
- package/cli/dist/components/DetailPanel.d.ts +4 -0
- package/cli/dist/components/DetailPanel.d.ts.map +1 -0
- package/cli/dist/components/DetailPanel.js +18 -0
- package/cli/dist/components/DetailPanel.js.map +1 -0
- package/cli/dist/components/FileTree.d.ts +4 -0
- package/cli/dist/components/FileTree.d.ts.map +1 -0
- package/cli/dist/components/FileTree.js +47 -0
- package/cli/dist/components/FileTree.js.map +1 -0
- package/cli/dist/components/ResourceSelectInput.d.ts +4 -0
- package/cli/dist/components/ResourceSelectInput.d.ts.map +1 -0
- package/cli/dist/components/ResourceSelectInput.js +7 -0
- package/cli/dist/components/ResourceSelectInput.js.map +1 -0
- package/cli/dist/components/ResourceTable.d.ts +4 -0
- package/cli/dist/components/ResourceTable.d.ts.map +1 -0
- package/cli/dist/components/ResourceTable.js +18 -0
- package/cli/dist/components/ResourceTable.js.map +1 -0
- package/cli/dist/components/TabBar.d.ts +4 -0
- package/cli/dist/components/TabBar.d.ts.map +1 -0
- package/cli/dist/components/TabBar.js +17 -0
- package/cli/dist/components/TabBar.js.map +1 -0
- package/cli/dist/components/Tooltip.d.ts +12 -0
- package/cli/dist/components/Tooltip.d.ts.map +1 -0
- package/cli/dist/components/Tooltip.js +12 -0
- package/cli/dist/components/Tooltip.js.map +1 -0
- package/cli/dist/components/index.d.ts +8 -0
- package/cli/dist/components/index.d.ts.map +1 -0
- package/cli/dist/components/index.js +8 -0
- package/cli/dist/components/index.js.map +1 -0
- package/cli/dist/config/platform-standards.d.ts +159 -0
- package/cli/dist/config/platform-standards.d.ts.map +1 -0
- package/cli/dist/config/platform-standards.js +181 -0
- package/cli/dist/config/platform-standards.js.map +1 -0
- package/cli/dist/generator/extension-fetch.d.ts +25 -0
- package/cli/dist/generator/extension-fetch.d.ts.map +1 -0
- package/cli/dist/generator/extension-fetch.js +259 -0
- package/cli/dist/generator/extension-fetch.js.map +1 -0
- package/cli/dist/generator/template-engine.d.ts +62 -0
- package/cli/dist/generator/template-engine.d.ts.map +1 -0
- package/cli/dist/generator/template-engine.js +623 -0
- package/cli/dist/generator/template-engine.js.map +1 -0
- package/cli/dist/index.d.ts +11 -0
- package/cli/dist/index.d.ts.map +1 -0
- package/cli/dist/index.js +11 -0
- package/cli/dist/index.js.map +1 -0
- package/cli/dist/types/index.d.ts +257 -0
- package/cli/dist/types/index.d.ts.map +1 -0
- package/cli/dist/types/index.js +17 -0
- package/cli/dist/types/index.js.map +1 -0
- package/cli/dist/utils/cache.d.ts +19 -0
- package/cli/dist/utils/cache.d.ts.map +1 -0
- package/cli/dist/utils/cache.js +64 -0
- package/cli/dist/utils/cache.js.map +1 -0
- package/cli/dist/utils/command-helpers.d.ts +17 -0
- package/cli/dist/utils/command-helpers.d.ts.map +1 -0
- package/cli/dist/utils/command-helpers.js +41 -0
- package/cli/dist/utils/command-helpers.js.map +1 -0
- package/cli/dist/utils/constants.d.ts +53 -0
- package/cli/dist/utils/constants.d.ts.map +1 -0
- package/cli/dist/utils/constants.js +115 -0
- package/cli/dist/utils/constants.js.map +1 -0
- package/cli/dist/utils/discovery-context.d.ts +4 -0
- package/cli/dist/utils/discovery-context.d.ts.map +1 -0
- package/cli/dist/utils/discovery-context.js +39 -0
- package/cli/dist/utils/discovery-context.js.map +1 -0
- package/cli/dist/utils/docker.d.ts +4 -0
- package/cli/dist/utils/docker.d.ts.map +1 -0
- package/cli/dist/utils/docker.js +19 -0
- package/cli/dist/utils/docker.js.map +1 -0
- package/cli/dist/utils/doctor-runtime.d.ts +81 -0
- package/cli/dist/utils/doctor-runtime.d.ts.map +1 -0
- package/cli/dist/utils/doctor-runtime.js +498 -0
- package/cli/dist/utils/doctor-runtime.js.map +1 -0
- package/cli/dist/utils/env-validator.d.ts +15 -0
- package/cli/dist/utils/env-validator.d.ts.map +1 -0
- package/cli/dist/utils/env-validator.js +109 -0
- package/cli/dist/utils/env-validator.js.map +1 -0
- package/cli/dist/utils/errors.d.ts +31 -0
- package/cli/dist/utils/errors.d.ts.map +1 -0
- package/cli/dist/utils/errors.js +140 -0
- package/cli/dist/utils/errors.js.map +1 -0
- package/cli/dist/utils/file-helpers.d.ts +14 -0
- package/cli/dist/utils/file-helpers.d.ts.map +1 -0
- package/cli/dist/utils/file-helpers.js +45 -0
- package/cli/dist/utils/file-helpers.js.map +1 -0
- package/cli/dist/utils/formatting.d.ts +30 -0
- package/cli/dist/utils/formatting.d.ts.map +1 -0
- package/cli/dist/utils/formatting.js +164 -0
- package/cli/dist/utils/formatting.js.map +1 -0
- package/cli/dist/utils/paths.d.ts +3 -0
- package/cli/dist/utils/paths.d.ts.map +1 -0
- package/cli/dist/utils/paths.js +41 -0
- package/cli/dist/utils/paths.js.map +1 -0
- package/cli/dist/utils/port-assignment.d.ts +6 -0
- package/cli/dist/utils/port-assignment.d.ts.map +1 -0
- package/cli/dist/utils/port-assignment.js +81 -0
- package/cli/dist/utils/port-assignment.js.map +1 -0
- package/cli/dist/utils/project-features.d.ts +23 -0
- package/cli/dist/utils/project-features.d.ts.map +1 -0
- package/cli/dist/utils/project-features.js +98 -0
- package/cli/dist/utils/project-features.js.map +1 -0
- package/cli/dist/utils/project-templates.d.ts +7 -0
- package/cli/dist/utils/project-templates.d.ts.map +1 -0
- package/cli/dist/utils/project-templates.js +24 -0
- package/cli/dist/utils/project-templates.js.map +1 -0
- package/cli/dist/utils/prompt.d.ts +28 -0
- package/cli/dist/utils/prompt.d.ts.map +1 -0
- package/cli/dist/utils/prompt.js +79 -0
- package/cli/dist/utils/prompt.js.map +1 -0
- package/cli/dist/utils/resource-features.d.ts +29 -0
- package/cli/dist/utils/resource-features.d.ts.map +1 -0
- package/cli/dist/utils/resource-features.js +175 -0
- package/cli/dist/utils/resource-features.js.map +1 -0
- package/cli/dist/utils/service-urls.d.ts +30 -0
- package/cli/dist/utils/service-urls.d.ts.map +1 -0
- package/cli/dist/utils/service-urls.js +93 -0
- package/cli/dist/utils/service-urls.js.map +1 -0
- package/cli/dist/utils/services.d.ts +18 -0
- package/cli/dist/utils/services.d.ts.map +1 -0
- package/cli/dist/utils/services.js +292 -0
- package/cli/dist/utils/services.js.map +1 -0
- package/cli/dist/utils/stack-features.d.ts +22 -0
- package/cli/dist/utils/stack-features.d.ts.map +1 -0
- package/cli/dist/utils/stack-features.js +13 -0
- package/cli/dist/utils/stack-features.js.map +1 -0
- package/cli/dist/utils/tar.d.ts +7 -0
- package/cli/dist/utils/tar.d.ts.map +1 -0
- package/cli/dist/utils/tar.js +21 -0
- package/cli/dist/utils/tar.js.map +1 -0
- package/cli/dist/utils/tilt.d.ts +20 -0
- package/cli/dist/utils/tilt.d.ts.map +1 -0
- package/cli/dist/utils/tilt.js +95 -0
- package/cli/dist/utils/tilt.js.map +1 -0
- package/cli/dist/utils/validation.d.ts +16 -0
- package/cli/dist/utils/validation.d.ts.map +1 -0
- package/cli/dist/utils/validation.js +58 -0
- package/cli/dist/utils/validation.js.map +1 -0
- package/cli/package.json +11 -12
- package/cli/src/commands/__tests__/always-enabled-infra.test.ts +2 -8
- package/cli/src/commands/__tests__/doctor.test.ts +181 -8
- package/cli/src/commands/__tests__/phases-model.test.ts +2 -4
- package/cli/src/commands/__tests__/project-resource-features-e2e.test.ts +4 -24
- package/cli/src/commands/__tests__/saas-starter-integration.test.ts +8 -10
- package/cli/src/commands/__tests__/stack-features-e2e.test.ts +10 -4
- package/cli/src/commands/__tests__/upgrade.test.ts +23 -13
- package/cli/src/commands/doctor.ts +136 -0
- package/cli/src/commands/help.ts +13 -3
- package/cli/src/commands/project.ts +11 -14
- package/cli/src/commands/projects.ts +2 -2
- package/cli/src/commands/up.ts +13 -4
- package/cli/src/commands/upgrade.ts +11 -4
- package/cli/src/config/platform-standards.test.ts +6 -6
- package/cli/src/generator/__tests__/extension-fetch.test.ts +36 -14
- package/cli/src/generator/extension-fetch.ts +12 -5
- package/cli/src/generator/template-engine.ts +19 -21
- package/cli/src/types/index.ts +2 -0
- package/cli/src/utils/__tests__/tilt.test.ts +29 -0
- package/cli/src/utils/constants.ts +4 -0
- package/cli/src/utils/doctor-runtime.ts +67 -27
- package/cli/src/utils/env-validator.ts +2 -2
- package/cli/src/utils/project-templates.ts +2 -1
- package/cli/src/utils/prompt.ts +2 -4
- package/cli/src/utils/resource-features.ts +10 -4
- package/cli/src/utils/services.ts +2 -1
- package/cli/src/utils/tilt.ts +20 -0
- package/engine/assets/docker/wake-gateway/Dockerfile +26 -0
- package/engine/assets/docker/wake-gateway/decide.test.ts +87 -0
- package/engine/assets/docker/wake-gateway/decide.ts +75 -0
- package/engine/assets/docker/wake-gateway/server.ts +220 -0
- package/engine/topologies/platform/docker/build/golden_image_dockerfile.star +13 -23
- package/engine/topologies/platform/docker/compose/compose.star +7 -14
- package/engine/topologies/platform/docker/compose/compose_helpers.star +1 -1
- package/engine/topologies/platform/docker/compose/traefik_standalone.star +44 -6
- package/engine/topologies/platform/docker/config/healthcheck.star +56 -0
- package/engine/topologies/platform/docker/constants.star +10 -0
- package/engine/topologies/platform/docker/layers/l1_base_layers.star +1 -1
- package/engine/topologies/platform/docker/layers/l4_runtime_layers.star +55 -20
- package/engine/topologies/platform/docker/networking/traefik_static_routes.star +107 -0
- package/engine/topologies/tilt/generators/typescript/backend_tsconfig.star +2 -2
- package/engine/topologies/tilt/generators/typescript/frontend_tsconfig.star +1 -1
- package/engine/topologies/tilt/manifest/schema.star +6 -0
- package/engine/topologies/tilt/manifest/validator.star +16 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_compose_resource_registration.star +107 -8
- package/engine/topologies/tilt/resources/orchestrator/builders/typescript.star +12 -6
- package/engine/topologies/tilt/resources/orchestrator/generators/manifest_resource.star +2 -1
- package/knip.json +1 -1
- package/openspec/changes/optimize-runtime-docker-layers/.openspec.yaml +3 -0
- package/openspec/changes/optimize-runtime-docker-layers/design.md +81 -0
- package/openspec/changes/optimize-runtime-docker-layers/proposal.md +44 -0
- package/openspec/changes/optimize-runtime-docker-layers/specs/runtime-container-footprint/spec.md +79 -0
- package/openspec/changes/optimize-runtime-docker-layers/tasks.md +36 -0
- package/openspec/changes/prioritized-cold-start/.openspec.yaml +4 -0
- package/openspec/changes/prioritized-cold-start/design.md +113 -0
- package/openspec/changes/prioritized-cold-start/proposal.md +40 -0
- package/openspec/changes/prioritized-cold-start/specs/on-demand-resource-startup/spec.md +92 -0
- package/openspec/changes/prioritized-cold-start/tasks.md +46 -0
- package/openspec/config.yaml +1 -0
- package/package.json +35 -5
- package/scripts/autoresearch/layer-eval.sh +65 -0
- package/scripts/benchmark/README.md +25 -0
- package/scripts/benchmark/container-scale.ts +503 -0
- package/scripts/benchmark/pre-release-gate.sh +9 -0
- package/scripts/measure-idle-footprint.sh +58 -0
- package/tests/tilt-engine/test_runtime_container_footprint.py +162 -0
- package/tests/tilt-engine/test_sablier_defer_start.py +196 -0
- package/tests/tilt-engine/test_standalone_traefik.py +38 -0
- package/tests/tilt-engine/test_traefik_static_wake_route.py +119 -0
- package/bun.lock +0 -538
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
{
|
|
2
|
+
"date": "2026-09-25T22:18:28.372Z",
|
|
3
|
+
"hostMemGiB": 16,
|
|
4
|
+
"dockerMemMiB": 7934,
|
|
5
|
+
"perServiceBudgetMiB": 74,
|
|
6
|
+
"options": {
|
|
7
|
+
"mode": "compose",
|
|
8
|
+
"project": "../tdk-erp-system",
|
|
9
|
+
"tiers": [
|
|
10
|
+
5,
|
|
11
|
+
10,
|
|
12
|
+
20,
|
|
13
|
+
50,
|
|
14
|
+
80,
|
|
15
|
+
100
|
|
16
|
+
],
|
|
17
|
+
"gate": 100,
|
|
18
|
+
"timeoutSeconds": 240,
|
|
19
|
+
"interval": 30,
|
|
20
|
+
"startInterval": 2,
|
|
21
|
+
"settleSeconds": 15
|
|
22
|
+
},
|
|
23
|
+
"images": 107,
|
|
24
|
+
"imageStats": {
|
|
25
|
+
"backend": {
|
|
26
|
+
"count": 100,
|
|
27
|
+
"min": 176,
|
|
28
|
+
"avg": 242,
|
|
29
|
+
"max": 263
|
|
30
|
+
},
|
|
31
|
+
"frontend": {
|
|
32
|
+
"count": 7,
|
|
33
|
+
"min": 89,
|
|
34
|
+
"avg": 89,
|
|
35
|
+
"max": 89
|
|
36
|
+
},
|
|
37
|
+
"backendSingleProcess": {
|
|
38
|
+
"count": 26,
|
|
39
|
+
"min": 176,
|
|
40
|
+
"avg": 183,
|
|
41
|
+
"max": 263
|
|
42
|
+
},
|
|
43
|
+
"backendWrapper": {
|
|
44
|
+
"count": 74,
|
|
45
|
+
"min": 263,
|
|
46
|
+
"avg": 263,
|
|
47
|
+
"max": 263
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"diskUsage": "Images 6.56GB",
|
|
51
|
+
"singleProcessImageShare": 0.308411214953271,
|
|
52
|
+
"results": [
|
|
53
|
+
{
|
|
54
|
+
"tier": 5,
|
|
55
|
+
"launchSeconds": 2.4,
|
|
56
|
+
"firstHealthySeconds": 3.8,
|
|
57
|
+
"allHealthySeconds": 5,
|
|
58
|
+
"healthy": 5,
|
|
59
|
+
"unhealthy": 0,
|
|
60
|
+
"starting": 0,
|
|
61
|
+
"crashed": 0,
|
|
62
|
+
"oomKilled": 0,
|
|
63
|
+
"crashes": [],
|
|
64
|
+
"totalMemMiB": 74,
|
|
65
|
+
"avgMemMiB": 14.7,
|
|
66
|
+
"totalCpuPct": 1.7,
|
|
67
|
+
"dockerPsMs": 81,
|
|
68
|
+
"requestMsP50": 2.8,
|
|
69
|
+
"loadAvg1m": 5.59,
|
|
70
|
+
"hostFreeMiB": 149,
|
|
71
|
+
"singleProcessShare": 1,
|
|
72
|
+
"routed": {
|
|
73
|
+
"200": 5
|
|
74
|
+
},
|
|
75
|
+
"restarts": 0
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"tier": 10,
|
|
79
|
+
"launchSeconds": 5.4,
|
|
80
|
+
"firstHealthySeconds": 5.8,
|
|
81
|
+
"allHealthySeconds": 8.2,
|
|
82
|
+
"healthy": 10,
|
|
83
|
+
"unhealthy": 0,
|
|
84
|
+
"starting": 0,
|
|
85
|
+
"crashed": 0,
|
|
86
|
+
"oomKilled": 0,
|
|
87
|
+
"crashes": [],
|
|
88
|
+
"totalMemMiB": 157,
|
|
89
|
+
"avgMemMiB": 15.7,
|
|
90
|
+
"totalCpuPct": 3.7,
|
|
91
|
+
"dockerPsMs": 101,
|
|
92
|
+
"requestMsP50": 4.5,
|
|
93
|
+
"loadAvg1m": 6.29,
|
|
94
|
+
"hostFreeMiB": 163,
|
|
95
|
+
"singleProcessShare": 1,
|
|
96
|
+
"routed": {
|
|
97
|
+
"200": 10
|
|
98
|
+
},
|
|
99
|
+
"restarts": 0
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"tier": 20,
|
|
103
|
+
"launchSeconds": 10.6,
|
|
104
|
+
"firstHealthySeconds": 11,
|
|
105
|
+
"allHealthySeconds": 13.6,
|
|
106
|
+
"healthy": 20,
|
|
107
|
+
"unhealthy": 0,
|
|
108
|
+
"starting": 0,
|
|
109
|
+
"crashed": 0,
|
|
110
|
+
"oomKilled": 0,
|
|
111
|
+
"crashes": [],
|
|
112
|
+
"totalMemMiB": 309,
|
|
113
|
+
"avgMemMiB": 15.5,
|
|
114
|
+
"totalCpuPct": 6.2,
|
|
115
|
+
"dockerPsMs": 181,
|
|
116
|
+
"requestMsP50": 3.1,
|
|
117
|
+
"loadAvg1m": 6.69,
|
|
118
|
+
"hostFreeMiB": 86,
|
|
119
|
+
"singleProcessShare": 1,
|
|
120
|
+
"routed": {
|
|
121
|
+
"200": 20
|
|
122
|
+
},
|
|
123
|
+
"restarts": 0
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"tier": 50,
|
|
127
|
+
"launchSeconds": 57.4,
|
|
128
|
+
"firstHealthySeconds": 57.9,
|
|
129
|
+
"allHealthySeconds": 61,
|
|
130
|
+
"healthy": 50,
|
|
131
|
+
"unhealthy": 0,
|
|
132
|
+
"starting": 0,
|
|
133
|
+
"crashed": 0,
|
|
134
|
+
"oomKilled": 0,
|
|
135
|
+
"crashes": [],
|
|
136
|
+
"totalMemMiB": 834,
|
|
137
|
+
"avgMemMiB": 16.7,
|
|
138
|
+
"totalCpuPct": 73.1,
|
|
139
|
+
"dockerPsMs": 1541,
|
|
140
|
+
"requestMsP50": 6.5,
|
|
141
|
+
"loadAvg1m": 17.68,
|
|
142
|
+
"hostFreeMiB": 93,
|
|
143
|
+
"singleProcessShare": 0.5,
|
|
144
|
+
"routed": {
|
|
145
|
+
"200": 50
|
|
146
|
+
},
|
|
147
|
+
"restarts": 0
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"tier": 80,
|
|
151
|
+
"launchSeconds": 77.4,
|
|
152
|
+
"firstHealthySeconds": 78.3,
|
|
153
|
+
"allHealthySeconds": 82.6,
|
|
154
|
+
"healthy": 80,
|
|
155
|
+
"unhealthy": 0,
|
|
156
|
+
"starting": 0,
|
|
157
|
+
"crashed": 0,
|
|
158
|
+
"oomKilled": 0,
|
|
159
|
+
"crashes": [],
|
|
160
|
+
"totalMemMiB": 1353,
|
|
161
|
+
"avgMemMiB": 16.9,
|
|
162
|
+
"totalCpuPct": 56.2,
|
|
163
|
+
"dockerPsMs": 585,
|
|
164
|
+
"requestMsP50": 7.5,
|
|
165
|
+
"loadAvg1m": 23.96,
|
|
166
|
+
"hostFreeMiB": 80,
|
|
167
|
+
"singleProcessShare": 0.4,
|
|
168
|
+
"routed": {
|
|
169
|
+
"200": 80
|
|
170
|
+
},
|
|
171
|
+
"restarts": 0
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"tier": 100,
|
|
175
|
+
"launchSeconds": 68.9,
|
|
176
|
+
"firstHealthySeconds": 69.8,
|
|
177
|
+
"allHealthySeconds": 73.9,
|
|
178
|
+
"healthy": 100,
|
|
179
|
+
"unhealthy": 0,
|
|
180
|
+
"starting": 0,
|
|
181
|
+
"crashed": 0,
|
|
182
|
+
"oomKilled": 0,
|
|
183
|
+
"crashes": [],
|
|
184
|
+
"totalMemMiB": 1668,
|
|
185
|
+
"avgMemMiB": 16.7,
|
|
186
|
+
"totalCpuPct": 48,
|
|
187
|
+
"dockerPsMs": 584,
|
|
188
|
+
"requestMsP50": 5.6,
|
|
189
|
+
"loadAvg1m": 13.59,
|
|
190
|
+
"hostFreeMiB": 68,
|
|
191
|
+
"singleProcessShare": 0.3,
|
|
192
|
+
"routed": {
|
|
193
|
+
"200": 100
|
|
194
|
+
},
|
|
195
|
+
"restarts": 0
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
"gate": {
|
|
199
|
+
"tier": 100,
|
|
200
|
+
"passed": true
|
|
201
|
+
}
|
|
202
|
+
}
|
package/cli/README.md
CHANGED
|
@@ -215,6 +215,31 @@ Checks for:
|
|
|
215
215
|
- ✅ Required ports free
|
|
216
216
|
- ✅ Tiltfile present
|
|
217
217
|
- ✅ Master config files exist
|
|
218
|
+
- ✅ Docker Engine 25+ and Docker Compose 2.20.2+ (generated healthchecks use `start_interval`)
|
|
219
|
+
|
|
220
|
+
### Container footprint
|
|
221
|
+
|
|
222
|
+
Generated runtimes are sized so large landscapes fit on a 16 GB laptop:
|
|
223
|
+
|
|
224
|
+
- **One process per container.** A service whose `start` script is just `bun run <file>` runs `bun <file>` directly under Docker's init (`init: true`). Any other `start` script keeps `bun run start`.
|
|
225
|
+
- **Healthchecks:** every 2 s during startup, then every 30 s. You can override the timing for a run:
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
TDK_HEALTHCHECK_INTERVAL_SECONDS=15 tdk up
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
The other overrides are `TDK_HEALTHCHECK_START_INTERVAL_SECONDS`, `TDK_HEALTHCHECK_TIMEOUT_SECONDS`, `TDK_HEALTHCHECK_START_PERIOD_SECONDS` and `TDK_HEALTHCHECK_RETRIES`.
|
|
232
|
+
- **Optional tooling is per service.** The golden backend image no longer ships `hugo`. A service that needs it declares it in `service.json`:
|
|
233
|
+
|
|
234
|
+
```json
|
|
235
|
+
{ "featuresEnabled": ["hugo"] }
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
To check a running backend against the idle budget (one Bun process, at most 64 MiB, under 2% CPU):
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
scripts/measure-idle-footprint.sh finance-autogenerated-cash-management-api-1
|
|
242
|
+
```
|
|
218
243
|
|
|
219
244
|
---
|
|
220
245
|
|
package/cli/biome.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/cli/dist/cli.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import { Command } from "commander";
|
|
4
|
+
import pkg from "../package.json" with { type: "json" };
|
|
5
|
+
import { completionCommand } from "./commands/completion.js";
|
|
6
|
+
import { configCommand } from "./commands/config.js";
|
|
7
|
+
import { doctorCommand } from "./commands/doctor.js";
|
|
8
|
+
import { downCommand } from "./commands/down.js";
|
|
9
|
+
import { showHelp } from "./commands/help.js";
|
|
10
|
+
import { networksCommand } from "./commands/networks.js";
|
|
11
|
+
import { projectCommand } from "./commands/project.js";
|
|
12
|
+
import { projectsCommand } from "./commands/projects.js";
|
|
13
|
+
import { resourceCommand } from "./commands/resource.js";
|
|
14
|
+
import { resourcesCommand } from "./commands/resources.js";
|
|
15
|
+
import { stackCommand } from "./commands/stack.js";
|
|
16
|
+
import { stacksCommand } from "./commands/stacks.js";
|
|
17
|
+
import { statusCommand } from "./commands/status.js";
|
|
18
|
+
import { uiCommand } from "./commands/ui.js";
|
|
19
|
+
import { upCommand } from "./commands/up.js";
|
|
20
|
+
import { upgradeCommand } from "./commands/upgrade.js";
|
|
21
|
+
import { versionCommand } from "./commands/version.js";
|
|
22
|
+
const program = new Command();
|
|
23
|
+
program
|
|
24
|
+
.name("tdk")
|
|
25
|
+
.description("Tilt Development Kit - Project/Stack/Resource management")
|
|
26
|
+
.version(pkg.version, "-v, --version", "Display version number")
|
|
27
|
+
.option("--verbose", "Enable verbose output", false)
|
|
28
|
+
.configureOutput({
|
|
29
|
+
outputError: (str, write) => write(chalk.red(str)),
|
|
30
|
+
writeOut: (str) => process.stdout.write(str),
|
|
31
|
+
writeErr: (str) => process.stderr.write(str),
|
|
32
|
+
});
|
|
33
|
+
program.helpCommand("help [command]", "Show colorful help").on("--help", () => {
|
|
34
|
+
showHelp();
|
|
35
|
+
process.exit(0);
|
|
36
|
+
});
|
|
37
|
+
program.addHelpText("before", "");
|
|
38
|
+
program.addCommand(stacksCommand);
|
|
39
|
+
program.addCommand(resourcesCommand);
|
|
40
|
+
program.addCommand(projectsCommand);
|
|
41
|
+
program.addCommand(upCommand);
|
|
42
|
+
program.addCommand(downCommand);
|
|
43
|
+
program.addCommand(statusCommand);
|
|
44
|
+
program.addCommand(stackCommand);
|
|
45
|
+
program.addCommand(resourceCommand);
|
|
46
|
+
program.addCommand(projectCommand);
|
|
47
|
+
program.addCommand(configCommand);
|
|
48
|
+
program.addCommand(uiCommand);
|
|
49
|
+
program.addCommand(versionCommand);
|
|
50
|
+
program.addCommand(doctorCommand);
|
|
51
|
+
program.addCommand(completionCommand);
|
|
52
|
+
program.addCommand(upgradeCommand);
|
|
53
|
+
program.addCommand(networksCommand);
|
|
54
|
+
// Default: show help if no command provided
|
|
55
|
+
if (process.argv.length === 2) {
|
|
56
|
+
showHelp();
|
|
57
|
+
process.exit(0);
|
|
58
|
+
}
|
|
59
|
+
if (process.argv.length === 3 && ["-h", "--help", "help"].includes(process.argv[2])) {
|
|
60
|
+
showHelp();
|
|
61
|
+
process.exit(0);
|
|
62
|
+
}
|
|
63
|
+
program.parse();
|
|
64
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,GAAG,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAA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O,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuNpC,eAAO,MAAM,iBAAiB,SAgF1B,CAAC"}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import chalk from "chalk";
|
|
5
|
+
import { Command } from "commander";
|
|
6
|
+
const BASH_COMPLETION = `# TDK CLI Bash Completion
|
|
7
|
+
_tdk_completions() {
|
|
8
|
+
local cur prev opts
|
|
9
|
+
COMPREPLY=()
|
|
10
|
+
cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
11
|
+
prev="\${COMP_WORDS[COMP_CWORD-1]}"
|
|
12
|
+
|
|
13
|
+
# Main commands
|
|
14
|
+
local commands="project projects stack stacks resource resources up down status ui doctor version completion help upgrade"
|
|
15
|
+
|
|
16
|
+
# Options for specific commands
|
|
17
|
+
case "\${prev}" in
|
|
18
|
+
tdk)
|
|
19
|
+
COMPREPLY=( $(compgen -W "\${commands}" -- \${cur}) )
|
|
20
|
+
return 0
|
|
21
|
+
;;
|
|
22
|
+
up)
|
|
23
|
+
# Complete with stack names and resource names
|
|
24
|
+
local stacks=$(tdk stacks 2>/dev/null | grep '^ -' | sed 's/^ - //' | awk '{print $1}')
|
|
25
|
+
local resources=$(tdk resources 2>/dev/null | grep -E '^[a-z0-9-]+' | awk '{print $1}')
|
|
26
|
+
COMPREPLY=( $(compgen -W "\${stacks} \${resources}" -- \${cur}) )
|
|
27
|
+
return 0
|
|
28
|
+
;;
|
|
29
|
+
stack)
|
|
30
|
+
# Complete with existing stack names
|
|
31
|
+
local stacks=$(tdk stacks 2>/dev/null | grep '^ -' | sed 's/^ - //' | awk '{print $1}')
|
|
32
|
+
COMPREPLY=( $(compgen -W "\${stacks}" -- \${cur}) )
|
|
33
|
+
return 0
|
|
34
|
+
;;
|
|
35
|
+
resource)
|
|
36
|
+
# Suggest common resource names or types
|
|
37
|
+
COMPREPLY=( $(compgen -W "api frontend backend worker --type --stack" -- \${cur}) )
|
|
38
|
+
return 0
|
|
39
|
+
;;
|
|
40
|
+
--type)
|
|
41
|
+
COMPREPLY=( $(compgen -W "backend frontend worker" -- \${cur}) )
|
|
42
|
+
return 0
|
|
43
|
+
;;
|
|
44
|
+
--stack)
|
|
45
|
+
local stacks=$(tdk stacks 2>/dev/null | grep '^ -' | sed 's/^ - //' | awk '{print $1}')
|
|
46
|
+
COMPREPLY=( $(compgen -W "\${stacks}" -- \${cur}) )
|
|
47
|
+
return 0
|
|
48
|
+
;;
|
|
49
|
+
esac
|
|
50
|
+
|
|
51
|
+
# Global options
|
|
52
|
+
if [[ \${cur} == -* ]]; then
|
|
53
|
+
local options="--verbose --version --help --force --dry-run"
|
|
54
|
+
COMPREPLY=( $(compgen -W "\${options}" -- \${cur}) )
|
|
55
|
+
return 0
|
|
56
|
+
fi
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
complete -F _tdk_completions tdk
|
|
60
|
+
`;
|
|
61
|
+
const ZSH_COMPLETION = `#compdef tdk
|
|
62
|
+
|
|
63
|
+
# TDK CLI Zsh Completion
|
|
64
|
+
|
|
65
|
+
_tdk() {
|
|
66
|
+
local curcontext="$curcontext" state line
|
|
67
|
+
typeset -A opt_args
|
|
68
|
+
|
|
69
|
+
_arguments -C
|
|
70
|
+
'(-h --help)'{-h,--help}'[Show help]'
|
|
71
|
+
'(-v --version)'{-v,--version}'[Show version]'
|
|
72
|
+
'--verbose[Enable verbose output]'
|
|
73
|
+
'1: :_tdk_commands'
|
|
74
|
+
'*:: :->args'
|
|
75
|
+
|
|
76
|
+
case "$line[1]" in
|
|
77
|
+
up)
|
|
78
|
+
_arguments
|
|
79
|
+
'--verbose[Enable verbose output]'
|
|
80
|
+
'1: :_tdk_stacks_and_resources'
|
|
81
|
+
;;
|
|
82
|
+
stack)
|
|
83
|
+
_arguments
|
|
84
|
+
'--list[List resources without a stack]'
|
|
85
|
+
'1: :_tdk_stacks'
|
|
86
|
+
;;
|
|
87
|
+
stacks)
|
|
88
|
+
_arguments
|
|
89
|
+
'--services[Include resources in each stack]'
|
|
90
|
+
;;
|
|
91
|
+
resource)
|
|
92
|
+
_arguments
|
|
93
|
+
'--type[Resource type]:type:(backend frontend worker)'
|
|
94
|
+
'--stack[Assign to stack]:stack:_tdk_stacks'
|
|
95
|
+
'1:resource name:'
|
|
96
|
+
;;
|
|
97
|
+
resources)
|
|
98
|
+
_arguments
|
|
99
|
+
'--stack[Filter by stack]:stack:_tdk_stacks'
|
|
100
|
+
'--no-stack[Show unassigned only]'
|
|
101
|
+
'--ports[Show port assignments]'
|
|
102
|
+
;;
|
|
103
|
+
projects)
|
|
104
|
+
_arguments
|
|
105
|
+
'--check[Validate master configs]'
|
|
106
|
+
;;
|
|
107
|
+
doctor)
|
|
108
|
+
_arguments
|
|
109
|
+
'--fix[Attempt to fix issues]'
|
|
110
|
+
;;
|
|
111
|
+
upgrade)
|
|
112
|
+
_arguments
|
|
113
|
+
'--force[Force upgrade even if on latest]'
|
|
114
|
+
'--dry-run[Show what would be upgraded]'
|
|
115
|
+
;;
|
|
116
|
+
esac
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
_tdk_commands() {
|
|
120
|
+
local commands=(
|
|
121
|
+
'project:Initialize project with master configs'
|
|
122
|
+
'projects:Show project information'
|
|
123
|
+
'stack:Organize resources into stacks'
|
|
124
|
+
'stacks:List all stacks'
|
|
125
|
+
'resource:Create new resource'
|
|
126
|
+
'resources:List all resources'
|
|
127
|
+
'up:Start services'
|
|
128
|
+
'down:Stop all services'
|
|
129
|
+
'status:Show resource status'
|
|
130
|
+
'ui:Open interactive UI'
|
|
131
|
+
'doctor:Check environment'
|
|
132
|
+
'version:Show version'
|
|
133
|
+
'upgrade:Upgrade TDK CLI'
|
|
134
|
+
'completion:Generate shell completions'
|
|
135
|
+
'help:Show help'
|
|
136
|
+
)
|
|
137
|
+
_describe -t commands 'tdk command' commands
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
_tdk_stacks() {
|
|
141
|
+
local stacks
|
|
142
|
+
stacks=($(tdk stacks 2>/dev/null | grep '^ -' | sed 's/^ - //' | awk '{print $1}'))
|
|
143
|
+
_describe -t stacks 'stack' stacks
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
_tdk_resources() {
|
|
147
|
+
local resources
|
|
148
|
+
resources=($(tdk resources 2>/dev/null | grep -E '^[a-z0-9-]+' | awk '{print $1}'))
|
|
149
|
+
_describe -t resources 'resource' resources
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
_tdk_stacks_and_resources() {
|
|
153
|
+
_tdk_stacks
|
|
154
|
+
_tdk_resources
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
compdef _tdk tdk
|
|
158
|
+
`;
|
|
159
|
+
const FISH_COMPLETION = `# TDK CLI Fish Completion
|
|
160
|
+
|
|
161
|
+
# Disable file completions for most commands
|
|
162
|
+
complete -c tdk -f
|
|
163
|
+
|
|
164
|
+
# Main commands
|
|
165
|
+
complete -c tdk -n '__fish_use_subcommand' -a 'project' -d 'Initialize project with master configs'
|
|
166
|
+
complete -c tdk -n '__fish_use_subcommand' -a 'projects' -d 'Show project information'
|
|
167
|
+
complete -c tdk -n '__fish_use_subcommand' -a 'stack' -d 'Organize resources into stacks'
|
|
168
|
+
complete -c tdk -n '__fish_use_subcommand' -a 'stacks' -d 'List all stacks'
|
|
169
|
+
complete -c tdk -n '__fish_use_subcommand' -a 'resource' -d 'Create new resource'
|
|
170
|
+
complete -c tdk -n '__fish_use_subcommand' -a 'resources' -d 'List all resources'
|
|
171
|
+
complete -c tdk -n '__fish_use_subcommand' -a 'up' -d 'Start services'
|
|
172
|
+
complete -c tdk -n '__fish_use_subcommand' -a 'down' -d 'Stop all services'
|
|
173
|
+
complete -c tdk -n '__fish_use_subcommand' -a 'status' -d 'Show resource status'
|
|
174
|
+
complete -c tdk -n '__fish_use_subcommand' -a 'ui' -d 'Open interactive UI'
|
|
175
|
+
complete -c tdk -n '__fish_use_subcommand' -a 'doctor' -d 'Check environment'
|
|
176
|
+
complete -c tdk -n '__fish_use_subcommand' -a 'version' -d 'Show version'
|
|
177
|
+
complete -c tdk -n '__fish_use_subcommand' -a 'upgrade' -d 'Upgrade TDK CLI'
|
|
178
|
+
complete -c tdk -n '__fish_use_subcommand' -a 'completion' -d 'Generate shell completions'
|
|
179
|
+
complete -c tdk -n '__fish_use_subcommand' -a 'help' -d 'Show help'
|
|
180
|
+
|
|
181
|
+
# Global options
|
|
182
|
+
complete -c tdk -s h -l help -d 'Show help'
|
|
183
|
+
complete -c tdk -s v -l version -d 'Show version'
|
|
184
|
+
complete -c tdk -l verbose -d 'Enable verbose output'
|
|
185
|
+
|
|
186
|
+
# Command-specific completions
|
|
187
|
+
# resource command options
|
|
188
|
+
complete -c tdk -n '__fish_seen_subcommand_from resource' -l type -d 'Resource type' -a 'backend frontend worker'
|
|
189
|
+
complete -c tdk -n '__fish_seen_subcommand_from resource' -l stack -d 'Assign to stack' -a '(tdk stacks 2>/dev/null | string match -r "^ - " | string replace " - " "")'
|
|
190
|
+
|
|
191
|
+
# resources command options
|
|
192
|
+
complete -c tdk -n '__fish_seen_subcommand_from resources' -l stack -d 'Filter by stack' -a '(tdk stacks 2>/dev/null | string match -r "^ - " | string replace " - " "")'
|
|
193
|
+
complete -c tdk -n '__fish_seen_subcommand_from resources' -l no-stack -d 'Show unassigned only'
|
|
194
|
+
complete -c tdk -n '__fish_seen_subcommand_from resources' -l ports -d 'Show port assignments'
|
|
195
|
+
|
|
196
|
+
# stack command options
|
|
197
|
+
complete -c tdk -n '__fish_seen_subcommand_from stack' -l list -d 'List resources without a stack'
|
|
198
|
+
|
|
199
|
+
# stacks command options
|
|
200
|
+
complete -c tdk -n '__fish_seen_subcommand_from stacks' -l services -d 'Include resources in each stack'
|
|
201
|
+
|
|
202
|
+
# projects command options
|
|
203
|
+
complete -c tdk -n '__fish_seen_subcommand_from projects' -l check -d 'Validate master configs'
|
|
204
|
+
|
|
205
|
+
# up command completions
|
|
206
|
+
complete -c tdk -n '__fish_seen_subcommand_from up' -a '(tdk stacks 2>/dev/null | string match -r "^ - " | string replace " - " "")'
|
|
207
|
+
complete -c tdk -n '__fish_seen_subcommand_from up' -a '(tdk resources 2>/dev/null | string match -r "^[a-z0-9-]+")'
|
|
208
|
+
|
|
209
|
+
# doctor command options
|
|
210
|
+
complete -c tdk -n '__fish_seen_subcommand_from doctor' -l fix -d 'Attempt to fix issues'
|
|
211
|
+
|
|
212
|
+
# upgrade command options
|
|
213
|
+
complete -c tdk -n '__fish_seen_subcommand_from upgrade' -l force -d 'Force upgrade even if on latest'
|
|
214
|
+
complete -c tdk -n '__fish_seen_subcommand_from upgrade' -l dry-run -d 'Show what would be upgraded'
|
|
215
|
+
`;
|
|
216
|
+
export const completionCommand = new Command("completion")
|
|
217
|
+
.description("Generate shell completion scripts")
|
|
218
|
+
.option("-s, --shell <shell>", "Target shell (bash, zsh, fish)", "bash")
|
|
219
|
+
.option("-o, --output <path>", "Output file path (default: stdout)")
|
|
220
|
+
.option("--install", "Install to shell config automatically")
|
|
221
|
+
.action((options) => {
|
|
222
|
+
const shell = options.shell.toLowerCase();
|
|
223
|
+
let completionScript;
|
|
224
|
+
let filename;
|
|
225
|
+
switch (shell) {
|
|
226
|
+
case "bash":
|
|
227
|
+
completionScript = BASH_COMPLETION;
|
|
228
|
+
filename = "tdk-completion.bash";
|
|
229
|
+
break;
|
|
230
|
+
case "zsh":
|
|
231
|
+
completionScript = ZSH_COMPLETION;
|
|
232
|
+
filename = "_tdk";
|
|
233
|
+
break;
|
|
234
|
+
case "fish":
|
|
235
|
+
completionScript = FISH_COMPLETION;
|
|
236
|
+
filename = "tdk.fish";
|
|
237
|
+
break;
|
|
238
|
+
default:
|
|
239
|
+
console.error(chalk.red(`❌ Unsupported shell: ${shell}`));
|
|
240
|
+
console.log(chalk.gray("Supported shells: bash, zsh, fish"));
|
|
241
|
+
process.exit(1);
|
|
242
|
+
}
|
|
243
|
+
if (options.install) {
|
|
244
|
+
const home = homedir();
|
|
245
|
+
let installPath;
|
|
246
|
+
let installInstructions;
|
|
247
|
+
switch (shell) {
|
|
248
|
+
case "bash": {
|
|
249
|
+
installPath = join(home, ".bash_completion.d", filename);
|
|
250
|
+
const bashDir = join(home, ".bash_completion.d");
|
|
251
|
+
if (!existsSync(bashDir)) {
|
|
252
|
+
mkdirSync(bashDir, { recursive: true });
|
|
253
|
+
}
|
|
254
|
+
installInstructions = `\n# Add to ~/.bashrc:\nsource ~/.bash_completion.d/${filename}`;
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
case "zsh": {
|
|
258
|
+
installPath = join(home, ".zsh", "completions", filename);
|
|
259
|
+
const zshDir = join(home, ".zsh", "completions");
|
|
260
|
+
if (!existsSync(zshDir)) {
|
|
261
|
+
mkdirSync(zshDir, { recursive: true });
|
|
262
|
+
}
|
|
263
|
+
installInstructions =
|
|
264
|
+
"\n# Add to ~/.zshrc:\nfpath+=(~/.zsh/completions)\nautoload -U compinit && compinit";
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
case "fish": {
|
|
268
|
+
installPath = join(home, ".config", "fish", "completions", filename);
|
|
269
|
+
const fishDir = join(home, ".config", "fish", "completions");
|
|
270
|
+
if (!existsSync(fishDir)) {
|
|
271
|
+
mkdirSync(fishDir, { recursive: true });
|
|
272
|
+
}
|
|
273
|
+
installInstructions = "\n# Fish completions loaded automatically";
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
default:
|
|
277
|
+
installPath = "";
|
|
278
|
+
installInstructions = "";
|
|
279
|
+
}
|
|
280
|
+
writeFileSync(installPath, completionScript, "utf-8");
|
|
281
|
+
console.log(chalk.green(`✅ Installed ${shell} completion to:`));
|
|
282
|
+
console.log(chalk.cyan(` ${installPath}`));
|
|
283
|
+
console.log(chalk.yellow(installInstructions));
|
|
284
|
+
}
|
|
285
|
+
else if (options.output) {
|
|
286
|
+
writeFileSync(options.output, completionScript, "utf-8");
|
|
287
|
+
console.log(chalk.green(`✅ Written ${shell} completion to:`));
|
|
288
|
+
console.log(chalk.cyan(` ${options.output}`));
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
console.log(completionScript);
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
//# sourceMappingURL=completion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.js","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDvB,CAAC;AAEF,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiGtB,CAAC;AAEF,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDvB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,OAAO,CAAC,YAAY,CAAC;KACvD,WAAW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