@tdk-landscape/tdk-cli-core 1.3.53 → 1.3.55
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/CHANGELOG.md +9 -0
- package/README.md +1 -1
- package/cli/dist/commands/doctor.js +21 -3
- package/cli/dist/commands/upgrade.js +7 -7
- package/cli/dist/generator/extension-fetch.js +16 -9
- package/cli/dist/utils/spinner.js +39 -0
- package/cli/package.json +1 -2
- package/package.json +16 -2
- package/.claude/skills/layer-autoresearch/SKILL.md +0 -48
- package/.claude/skills/tdk-troubleshoot/SKILL.md +0 -222
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -40
- package/.github/ISSUE_TEMPLATE/config.yml +0 -11
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -18
- package/.github/ISSUE_TEMPLATE/premium_license.yml +0 -43
- package/.github/dependabot.yml +0 -33
- package/.github/pull_request_template.md +0 -5
- package/.github/workflows/ci.yml +0 -200
- package/.github/workflows/release-binaries.yml +0 -139
- package/.github/zizmor.yml +0 -9
- package/.pre-commit-config.yaml +0 -57
- package/CODE_OF_CONDUCT.md +0 -9
- package/CONTRIBUTING.md +0 -42
- package/Makefile +0 -92
- package/SECURITY.md +0 -17
- package/benchmarks/results/container-scale-2026-09-25T20-54-49-736Z.json +0 -45
- package/benchmarks/results/container-scale-2026-09-25T21-01-20-540Z.json +0 -150
- package/benchmarks/results/container-scale-2026-09-25T21-15-01-441Z.json +0 -73
- package/benchmarks/results/container-scale-2026-09-25T22-09-01-630Z.json +0 -77
- package/benchmarks/results/container-scale-2026-09-25T22-18-28-371Z.json +0 -202
- package/cli/AGENTS.md +0 -390
- package/cli/DESIGN.md +0 -735
- package/cli/README.md +0 -292
- package/cli/biome.json +0 -40
- package/cli/dependency-graph.svg +0 -1135
- package/cli/dist/cli.d.ts +0 -3
- package/cli/dist/cli.d.ts.map +0 -1
- package/cli/dist/cli.js.map +0 -1
- package/cli/dist/commands/completion.d.ts +0 -3
- package/cli/dist/commands/completion.d.ts.map +0 -1
- package/cli/dist/commands/completion.js.map +0 -1
- package/cli/dist/commands/config.d.ts +0 -3
- package/cli/dist/commands/config.d.ts.map +0 -1
- package/cli/dist/commands/config.js.map +0 -1
- package/cli/dist/commands/doctor.d.ts +0 -19
- package/cli/dist/commands/doctor.d.ts.map +0 -1
- package/cli/dist/commands/doctor.js.map +0 -1
- package/cli/dist/commands/down.d.ts +0 -3
- package/cli/dist/commands/down.d.ts.map +0 -1
- package/cli/dist/commands/down.js.map +0 -1
- package/cli/dist/commands/help.d.ts +0 -2
- package/cli/dist/commands/help.d.ts.map +0 -1
- package/cli/dist/commands/help.js.map +0 -1
- package/cli/dist/commands/networks.d.ts +0 -3
- package/cli/dist/commands/networks.d.ts.map +0 -1
- package/cli/dist/commands/networks.js.map +0 -1
- package/cli/dist/commands/project.d.ts +0 -9
- package/cli/dist/commands/project.d.ts.map +0 -1
- package/cli/dist/commands/project.js.map +0 -1
- package/cli/dist/commands/projects.d.ts +0 -3
- package/cli/dist/commands/projects.d.ts.map +0 -1
- package/cli/dist/commands/projects.js.map +0 -1
- package/cli/dist/commands/resource.d.ts +0 -69
- package/cli/dist/commands/resource.d.ts.map +0 -1
- package/cli/dist/commands/resource.js.map +0 -1
- package/cli/dist/commands/resources.d.ts +0 -3
- package/cli/dist/commands/resources.d.ts.map +0 -1
- package/cli/dist/commands/resources.js.map +0 -1
- package/cli/dist/commands/stack.d.ts +0 -3
- package/cli/dist/commands/stack.d.ts.map +0 -1
- package/cli/dist/commands/stack.js.map +0 -1
- package/cli/dist/commands/stacks.d.ts +0 -3
- package/cli/dist/commands/stacks.d.ts.map +0 -1
- package/cli/dist/commands/stacks.js.map +0 -1
- package/cli/dist/commands/status.d.ts +0 -3
- package/cli/dist/commands/status.d.ts.map +0 -1
- package/cli/dist/commands/status.js.map +0 -1
- package/cli/dist/commands/ui.d.ts +0 -3
- package/cli/dist/commands/ui.d.ts.map +0 -1
- package/cli/dist/commands/ui.js.map +0 -1
- package/cli/dist/commands/up.d.ts +0 -3
- package/cli/dist/commands/up.d.ts.map +0 -1
- package/cli/dist/commands/up.js.map +0 -1
- package/cli/dist/commands/upgrade.d.ts +0 -14
- package/cli/dist/commands/upgrade.d.ts.map +0 -1
- package/cli/dist/commands/upgrade.js.map +0 -1
- package/cli/dist/commands/version.d.ts +0 -3
- package/cli/dist/commands/version.d.ts.map +0 -1
- package/cli/dist/commands/version.js.map +0 -1
- package/cli/dist/components/Accessible.d.ts +0 -8
- package/cli/dist/components/Accessible.d.ts.map +0 -1
- package/cli/dist/components/Accessible.js.map +0 -1
- package/cli/dist/components/BaseTooltip.d.ts +0 -4
- package/cli/dist/components/BaseTooltip.d.ts.map +0 -1
- package/cli/dist/components/BaseTooltip.js.map +0 -1
- package/cli/dist/components/DetailPanel.d.ts +0 -4
- package/cli/dist/components/DetailPanel.d.ts.map +0 -1
- package/cli/dist/components/DetailPanel.js.map +0 -1
- package/cli/dist/components/FileTree.d.ts +0 -4
- package/cli/dist/components/FileTree.d.ts.map +0 -1
- package/cli/dist/components/FileTree.js.map +0 -1
- package/cli/dist/components/ResourceSelectInput.d.ts +0 -4
- package/cli/dist/components/ResourceSelectInput.d.ts.map +0 -1
- package/cli/dist/components/ResourceSelectInput.js.map +0 -1
- package/cli/dist/components/ResourceTable.d.ts +0 -4
- package/cli/dist/components/ResourceTable.d.ts.map +0 -1
- package/cli/dist/components/ResourceTable.js.map +0 -1
- package/cli/dist/components/TabBar.d.ts +0 -4
- package/cli/dist/components/TabBar.d.ts.map +0 -1
- package/cli/dist/components/TabBar.js.map +0 -1
- package/cli/dist/components/Tooltip.d.ts +0 -12
- package/cli/dist/components/Tooltip.d.ts.map +0 -1
- package/cli/dist/components/Tooltip.js.map +0 -1
- package/cli/dist/components/index.d.ts +0 -8
- package/cli/dist/components/index.d.ts.map +0 -1
- package/cli/dist/components/index.js.map +0 -1
- package/cli/dist/config/platform-standards.d.ts +0 -159
- package/cli/dist/config/platform-standards.d.ts.map +0 -1
- package/cli/dist/config/platform-standards.js.map +0 -1
- package/cli/dist/generator/extension-fetch.d.ts +0 -25
- package/cli/dist/generator/extension-fetch.d.ts.map +0 -1
- package/cli/dist/generator/extension-fetch.js.map +0 -1
- package/cli/dist/generator/template-engine.d.ts +0 -62
- package/cli/dist/generator/template-engine.d.ts.map +0 -1
- package/cli/dist/generator/template-engine.js.map +0 -1
- package/cli/dist/index.d.ts +0 -11
- package/cli/dist/index.d.ts.map +0 -1
- package/cli/dist/index.js.map +0 -1
- package/cli/dist/types/index.d.ts +0 -257
- package/cli/dist/types/index.d.ts.map +0 -1
- package/cli/dist/types/index.js.map +0 -1
- package/cli/dist/utils/cache.d.ts +0 -19
- package/cli/dist/utils/cache.d.ts.map +0 -1
- package/cli/dist/utils/cache.js.map +0 -1
- package/cli/dist/utils/command-helpers.d.ts +0 -17
- package/cli/dist/utils/command-helpers.d.ts.map +0 -1
- package/cli/dist/utils/command-helpers.js.map +0 -1
- package/cli/dist/utils/constants.d.ts +0 -53
- package/cli/dist/utils/constants.d.ts.map +0 -1
- package/cli/dist/utils/constants.js.map +0 -1
- package/cli/dist/utils/discovery-context.d.ts +0 -4
- package/cli/dist/utils/discovery-context.d.ts.map +0 -1
- package/cli/dist/utils/discovery-context.js.map +0 -1
- package/cli/dist/utils/docker.d.ts +0 -4
- package/cli/dist/utils/docker.d.ts.map +0 -1
- package/cli/dist/utils/docker.js.map +0 -1
- package/cli/dist/utils/doctor-runtime.d.ts +0 -81
- package/cli/dist/utils/doctor-runtime.d.ts.map +0 -1
- package/cli/dist/utils/doctor-runtime.js.map +0 -1
- package/cli/dist/utils/env-validator.d.ts +0 -15
- package/cli/dist/utils/env-validator.d.ts.map +0 -1
- package/cli/dist/utils/env-validator.js.map +0 -1
- package/cli/dist/utils/errors.d.ts +0 -31
- package/cli/dist/utils/errors.d.ts.map +0 -1
- package/cli/dist/utils/errors.js.map +0 -1
- package/cli/dist/utils/file-helpers.d.ts +0 -14
- package/cli/dist/utils/file-helpers.d.ts.map +0 -1
- package/cli/dist/utils/file-helpers.js.map +0 -1
- package/cli/dist/utils/formatting.d.ts +0 -30
- package/cli/dist/utils/formatting.d.ts.map +0 -1
- package/cli/dist/utils/formatting.js.map +0 -1
- package/cli/dist/utils/paths.d.ts +0 -3
- package/cli/dist/utils/paths.d.ts.map +0 -1
- package/cli/dist/utils/paths.js.map +0 -1
- package/cli/dist/utils/port-assignment.d.ts +0 -6
- package/cli/dist/utils/port-assignment.d.ts.map +0 -1
- package/cli/dist/utils/port-assignment.js.map +0 -1
- package/cli/dist/utils/project-features.d.ts +0 -23
- package/cli/dist/utils/project-features.d.ts.map +0 -1
- package/cli/dist/utils/project-features.js.map +0 -1
- package/cli/dist/utils/project-templates.d.ts +0 -7
- package/cli/dist/utils/project-templates.d.ts.map +0 -1
- package/cli/dist/utils/project-templates.js.map +0 -1
- package/cli/dist/utils/prompt.d.ts +0 -28
- package/cli/dist/utils/prompt.d.ts.map +0 -1
- package/cli/dist/utils/prompt.js.map +0 -1
- package/cli/dist/utils/resource-features.d.ts +0 -29
- package/cli/dist/utils/resource-features.d.ts.map +0 -1
- package/cli/dist/utils/resource-features.js.map +0 -1
- package/cli/dist/utils/service-urls.d.ts +0 -30
- package/cli/dist/utils/service-urls.d.ts.map +0 -1
- package/cli/dist/utils/service-urls.js.map +0 -1
- package/cli/dist/utils/services.d.ts +0 -18
- package/cli/dist/utils/services.d.ts.map +0 -1
- package/cli/dist/utils/services.js.map +0 -1
- package/cli/dist/utils/stack-features.d.ts +0 -22
- package/cli/dist/utils/stack-features.d.ts.map +0 -1
- package/cli/dist/utils/stack-features.js.map +0 -1
- package/cli/dist/utils/tar.d.ts +0 -7
- package/cli/dist/utils/tar.d.ts.map +0 -1
- package/cli/dist/utils/tar.js.map +0 -1
- package/cli/dist/utils/tilt.d.ts +0 -20
- package/cli/dist/utils/tilt.d.ts.map +0 -1
- package/cli/dist/utils/tilt.js.map +0 -1
- package/cli/dist/utils/validation.d.ts +0 -16
- package/cli/dist/utils/validation.d.ts.map +0 -1
- package/cli/dist/utils/validation.js.map +0 -1
- package/cli/knip.json +0 -6
- package/cli/pnpm-lock.yaml +0 -2305
- package/cli/pnpm-workspace.yaml +0 -2
- package/cli/src/cli.ts +0 -72
- package/cli/src/commands/__tests__/always-enabled-infra.test.ts +0 -109
- package/cli/src/commands/__tests__/config.test.ts +0 -146
- package/cli/src/commands/__tests__/doctor.test.ts +0 -730
- package/cli/src/commands/__tests__/error-handling.test.ts +0 -78
- package/cli/src/commands/__tests__/phases-model.test.ts +0 -161
- package/cli/src/commands/__tests__/project-resource-features-e2e.test.ts +0 -187
- package/cli/src/commands/__tests__/project.test.ts +0 -68
- package/cli/src/commands/__tests__/resource.test.ts +0 -226
- package/cli/src/commands/__tests__/saas-starter-integration.test.ts +0 -194
- package/cli/src/commands/__tests__/stack-features-e2e.test.ts +0 -135
- package/cli/src/commands/__tests__/upgrade.test.ts +0 -198
- package/cli/src/commands/completion.ts +0 -300
- package/cli/src/commands/config.ts +0 -299
- package/cli/src/commands/doctor.ts +0 -926
- package/cli/src/commands/down.ts +0 -37
- package/cli/src/commands/help.ts +0 -143
- package/cli/src/commands/networks-design.md +0 -80
- package/cli/src/commands/networks.ts +0 -332
- package/cli/src/commands/project.ts +0 -456
- package/cli/src/commands/projects.ts +0 -82
- package/cli/src/commands/resource.ts +0 -652
- package/cli/src/commands/resources.ts +0 -95
- package/cli/src/commands/stack.ts +0 -128
- package/cli/src/commands/stacks.ts +0 -52
- package/cli/src/commands/status.ts +0 -88
- package/cli/src/commands/ui.tsx +0 -843
- package/cli/src/commands/up.ts +0 -169
- package/cli/src/commands/upgrade.ts +0 -628
- package/cli/src/commands/version.ts +0 -9
- package/cli/src/components/Accessible.tsx +0 -21
- package/cli/src/components/BaseTooltip.tsx +0 -66
- package/cli/src/components/DetailPanel.tsx +0 -146
- package/cli/src/components/FileTree.tsx +0 -89
- package/cli/src/components/ResourceSelectInput.tsx +0 -30
- package/cli/src/components/ResourceTable.tsx +0 -78
- package/cli/src/components/TabBar.tsx +0 -53
- package/cli/src/components/Tooltip.tsx +0 -11
- package/cli/src/components/index.ts +0 -7
- package/cli/src/config/platform-standards.test.ts +0 -11
- package/cli/src/config/platform-standards.ts +0 -196
- package/cli/src/generator/__tests__/extension-fetch.test.ts +0 -242
- package/cli/src/generator/__tests__/template-engine.test.ts +0 -70
- package/cli/src/generator/extension-fetch.ts +0 -286
- package/cli/src/generator/template-engine.ts +0 -752
- package/cli/src/index.ts +0 -86
- package/cli/src/templates.d.ts +0 -4
- package/cli/src/types/index.ts +0 -353
- package/cli/src/utils/__tests__/cache.test.ts +0 -98
- package/cli/src/utils/__tests__/formatting.test.ts +0 -170
- package/cli/src/utils/__tests__/paths.test.ts +0 -180
- package/cli/src/utils/__tests__/port-assignment.test.ts +0 -121
- package/cli/src/utils/__tests__/service-urls.test.ts +0 -174
- package/cli/src/utils/__tests__/services.test.ts +0 -531
- package/cli/src/utils/__tests__/tilt.test.ts +0 -172
- package/cli/src/utils/__tests__/validation.test.ts +0 -148
- package/cli/src/utils/cache.ts +0 -76
- package/cli/src/utils/command-helpers.ts +0 -54
- package/cli/src/utils/constants.ts +0 -130
- package/cli/src/utils/discovery-context.ts +0 -49
- package/cli/src/utils/docker.ts +0 -20
- package/cli/src/utils/doctor-runtime.ts +0 -644
- package/cli/src/utils/env-validator.ts +0 -139
- package/cli/src/utils/errors.ts +0 -168
- package/cli/src/utils/file-helpers.ts +0 -62
- package/cli/src/utils/formatting.ts +0 -215
- package/cli/src/utils/paths.ts +0 -53
- package/cli/src/utils/port-assignment.ts +0 -106
- package/cli/src/utils/project-features.ts +0 -118
- package/cli/src/utils/project-templates.ts +0 -29
- package/cli/src/utils/prompt.ts +0 -128
- package/cli/src/utils/resource-features.ts +0 -215
- package/cli/src/utils/service-urls.ts +0 -124
- package/cli/src/utils/services.ts +0 -364
- package/cli/src/utils/stack-features.ts +0 -30
- package/cli/src/utils/tar.ts +0 -24
- package/cli/src/utils/tilt.ts +0 -133
- package/cli/src/utils/validation.ts +0 -67
- package/cli/tsconfig.json +0 -25
- package/cli/tsconfig.typecheck.json +0 -8
- package/docs/FEATURES.md +0 -281
- package/docs/demo.svg +0 -217
- package/engine/docs/AUTODISCOVERY_TEST.md +0 -182
- package/engine/docs/C4-ARCHITECTURE-operations.md +0 -396
- package/engine/docs/C4-ARCHITECTURE-overview.md +0 -284
- package/engine/docs/C4-ARCHITECTURE.md +0 -17
- package/engine/docs/GOLDEN_IMAGE_INTEGRATION.md +0 -349
- package/engine/docs/MANIFEST_DRIVEN_ARCHITECTURE.md +0 -357
- package/engine/docs/README.md +0 -284
- package/install.sh +0 -19
- package/knip.json +0 -10
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/.openspec.yaml +0 -2
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/design.md +0 -102
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/proposal.md +0 -31
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-notifications/spec.md +0 -48
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-orchestration/spec.md +0 -63
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-troubleshooting/spec.md +0 -56
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/tasks.md +0 -61
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/design.md +0 -114
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/proposal.md +0 -32
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/manifest-field-migration/spec.md +0 -20
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/resource-terminology-standard/spec.md +0 -20
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/stack-terminology-standard/spec.md +0 -20
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/tasks.md +0 -194
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/design.md +0 -111
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/proposal.md +0 -33
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/function-naming-alignment/spec.md +0 -12
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/optional-parameter-patterns/spec.md +0 -18
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-documentation/spec.md +0 -16
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-naming-consistency/spec.md +0 -12
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-ordering-standard/spec.md +0 -12
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/tasks.md +0 -194
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/design.md +0 -84
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/proposal.md +0 -31
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/codebase-audit/spec.md +0 -27
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/dead-code-cleanup/spec.md +0 -27
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/test-gap-fill/spec.md +0 -23
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/todo-resolution/spec.md +0 -27
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/tasks.md +0 -39
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/design.md +0 -80
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/proposal.md +0 -40
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/spec.md +0 -52
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/tasks.md +0 -51
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/design.md +0 -43
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/proposal.md +0 -29
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/specs/self-contained-generated-projects/spec.md +0 -67
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/tasks.md +0 -27
- package/openspec/changes/optimize-runtime-docker-layers/.openspec.yaml +0 -3
- package/openspec/changes/optimize-runtime-docker-layers/design.md +0 -81
- package/openspec/changes/optimize-runtime-docker-layers/proposal.md +0 -44
- package/openspec/changes/optimize-runtime-docker-layers/specs/runtime-container-footprint/spec.md +0 -79
- package/openspec/changes/optimize-runtime-docker-layers/tasks.md +0 -36
- package/openspec/changes/prioritized-cold-start/.openspec.yaml +0 -4
- package/openspec/changes/prioritized-cold-start/design.md +0 -137
- package/openspec/changes/prioritized-cold-start/proposal.md +0 -41
- package/openspec/changes/prioritized-cold-start/specs/on-demand-resource-startup/spec.md +0 -98
- package/openspec/changes/prioritized-cold-start/tasks.md +0 -69
- package/openspec/config.yaml +0 -1
- package/openspec/specs/manifest-field-migration/spec.md +0 -24
- package/openspec/specs/resource-terminology-standard/spec.md +0 -24
- package/openspec/specs/self-contained-generated-projects/spec.md +0 -67
- package/openspec/specs/stack-terminology-standard/spec.md +0 -24
- package/platform/services/platform/proxy/service.yaml +0 -14
- package/scripts/audit-codebase.sh +0 -213
- package/scripts/autoresearch/layer-eval.sh +0 -65
- package/scripts/benchmark/README.md +0 -25
- package/scripts/benchmark/container-scale.ts +0 -503
- package/scripts/benchmark/pre-release-gate.sh +0 -9
- package/scripts/install-git-hooks.sh +0 -14
- package/scripts/measure-idle-footprint.sh +0 -58
- package/scripts/record-demo.sh +0 -43
- package/scripts/release-binaries.sh +0 -97
- package/scripts/setup-pre-commit.sh +0 -33
- package/scripts/stage-npm-engine.sh +0 -36
- package/tests/tilt-engine/__init__.py +0 -5
- package/tests/tilt-engine/conftest.py +0 -182
- package/tests/tilt-engine/fixtures/appointment-frontend-service.json +0 -11
- package/tests/tilt-engine/fixtures/identity-backend-service.json +0 -12
- package/tests/tilt-engine/fixtures/invalid-service.json +0 -4
- package/tests/tilt-engine/test_agents_md_generator.py +0 -341
- package/tests/tilt-engine/test_agents_md_integration.py +0 -378
- package/tests/tilt-engine/test_cache_operations.py +0 -181
- package/tests/tilt-engine/test_cache_persistence.py +0 -142
- package/tests/tilt-engine/test_code_executor.py +0 -152
- package/tests/tilt-engine/test_code_viewer.py +0 -127
- package/tests/tilt-engine/test_compose_port_anchors.py +0 -310
- package/tests/tilt-engine/test_config_inspector.py +0 -162
- package/tests/tilt-engine/test_daemon_focus_mode.py +0 -89
- package/tests/tilt-engine/test_daemon_polling.py +0 -122
- package/tests/tilt-engine/test_daemon_registration.py +0 -115
- package/tests/tilt-engine/test_daemon_validation.py +0 -107
- package/tests/tilt-engine/test_docker_generator_bugs.py +0 -493
- package/tests/tilt-engine/test_docker_prune.py +0 -119
- package/tests/tilt-engine/test_dockerignore_path_bug.py +0 -82
- package/tests/tilt-engine/test_file_browser.py +0 -193
- package/tests/tilt-engine/test_frontend_basepath_manifest.py +0 -27
- package/tests/tilt-engine/test_health_dependencies.py +0 -130
- package/tests/tilt-engine/test_health_endpoints.py +0 -118
- package/tests/tilt-engine/test_health_tilt_ui.py +0 -85
- package/tests/tilt-engine/test_runtime_container_footprint.py +0 -162
- package/tests/tilt-engine/test_sablier_defer_start.py +0 -237
- package/tests/tilt-engine/test_safety_aliases.py +0 -84
- package/tests/tilt-engine/test_snapshot_diff.py +0 -136
- package/tests/tilt-engine/test_snapshot_persistence.py +0 -163
- package/tests/tilt-engine/test_snapshot_scanning.py +0 -123
- package/tests/tilt-engine/test_standalone_project_boot.py +0 -61
- package/tests/tilt-engine/test_standalone_traefik.py +0 -160
- package/tests/tilt-engine/test_traefik_static_wake_route.py +0 -187
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
|
-
import { chmodSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
-
import { tmpdir } from "node:os";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
6
|
-
|
|
7
|
-
const execSyncMock = vi.fn();
|
|
8
|
-
vi.mock("node:child_process", () => ({
|
|
9
|
-
execSync: (...args: unknown[]) => execSyncMock(...args),
|
|
10
|
-
}));
|
|
11
|
-
|
|
12
|
-
const { upgradeViaBinary, isWritable, parseChecksums } = await import("../upgrade.js");
|
|
13
|
-
|
|
14
|
-
import type { BinaryRelease } from "../upgrade.js";
|
|
15
|
-
|
|
16
|
-
// Regression coverage for: `tdk upgrade` used to only swap the `tdk` binary
|
|
17
|
-
// and leave the bundled tdk-cli/ engine+templates folder next to it stale or
|
|
18
|
-
// missing, so an upgraded binary still crashed with the loadTemplate ENOENT
|
|
19
|
-
// (the exact error this was meant to fix). It must refresh both, every time.
|
|
20
|
-
const BINARY_BYTES = "fake tdk binary";
|
|
21
|
-
const ENGINE_BYTES = "fake engine tarball";
|
|
22
|
-
const sha256 = (text: string) => createHash("sha256").update(text).digest("hex");
|
|
23
|
-
|
|
24
|
-
describe("upgradeViaBinary", () => {
|
|
25
|
-
let installDir: string;
|
|
26
|
-
let tdkPath: string;
|
|
27
|
-
let release: BinaryRelease;
|
|
28
|
-
let checksums: string;
|
|
29
|
-
const downloaded: string[] = [];
|
|
30
|
-
|
|
31
|
-
// Stands in for curl: `curl -fsSL -o "<path>" "<url>"` writes the asset's
|
|
32
|
-
// bytes to <path>; `curl -fsSL "<checksums url>"` returns checksums.txt.
|
|
33
|
-
function fakeExec(command: string): string {
|
|
34
|
-
const download = command.match(/^curl -fsSL -o (".*?") (".*?")$/);
|
|
35
|
-
if (download) {
|
|
36
|
-
const path = JSON.parse(download[1]) as string;
|
|
37
|
-
const url = JSON.parse(download[2]) as string;
|
|
38
|
-
writeFileSync(path, url === release.engineDownloadUrl ? ENGINE_BYTES : BINARY_BYTES);
|
|
39
|
-
downloaded.push(path);
|
|
40
|
-
return "";
|
|
41
|
-
}
|
|
42
|
-
if (command.includes(release.checksumsUrl)) return checksums;
|
|
43
|
-
return "";
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
beforeEach(() => {
|
|
47
|
-
installDir = mkdtempSync(join(tmpdir(), "tdk-upgrade-test-"));
|
|
48
|
-
tdkPath = join(installDir, "tdk");
|
|
49
|
-
release = {
|
|
50
|
-
tag: "v1.3.21",
|
|
51
|
-
assetName: "tdk-darwin-arm64",
|
|
52
|
-
downloadUrl: "https://example.test/tdk-darwin-arm64",
|
|
53
|
-
engineDownloadUrl: "https://example.test/tdk-cli-engine.tar.gz",
|
|
54
|
-
checksumsUrl: "https://example.test/checksums.txt",
|
|
55
|
-
};
|
|
56
|
-
checksums = [
|
|
57
|
-
`${sha256(BINARY_BYTES)} tdk-darwin-arm64`,
|
|
58
|
-
`${sha256("other platform")} tdk-linux-amd64`,
|
|
59
|
-
`${sha256(ENGINE_BYTES)} tdk-cli-engine.tar.gz`,
|
|
60
|
-
].join("\n");
|
|
61
|
-
execSyncMock.mockReset();
|
|
62
|
-
execSyncMock.mockImplementation(fakeExec);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
afterEach(() => {
|
|
66
|
-
rmSync(installDir, { recursive: true, force: true });
|
|
67
|
-
for (const path of downloaded.splice(0)) rmSync(path, { force: true });
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
function commandsRun(): string[] {
|
|
71
|
-
return execSyncMock.mock.calls.map((call) => call[0] as string);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
it("downloads and extracts the bundled engine tarball next to the binary, not just the binary itself", async () => {
|
|
75
|
-
const ok = await upgradeViaBinary(tdkPath, release);
|
|
76
|
-
expect(ok).toBe(true);
|
|
77
|
-
|
|
78
|
-
const commands = commandsRun();
|
|
79
|
-
const engineDir = join(installDir, "tdk-cli");
|
|
80
|
-
|
|
81
|
-
expect(commands.some((c) => c.includes("curl") && c.includes(release.downloadUrl))).toBe(true);
|
|
82
|
-
expect(commands.some((c) => c.includes("curl") && c.includes(release.engineDownloadUrl))).toBe(
|
|
83
|
-
true,
|
|
84
|
-
);
|
|
85
|
-
expect(commands.some((c) => c.startsWith("rm -rf") && c.includes(engineDir))).toBe(true);
|
|
86
|
-
expect(commands.some((c) => c.startsWith("mkdir -p") && c.includes(engineDir))).toBe(true);
|
|
87
|
-
expect(
|
|
88
|
-
commands.some(
|
|
89
|
-
(c) =>
|
|
90
|
-
c.includes("tar -xzf") && c.includes(engineDir) && c.includes("--strip-components=1"),
|
|
91
|
-
),
|
|
92
|
-
).toBe(true);
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
it("downloads both the binary and the engine tarball before installing either", async () => {
|
|
96
|
-
await upgradeViaBinary(tdkPath, release);
|
|
97
|
-
|
|
98
|
-
const commands = commandsRun();
|
|
99
|
-
const binaryCurlIndex = commands.findIndex((c) => c.includes(release.downloadUrl));
|
|
100
|
-
const engineCurlIndex = commands.findIndex((c) => c.includes(release.engineDownloadUrl));
|
|
101
|
-
const mvIndex = commands.findIndex((c) => c.startsWith("mv "));
|
|
102
|
-
const tarIndex = commands.findIndex((c) => c.includes("tar -xzf"));
|
|
103
|
-
|
|
104
|
-
expect(binaryCurlIndex).toBeGreaterThanOrEqual(0);
|
|
105
|
-
expect(engineCurlIndex).toBeGreaterThanOrEqual(0);
|
|
106
|
-
expect(mvIndex).toBeGreaterThan(binaryCurlIndex);
|
|
107
|
-
expect(mvIndex).toBeGreaterThan(engineCurlIndex);
|
|
108
|
-
expect(tarIndex).toBeGreaterThan(engineCurlIndex);
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
it("verifies checksums after both downloads and before installing anything", async () => {
|
|
112
|
-
await upgradeViaBinary(tdkPath, release);
|
|
113
|
-
|
|
114
|
-
const commands = commandsRun();
|
|
115
|
-
const checksumsIndex = commands.findIndex((c) => c.includes(release.checksumsUrl));
|
|
116
|
-
const engineCurlIndex = commands.findIndex((c) => c.includes(release.engineDownloadUrl));
|
|
117
|
-
const mvIndex = commands.findIndex((c) => c.startsWith("mv "));
|
|
118
|
-
|
|
119
|
-
expect(checksumsIndex).toBeGreaterThan(engineCurlIndex);
|
|
120
|
-
expect(mvIndex).toBeGreaterThan(checksumsIndex);
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
it.each([
|
|
124
|
-
[
|
|
125
|
-
"the binary does not match",
|
|
126
|
-
() => checksums.replace(sha256(BINARY_BYTES), sha256("tampered")),
|
|
127
|
-
],
|
|
128
|
-
[
|
|
129
|
-
"the engine tarball does not match",
|
|
130
|
-
() => checksums.replace(sha256(ENGINE_BYTES), sha256("x")),
|
|
131
|
-
],
|
|
132
|
-
["checksums.txt has no entry for the binary", () => checksums.replace("tdk-darwin-arm64", "x")],
|
|
133
|
-
])("refuses to install when %s", async (_case, makeChecksums) => {
|
|
134
|
-
checksums = makeChecksums();
|
|
135
|
-
const ok = await upgradeViaBinary(tdkPath, release);
|
|
136
|
-
|
|
137
|
-
expect(ok).toBe(false);
|
|
138
|
-
const commands = commandsRun();
|
|
139
|
-
expect(commands.some((c) => c.startsWith("mv "))).toBe(false);
|
|
140
|
-
expect(commands.some((c) => c.includes("tar -xzf"))).toBe(false);
|
|
141
|
-
expect(commands.some((c) => c.startsWith("rm -rf"))).toBe(false);
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
it("still installs releases whose checksums.txt predates the engine entry", async () => {
|
|
145
|
-
checksums = checksums
|
|
146
|
-
.split("\n")
|
|
147
|
-
.filter((line) => !line.endsWith("tdk-cli-engine.tar.gz"))
|
|
148
|
-
.join("\n");
|
|
149
|
-
const ok = await upgradeViaBinary(tdkPath, release);
|
|
150
|
-
|
|
151
|
-
expect(ok).toBe(true);
|
|
152
|
-
expect(commandsRun().some((c) => c.startsWith("mv "))).toBe(true);
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
// root ignores the write-permission bit (accessSync(W_OK) legitimately
|
|
156
|
-
// returns true even on a 0o555 dir), so these checks only hold for
|
|
157
|
-
// non-root users.
|
|
158
|
-
const isRoot = process.getuid?.() === 0;
|
|
159
|
-
|
|
160
|
-
it.skipIf(isRoot)(
|
|
161
|
-
"never shells out to sudo, and fails fast without touching the network when the install dir isn't writable",
|
|
162
|
-
async () => {
|
|
163
|
-
chmodSync(installDir, 0o555);
|
|
164
|
-
try {
|
|
165
|
-
const ok = await upgradeViaBinary(tdkPath, release);
|
|
166
|
-
expect(ok).toBe(false);
|
|
167
|
-
expect(execSyncMock).not.toHaveBeenCalled();
|
|
168
|
-
expect(commandsRun().some((c) => c.includes("sudo"))).toBe(false);
|
|
169
|
-
} finally {
|
|
170
|
-
chmodSync(installDir, 0o755);
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
);
|
|
174
|
-
|
|
175
|
-
it.skipIf(isRoot)("isWritable reflects actual filesystem permissions", () => {
|
|
176
|
-
expect(isWritable(installDir)).toBe(true);
|
|
177
|
-
chmodSync(installDir, 0o555);
|
|
178
|
-
try {
|
|
179
|
-
expect(isWritable(installDir)).toBe(false);
|
|
180
|
-
} finally {
|
|
181
|
-
chmodSync(installDir, 0o755);
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
describe("parseChecksums", () => {
|
|
187
|
-
it("reads both text-mode and binary-mode (*name) shasum lines and ignores junk", () => {
|
|
188
|
-
const a = "a".repeat(64);
|
|
189
|
-
const b = "B".repeat(64);
|
|
190
|
-
const sums = parseChecksums(
|
|
191
|
-
`${a} tdk-linux-amd64\n${b} *tdk-cli-engine.tar.gz\n\nnot a checksum line\n`,
|
|
192
|
-
);
|
|
193
|
-
|
|
194
|
-
expect(sums.get("tdk-linux-amd64")).toBe(a);
|
|
195
|
-
expect(sums.get("tdk-cli-engine.tar.gz")).toBe("b".repeat(64));
|
|
196
|
-
expect(sums.size).toBe(2);
|
|
197
|
-
});
|
|
198
|
-
});
|
|
@@ -1,300 +0,0 @@
|
|
|
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
|
-
|
|
7
|
-
const BASH_COMPLETION = `# TDK CLI Bash Completion
|
|
8
|
-
_tdk_completions() {
|
|
9
|
-
local cur prev opts
|
|
10
|
-
COMPREPLY=()
|
|
11
|
-
cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
12
|
-
prev="\${COMP_WORDS[COMP_CWORD-1]}"
|
|
13
|
-
|
|
14
|
-
# Main commands
|
|
15
|
-
local commands="project projects stack stacks resource resources up down status ui doctor version completion help upgrade"
|
|
16
|
-
|
|
17
|
-
# Options for specific commands
|
|
18
|
-
case "\${prev}" in
|
|
19
|
-
tdk)
|
|
20
|
-
COMPREPLY=( $(compgen -W "\${commands}" -- \${cur}) )
|
|
21
|
-
return 0
|
|
22
|
-
;;
|
|
23
|
-
up)
|
|
24
|
-
# Complete with stack names and resource names
|
|
25
|
-
local stacks=$(tdk stacks 2>/dev/null | grep '^ -' | sed 's/^ - //' | awk '{print $1}')
|
|
26
|
-
local resources=$(tdk resources 2>/dev/null | grep -E '^[a-z0-9-]+' | awk '{print $1}')
|
|
27
|
-
COMPREPLY=( $(compgen -W "\${stacks} \${resources}" -- \${cur}) )
|
|
28
|
-
return 0
|
|
29
|
-
;;
|
|
30
|
-
stack)
|
|
31
|
-
# Complete with existing stack names
|
|
32
|
-
local stacks=$(tdk stacks 2>/dev/null | grep '^ -' | sed 's/^ - //' | awk '{print $1}')
|
|
33
|
-
COMPREPLY=( $(compgen -W "\${stacks}" -- \${cur}) )
|
|
34
|
-
return 0
|
|
35
|
-
;;
|
|
36
|
-
resource)
|
|
37
|
-
# Suggest common resource names or types
|
|
38
|
-
COMPREPLY=( $(compgen -W "api frontend backend worker --type --stack" -- \${cur}) )
|
|
39
|
-
return 0
|
|
40
|
-
;;
|
|
41
|
-
--type)
|
|
42
|
-
COMPREPLY=( $(compgen -W "backend frontend worker" -- \${cur}) )
|
|
43
|
-
return 0
|
|
44
|
-
;;
|
|
45
|
-
--stack)
|
|
46
|
-
local stacks=$(tdk stacks 2>/dev/null | grep '^ -' | sed 's/^ - //' | awk '{print $1}')
|
|
47
|
-
COMPREPLY=( $(compgen -W "\${stacks}" -- \${cur}) )
|
|
48
|
-
return 0
|
|
49
|
-
;;
|
|
50
|
-
esac
|
|
51
|
-
|
|
52
|
-
# Global options
|
|
53
|
-
if [[ \${cur} == -* ]]; then
|
|
54
|
-
local options="--verbose --version --help --force --dry-run"
|
|
55
|
-
COMPREPLY=( $(compgen -W "\${options}" -- \${cur}) )
|
|
56
|
-
return 0
|
|
57
|
-
fi
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
complete -F _tdk_completions tdk
|
|
61
|
-
`;
|
|
62
|
-
|
|
63
|
-
const ZSH_COMPLETION = `#compdef tdk
|
|
64
|
-
|
|
65
|
-
# TDK CLI Zsh Completion
|
|
66
|
-
|
|
67
|
-
_tdk() {
|
|
68
|
-
local curcontext="$curcontext" state line
|
|
69
|
-
typeset -A opt_args
|
|
70
|
-
|
|
71
|
-
_arguments -C
|
|
72
|
-
'(-h --help)'{-h,--help}'[Show help]'
|
|
73
|
-
'(-v --version)'{-v,--version}'[Show version]'
|
|
74
|
-
'--verbose[Enable verbose output]'
|
|
75
|
-
'1: :_tdk_commands'
|
|
76
|
-
'*:: :->args'
|
|
77
|
-
|
|
78
|
-
case "$line[1]" in
|
|
79
|
-
up)
|
|
80
|
-
_arguments
|
|
81
|
-
'--verbose[Enable verbose output]'
|
|
82
|
-
'1: :_tdk_stacks_and_resources'
|
|
83
|
-
;;
|
|
84
|
-
stack)
|
|
85
|
-
_arguments
|
|
86
|
-
'--list[List resources without a stack]'
|
|
87
|
-
'1: :_tdk_stacks'
|
|
88
|
-
;;
|
|
89
|
-
stacks)
|
|
90
|
-
_arguments
|
|
91
|
-
'--services[Include resources in each stack]'
|
|
92
|
-
;;
|
|
93
|
-
resource)
|
|
94
|
-
_arguments
|
|
95
|
-
'--type[Resource type]:type:(backend frontend worker)'
|
|
96
|
-
'--stack[Assign to stack]:stack:_tdk_stacks'
|
|
97
|
-
'1:resource name:'
|
|
98
|
-
;;
|
|
99
|
-
resources)
|
|
100
|
-
_arguments
|
|
101
|
-
'--stack[Filter by stack]:stack:_tdk_stacks'
|
|
102
|
-
'--no-stack[Show unassigned only]'
|
|
103
|
-
'--ports[Show port assignments]'
|
|
104
|
-
;;
|
|
105
|
-
projects)
|
|
106
|
-
_arguments
|
|
107
|
-
'--check[Validate master configs]'
|
|
108
|
-
;;
|
|
109
|
-
doctor)
|
|
110
|
-
_arguments
|
|
111
|
-
'--fix[Attempt to fix issues]'
|
|
112
|
-
;;
|
|
113
|
-
upgrade)
|
|
114
|
-
_arguments
|
|
115
|
-
'--force[Force upgrade even if on latest]'
|
|
116
|
-
'--dry-run[Show what would be upgraded]'
|
|
117
|
-
;;
|
|
118
|
-
esac
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
_tdk_commands() {
|
|
122
|
-
local commands=(
|
|
123
|
-
'project:Initialize project with master configs'
|
|
124
|
-
'projects:Show project information'
|
|
125
|
-
'stack:Organize resources into stacks'
|
|
126
|
-
'stacks:List all stacks'
|
|
127
|
-
'resource:Create new resource'
|
|
128
|
-
'resources:List all resources'
|
|
129
|
-
'up:Start services'
|
|
130
|
-
'down:Stop all services'
|
|
131
|
-
'status:Show resource status'
|
|
132
|
-
'ui:Open interactive UI'
|
|
133
|
-
'doctor:Check environment'
|
|
134
|
-
'version:Show version'
|
|
135
|
-
'upgrade:Upgrade TDK CLI'
|
|
136
|
-
'completion:Generate shell completions'
|
|
137
|
-
'help:Show help'
|
|
138
|
-
)
|
|
139
|
-
_describe -t commands 'tdk command' commands
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
_tdk_stacks() {
|
|
143
|
-
local stacks
|
|
144
|
-
stacks=($(tdk stacks 2>/dev/null | grep '^ -' | sed 's/^ - //' | awk '{print $1}'))
|
|
145
|
-
_describe -t stacks 'stack' stacks
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
_tdk_resources() {
|
|
149
|
-
local resources
|
|
150
|
-
resources=($(tdk resources 2>/dev/null | grep -E '^[a-z0-9-]+' | awk '{print $1}'))
|
|
151
|
-
_describe -t resources 'resource' resources
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
_tdk_stacks_and_resources() {
|
|
155
|
-
_tdk_stacks
|
|
156
|
-
_tdk_resources
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
compdef _tdk tdk
|
|
160
|
-
`;
|
|
161
|
-
|
|
162
|
-
const FISH_COMPLETION = `# TDK CLI Fish Completion
|
|
163
|
-
|
|
164
|
-
# Disable file completions for most commands
|
|
165
|
-
complete -c tdk -f
|
|
166
|
-
|
|
167
|
-
# Main commands
|
|
168
|
-
complete -c tdk -n '__fish_use_subcommand' -a 'project' -d 'Initialize project with master configs'
|
|
169
|
-
complete -c tdk -n '__fish_use_subcommand' -a 'projects' -d 'Show project information'
|
|
170
|
-
complete -c tdk -n '__fish_use_subcommand' -a 'stack' -d 'Organize resources into stacks'
|
|
171
|
-
complete -c tdk -n '__fish_use_subcommand' -a 'stacks' -d 'List all stacks'
|
|
172
|
-
complete -c tdk -n '__fish_use_subcommand' -a 'resource' -d 'Create new resource'
|
|
173
|
-
complete -c tdk -n '__fish_use_subcommand' -a 'resources' -d 'List all resources'
|
|
174
|
-
complete -c tdk -n '__fish_use_subcommand' -a 'up' -d 'Start services'
|
|
175
|
-
complete -c tdk -n '__fish_use_subcommand' -a 'down' -d 'Stop all services'
|
|
176
|
-
complete -c tdk -n '__fish_use_subcommand' -a 'status' -d 'Show resource status'
|
|
177
|
-
complete -c tdk -n '__fish_use_subcommand' -a 'ui' -d 'Open interactive UI'
|
|
178
|
-
complete -c tdk -n '__fish_use_subcommand' -a 'doctor' -d 'Check environment'
|
|
179
|
-
complete -c tdk -n '__fish_use_subcommand' -a 'version' -d 'Show version'
|
|
180
|
-
complete -c tdk -n '__fish_use_subcommand' -a 'upgrade' -d 'Upgrade TDK CLI'
|
|
181
|
-
complete -c tdk -n '__fish_use_subcommand' -a 'completion' -d 'Generate shell completions'
|
|
182
|
-
complete -c tdk -n '__fish_use_subcommand' -a 'help' -d 'Show help'
|
|
183
|
-
|
|
184
|
-
# Global options
|
|
185
|
-
complete -c tdk -s h -l help -d 'Show help'
|
|
186
|
-
complete -c tdk -s v -l version -d 'Show version'
|
|
187
|
-
complete -c tdk -l verbose -d 'Enable verbose output'
|
|
188
|
-
|
|
189
|
-
# Command-specific completions
|
|
190
|
-
# resource command options
|
|
191
|
-
complete -c tdk -n '__fish_seen_subcommand_from resource' -l type -d 'Resource type' -a 'backend frontend worker'
|
|
192
|
-
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 " - " "")'
|
|
193
|
-
|
|
194
|
-
# resources command options
|
|
195
|
-
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 " - " "")'
|
|
196
|
-
complete -c tdk -n '__fish_seen_subcommand_from resources' -l no-stack -d 'Show unassigned only'
|
|
197
|
-
complete -c tdk -n '__fish_seen_subcommand_from resources' -l ports -d 'Show port assignments'
|
|
198
|
-
|
|
199
|
-
# stack command options
|
|
200
|
-
complete -c tdk -n '__fish_seen_subcommand_from stack' -l list -d 'List resources without a stack'
|
|
201
|
-
|
|
202
|
-
# stacks command options
|
|
203
|
-
complete -c tdk -n '__fish_seen_subcommand_from stacks' -l services -d 'Include resources in each stack'
|
|
204
|
-
|
|
205
|
-
# projects command options
|
|
206
|
-
complete -c tdk -n '__fish_seen_subcommand_from projects' -l check -d 'Validate master configs'
|
|
207
|
-
|
|
208
|
-
# up command completions
|
|
209
|
-
complete -c tdk -n '__fish_seen_subcommand_from up' -a '(tdk stacks 2>/dev/null | string match -r "^ - " | string replace " - " "")'
|
|
210
|
-
complete -c tdk -n '__fish_seen_subcommand_from up' -a '(tdk resources 2>/dev/null | string match -r "^[a-z0-9-]+")'
|
|
211
|
-
|
|
212
|
-
# doctor command options
|
|
213
|
-
complete -c tdk -n '__fish_seen_subcommand_from doctor' -l fix -d 'Attempt to fix issues'
|
|
214
|
-
|
|
215
|
-
# upgrade command options
|
|
216
|
-
complete -c tdk -n '__fish_seen_subcommand_from upgrade' -l force -d 'Force upgrade even if on latest'
|
|
217
|
-
complete -c tdk -n '__fish_seen_subcommand_from upgrade' -l dry-run -d 'Show what would be upgraded'
|
|
218
|
-
`;
|
|
219
|
-
|
|
220
|
-
export const completionCommand = new Command("completion")
|
|
221
|
-
.description("Generate shell completion scripts")
|
|
222
|
-
.option("-s, --shell <shell>", "Target shell (bash, zsh, fish)", "bash")
|
|
223
|
-
.option("-o, --output <path>", "Output file path (default: stdout)")
|
|
224
|
-
.option("--install", "Install to shell config automatically")
|
|
225
|
-
.action((options) => {
|
|
226
|
-
const shell = options.shell.toLowerCase();
|
|
227
|
-
|
|
228
|
-
let completionScript: string;
|
|
229
|
-
let filename: string;
|
|
230
|
-
|
|
231
|
-
switch (shell) {
|
|
232
|
-
case "bash":
|
|
233
|
-
completionScript = BASH_COMPLETION;
|
|
234
|
-
filename = "tdk-completion.bash";
|
|
235
|
-
break;
|
|
236
|
-
case "zsh":
|
|
237
|
-
completionScript = ZSH_COMPLETION;
|
|
238
|
-
filename = "_tdk";
|
|
239
|
-
break;
|
|
240
|
-
case "fish":
|
|
241
|
-
completionScript = FISH_COMPLETION;
|
|
242
|
-
filename = "tdk.fish";
|
|
243
|
-
break;
|
|
244
|
-
default:
|
|
245
|
-
console.error(chalk.red(`❌ Unsupported shell: ${shell}`));
|
|
246
|
-
console.log(chalk.gray("Supported shells: bash, zsh, fish"));
|
|
247
|
-
process.exit(1);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
if (options.install) {
|
|
251
|
-
const home = homedir();
|
|
252
|
-
let installPath: string;
|
|
253
|
-
let installInstructions: string;
|
|
254
|
-
|
|
255
|
-
switch (shell) {
|
|
256
|
-
case "bash": {
|
|
257
|
-
installPath = join(home, ".bash_completion.d", filename);
|
|
258
|
-
const bashDir = join(home, ".bash_completion.d");
|
|
259
|
-
if (!existsSync(bashDir)) {
|
|
260
|
-
mkdirSync(bashDir, { recursive: true });
|
|
261
|
-
}
|
|
262
|
-
installInstructions = `\n# Add to ~/.bashrc:\nsource ~/.bash_completion.d/${filename}`;
|
|
263
|
-
break;
|
|
264
|
-
}
|
|
265
|
-
case "zsh": {
|
|
266
|
-
installPath = join(home, ".zsh", "completions", filename);
|
|
267
|
-
const zshDir = join(home, ".zsh", "completions");
|
|
268
|
-
if (!existsSync(zshDir)) {
|
|
269
|
-
mkdirSync(zshDir, { recursive: true });
|
|
270
|
-
}
|
|
271
|
-
installInstructions =
|
|
272
|
-
"\n# Add to ~/.zshrc:\nfpath+=(~/.zsh/completions)\nautoload -U compinit && compinit";
|
|
273
|
-
break;
|
|
274
|
-
}
|
|
275
|
-
case "fish": {
|
|
276
|
-
installPath = join(home, ".config", "fish", "completions", filename);
|
|
277
|
-
const fishDir = join(home, ".config", "fish", "completions");
|
|
278
|
-
if (!existsSync(fishDir)) {
|
|
279
|
-
mkdirSync(fishDir, { recursive: true });
|
|
280
|
-
}
|
|
281
|
-
installInstructions = "\n# Fish completions loaded automatically";
|
|
282
|
-
break;
|
|
283
|
-
}
|
|
284
|
-
default:
|
|
285
|
-
installPath = "";
|
|
286
|
-
installInstructions = "";
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
writeFileSync(installPath, completionScript, "utf-8");
|
|
290
|
-
console.log(chalk.green(`✅ Installed ${shell} completion to:`));
|
|
291
|
-
console.log(chalk.cyan(` ${installPath}`));
|
|
292
|
-
console.log(chalk.yellow(installInstructions));
|
|
293
|
-
} else if (options.output) {
|
|
294
|
-
writeFileSync(options.output, completionScript, "utf-8");
|
|
295
|
-
console.log(chalk.green(`✅ Written ${shell} completion to:`));
|
|
296
|
-
console.log(chalk.cyan(` ${options.output}`));
|
|
297
|
-
} else {
|
|
298
|
-
console.log(completionScript);
|
|
299
|
-
}
|
|
300
|
-
});
|