@flisk-sh/flisk 0.0.0-stage → 1.3.190
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 +492 -0
- package/LICENSE +21 -0
- package/README.md +479 -2
- package/Tiltfile +151 -0
- package/cli/bin/flisk.js +42 -0
- package/cli/dist/agent-runtimes/custom.js +335 -0
- package/cli/dist/agent-runtimes/registry.js +34 -0
- package/cli/dist/backend-frameworks/elysia.js +38 -0
- package/cli/dist/backend-frameworks/express.js +49 -0
- package/cli/dist/backend-frameworks/fastify.js +43 -0
- package/cli/dist/backend-frameworks/h3.js +37 -0
- package/cli/dist/backend-frameworks/koa.js +47 -0
- package/cli/dist/backend-frameworks/mcp.js +86 -0
- package/cli/dist/backend-frameworks/nestjs.js +55 -0
- package/cli/dist/backend-frameworks/registry.js +134 -0
- package/cli/dist/backend-frameworks/types.js +1 -0
- package/cli/dist/backend-languages/bun.js +76 -0
- package/cli/dist/backend-languages/go.js +125 -0
- package/cli/dist/backend-languages/node.js +122 -0
- package/cli/dist/backend-languages/python.js +94 -0
- package/cli/dist/backend-languages/registry.js +37 -0
- package/cli/dist/backend-languages/rust.js +82 -0
- package/cli/dist/backend-languages/types.js +1 -0
- package/cli/dist/cli.js +29 -0
- package/cli/dist/commands/__tests__/project-e2e-helpers.js +49 -0
- package/cli/dist/commands/__tests__/ui-loading-screen.test.js +16 -0
- package/cli/dist/commands/agent.js +182 -0
- package/cli/dist/commands/completion-candidates.js +116 -0
- package/cli/dist/commands/completion.js +843 -0
- package/cli/dist/commands/config.js +362 -0
- package/cli/dist/commands/doctor.js +1504 -0
- package/cli/dist/commands/down.js +114 -0
- package/cli/dist/commands/eject.js +108 -0
- package/cli/dist/commands/help.js +152 -0
- package/cli/dist/commands/import.js +164 -0
- package/cli/dist/commands/logs.js +119 -0
- package/cli/dist/commands/maintainers.js +102 -0
- package/cli/dist/commands/mcp.js +28 -0
- package/cli/dist/commands/networks.js +306 -0
- package/cli/dist/commands/project.js +447 -0
- package/cli/dist/commands/projects.js +103 -0
- package/cli/dist/commands/registry.js +53 -0
- package/cli/dist/commands/resource.js +992 -0
- package/cli/dist/commands/resources.js +127 -0
- package/cli/dist/commands/restart.js +89 -0
- package/cli/dist/commands/runtime.js +75 -0
- package/cli/dist/commands/stack.js +171 -0
- package/cli/dist/commands/stacks.js +71 -0
- package/cli/dist/commands/status.js +211 -0
- package/cli/dist/commands/ui.js +725 -0
- package/cli/dist/commands/up.js +609 -0
- package/cli/dist/commands/upgrade.js +840 -0
- package/cli/dist/commands/version.js +10 -0
- package/cli/dist/components/Accessible.js +11 -0
- package/cli/dist/components/BaseTooltip.js +30 -0
- package/cli/dist/components/DetailPanel.js +33 -0
- package/cli/dist/components/FileTree.js +51 -0
- package/cli/dist/components/ResourceSelectInput.js +42 -0
- package/cli/dist/components/ResourceTable.js +35 -0
- package/cli/dist/components/ServiceIssues.js +13 -0
- package/cli/dist/components/TUIHeader.js +27 -0
- package/cli/dist/components/TabBar.js +27 -0
- package/cli/dist/components/Tooltip.js +13 -0
- package/cli/dist/components/index.js +11 -0
- package/cli/dist/components/ui-theme.js +120 -0
- package/cli/dist/config/platform-standards.js +182 -0
- package/cli/dist/frontend-frameworks/lit.js +64 -0
- package/cli/dist/frontend-frameworks/preact.js +62 -0
- package/cli/dist/frontend-frameworks/qwik.js +61 -0
- package/cli/dist/frontend-frameworks/react.js +69 -0
- package/cli/dist/frontend-frameworks/registry.js +83 -0
- package/cli/dist/frontend-frameworks/solid.js +62 -0
- package/cli/dist/frontend-frameworks/svelte.js +67 -0
- package/cli/dist/frontend-frameworks/tanstack-router.js +101 -0
- package/cli/dist/frontend-frameworks/types.js +1 -0
- package/cli/dist/frontend-frameworks/vanilla.js +59 -0
- package/cli/dist/frontend-frameworks/vue.js +72 -0
- package/cli/dist/generator/__tests__/golden-helpers.js +43 -0
- package/cli/dist/generator/extension-fetch.js +291 -0
- package/cli/dist/generator/resource-templates.js +133 -0
- package/cli/dist/generator/template-engine.js +801 -0
- package/cli/dist/index.js +10 -0
- package/cli/dist/mcp/server.js +101 -0
- package/cli/dist/mcp/tools.js +351 -0
- package/cli/dist/program.js +37 -0
- package/cli/dist/types/index.js +38 -0
- package/cli/dist/utils/agent-host.js +36 -0
- package/cli/dist/utils/atomic-write.js +36 -0
- package/cli/dist/utils/bun-floor.js +9 -0
- package/cli/dist/utils/bun-requirement.js +10 -0
- package/cli/dist/utils/cache.js +63 -0
- package/cli/dist/utils/cold-preflight.js +257 -0
- package/cli/dist/utils/command-helpers.js +57 -0
- package/cli/dist/utils/constants.js +160 -0
- package/cli/dist/utils/discovery-context.js +71 -0
- package/cli/dist/utils/discovery-paths.js +93 -0
- package/cli/dist/utils/docker.js +34 -0
- package/cli/dist/utils/doctor-crashloop.js +161 -0
- package/cli/dist/utils/doctor-fix.js +391 -0
- package/cli/dist/utils/doctor-host.js +66 -0
- package/cli/dist/utils/doctor-report.js +78 -0
- package/cli/dist/utils/doctor-runtime.js +880 -0
- package/cli/dist/utils/doctor-starlark.js +132 -0
- package/cli/dist/utils/doctor-wiring.js +698 -0
- package/cli/dist/utils/down-cleanup.js +125 -0
- package/cli/dist/utils/env-validator.js +266 -0
- package/cli/dist/utils/errors.js +175 -0
- package/cli/dist/utils/exec-async.js +31 -0
- package/cli/dist/utils/file-helpers.js +104 -0
- package/cli/dist/utils/formatting.js +165 -0
- package/cli/dist/utils/generated-paths.js +51 -0
- package/cli/dist/utils/help-command.js +11 -0
- package/cli/dist/utils/host-port-config.js +140 -0
- package/cli/dist/utils/host-port-plan.js +100 -0
- package/cli/dist/utils/json-output.js +29 -0
- package/cli/dist/utils/machine-output.js +33 -0
- package/cli/dist/utils/paths.js +43 -0
- package/cli/dist/utils/platform.js +58 -0
- package/cli/dist/utils/port-assignment.js +75 -0
- package/cli/dist/utils/port-conflict-fix.js +25 -0
- package/cli/dist/utils/port-fallback-notice.js +17 -0
- package/cli/dist/utils/port-listener-probe.js +20 -0
- package/cli/dist/utils/project-config-defaults.js +17 -0
- package/cli/dist/utils/project-features.js +91 -0
- package/cli/dist/utils/project-templates.js +32 -0
- package/cli/dist/utils/prompt.js +97 -0
- package/cli/dist/utils/resource-features.js +184 -0
- package/cli/dist/utils/resource-kind.js +9 -0
- package/cli/dist/utils/schema-version-gate.js +45 -0
- package/cli/dist/utils/search-status.js +12 -0
- package/cli/dist/utils/secret-redaction.js +73 -0
- package/cli/dist/utils/service-config-checks.js +189 -0
- package/cli/dist/utils/service-manifest.js +254 -0
- package/cli/dist/utils/service-runtime-state.js +66 -0
- package/cli/dist/utils/service-urls.js +112 -0
- package/cli/dist/utils/services.js +360 -0
- package/cli/dist/utils/shared-infra.js +45 -0
- package/cli/dist/utils/shared-platform-postgres.js +232 -0
- package/cli/dist/utils/single-flight.js +21 -0
- package/cli/dist/utils/smoke.js +401 -0
- package/cli/dist/utils/spinner.js +40 -0
- package/cli/dist/utils/stack-features.js +15 -0
- package/cli/dist/utils/stack-status.js +14 -0
- package/cli/dist/utils/startup-report.js +78 -0
- package/cli/dist/utils/status-message.js +21 -0
- package/cli/dist/utils/status-ports.js +33 -0
- package/cli/dist/utils/suggestions.js +63 -0
- package/cli/dist/utils/tar.js +46 -0
- package/cli/dist/utils/tdk-version.js +51 -0
- package/cli/dist/utils/terminal-layout.js +19 -0
- package/cli/dist/utils/tilt-events.js +194 -0
- package/cli/dist/utils/tilt-logs.js +61 -0
- package/cli/dist/utils/tilt-port-owner.js +63 -0
- package/cli/dist/utils/tilt-process.js +54 -0
- package/cli/dist/utils/tilt-resource-state.js +32 -0
- package/cli/dist/utils/tilt-startup.js +49 -0
- package/cli/dist/utils/tilt-unreachable-message.js +9 -0
- package/cli/dist/utils/tilt.js +104 -0
- package/cli/dist/utils/ui-keymap.js +129 -0
- package/cli/dist/utils/ui-service-state.js +34 -0
- package/cli/dist/utils/up-only.js +28 -0
- package/cli/dist/utils/up-readiness.js +118 -0
- package/cli/dist/utils/url-actions.js +103 -0
- package/cli/dist/utils/validation.js +62 -0
- package/cli/dist/utils/which.js +56 -0
- package/cli/dist/utils/windows-doctor.js +176 -0
- package/cli/dist-bundle/chunk-6EA4DGCY.js +2 -0
- package/cli/dist-bundle/chunk-BZ4H7MM4.js +3 -0
- package/cli/dist-bundle/chunk-CLCUIDBH.js +510 -0
- package/cli/dist-bundle/cli.js +2017 -0
- package/cli/dist-bundle/cold-preflight-SY26O2IG.js +2 -0
- package/cli/dist-bundle/devtools-ZUHXW33W.js +5 -0
- package/cli/dist-bundle/extension-fetch-J4FFH7TJ.js +2 -0
- package/cli/package.json +83 -0
- package/cli/shared-platform-engineering/docker-templates/bun-hoisted-symlink-fix.sh +25 -0
- package/cli/shared-platform-engineering/docker-templates/infisical-entrypoint.sh +466 -0
- package/cli/shared-platform-engineering/docker-templates/install-deps.sh +154 -0
- package/cli/shared-platform-engineering/docker-templates/prisma-bun-client-link-fix.sh +14 -0
- package/cli/shared-platform-engineering/docker-templates/prisma-normalize-client.sh +58 -0
- package/cli/templates/.tiltignore.hbs +72 -0
- package/cli/templates/TILT_RESOURCE_DEFAULTS.star.hbs +220 -0
- package/cli/templates/TILT_TECH_STACK.star.hbs +149 -0
- package/cli/templates/Tiltfile.hbs +381 -0
- package/cli/templates/spec.master.hbs +192 -0
- package/discovery/AGENTS.md +362 -0
- package/discovery/TILT_DISCOVERY.star +429 -0
- package/discovery/Tiltfile +58 -0
- package/discovery/config.star +265 -0
- package/discovery/constants.star +167 -0
- package/discovery/deterministic.star +213 -0
- package/discovery/discovery_daemon.star +193 -0
- package/discovery/discovery_orchestrator.star +492 -0
- package/discovery/filtering.star +7 -0
- package/discovery/identity-management-backend/service.yaml +26 -0
- package/discovery/identity-management-frontend/service.yaml +29 -0
- package/discovery/identity-sdk/service.yaml +9 -0
- package/discovery/incremental_discovery.star +215 -0
- package/discovery/indexing.star +9 -0
- package/discovery/json_manifest_scanner.star +57 -0
- package/discovery/libraries.star +48 -0
- package/discovery/loading.star +25 -0
- package/discovery/manifest/constants.star +106 -0
- package/discovery/manifest/loading.star +418 -0
- package/discovery/manifest/normalize.star +289 -0
- package/discovery/manifest/validation.star +110 -0
- package/discovery/normalization.star +13 -0
- package/discovery/registry.star +562 -0
- package/discovery/resource_snapshot.py +384 -0
- package/discovery/resource_snapshot.star +145 -0
- package/discovery/schemas.star +3 -0
- package/discovery/services/platform/cdc/debezium/nats-connector/service.yaml +9 -0
- package/discovery/services/platform/cdc/nats-http-bridge/service.yaml +9 -0
- package/discovery/services/platform/orchestrator/orchestrator-glue-backend/service.yaml +26 -0
- package/discovery/services/platform/synthetic-monitor/service.yaml +9 -0
- package/discovery/test_resource_snapshot.py +253 -0
- package/discovery/validation.star +80 -0
- package/discovery/versioning.star +3 -0
- package/engine/AGENTS.md +706 -0
- package/engine/README.md +31 -0
- package/engine/REFACTORING_MANIFEST_SYSTEM.md +974 -0
- package/engine/Tiltfile +86 -0
- package/engine/assets/docker/golden-layers.Dockerfile +204 -0
- package/engine/assets/docker/wake-gateway/Dockerfile +28 -0
- package/engine/assets/docker/wake-gateway/decide.test.ts +177 -0
- package/engine/assets/docker/wake-gateway/decide.ts +135 -0
- package/engine/assets/docker/wake-gateway/server.ts +363 -0
- package/engine/assets/scripts/cleanup-completed-migrator-images.sh +39 -0
- package/engine/assets/scripts/cleanup-tilt-images.sh +122 -0
- package/engine/assets/scripts/mac-m1-resource-monitor.sh +123 -0
- package/engine/config.star +5 -0
- package/engine/entrypoint.star +101 -0
- package/engine/lifecycle/orchestrator.star +263 -0
- package/engine/paths.star +719 -0
- package/engine/schemas/project-schema.json +147 -0
- package/engine/schemas/service-schema.json +537 -0
- package/engine/scripts/README.md +89 -0
- package/engine/scripts/build-and-publish-lib.sh +207 -0
- package/engine/scripts/check-lib-publish.sh +87 -0
- package/engine/scripts/debug-container.sh +265 -0
- package/engine/scripts/generate-manifest.sh +200 -0
- package/engine/spec.master +702 -0
- package/engine/spec.master.example +341 -0
- package/engine/topologies/README.md +33 -0
- package/engine/topologies/platform/docker/AGENTS.md +59 -0
- package/engine/topologies/platform/docker/auth/auth.star +207 -0
- package/engine/topologies/platform/docker/build/frontend_build_plan.star +65 -0
- package/engine/topologies/platform/docker/build/golden_image.star +37 -0
- package/engine/topologies/platform/docker/build/golden_image_build.star +144 -0
- package/engine/topologies/platform/docker/build/golden_image_constants.star +100 -0
- package/engine/topologies/platform/docker/build/golden_image_dockerfile.star +263 -0
- package/engine/topologies/platform/docker/compose/compose.star +637 -0
- package/engine/topologies/platform/docker/compose/compose_helpers.star +54 -0
- package/engine/topologies/platform/docker/compose/traefik_standalone.star +171 -0
- package/engine/topologies/platform/docker/config/bunignore.star +144 -0
- package/engine/topologies/platform/docker/config/dockerignore.star +152 -0
- package/engine/topologies/platform/docker/config/healthcheck.star +58 -0
- package/engine/topologies/platform/docker/constants.star +211 -0
- package/engine/topologies/platform/docker/dockerfile/dockerfile.star +56 -0
- package/engine/topologies/platform/docker/dockerfile/language_dockerfile.star +264 -0
- package/engine/topologies/platform/docker/generators/golden_docker_generator_v2.star +76 -0
- package/engine/topologies/platform/docker/index.star +40 -0
- package/engine/topologies/platform/docker/layers/bun_helpers.star +25 -0
- package/engine/topologies/platform/docker/layers/infisical/index.star +42 -0
- package/engine/topologies/platform/docker/layers/infisical/infisical_docker.star +264 -0
- package/engine/topologies/platform/docker/layers/l1_base_layers.star +89 -0
- package/engine/topologies/platform/docker/layers/l2_dependency_layers.star +147 -0
- package/engine/topologies/platform/docker/layers/l3_builder_layers.star +229 -0
- package/engine/topologies/platform/docker/layers/l4_runtime_layers.star +282 -0
- package/engine/topologies/platform/docker/layers/prisma/constants.star +138 -0
- package/engine/topologies/platform/docker/layers/prisma/db_readiness.star +98 -0
- package/engine/topologies/platform/docker/layers/prisma/filesystem_setup.star +131 -0
- package/engine/topologies/platform/docker/layers/prisma/migrate_script.star +100 -0
- package/engine/topologies/platform/docker/layers/prisma/prisma_build.star +128 -0
- package/engine/topologies/platform/docker/layers/prisma/prisma_runtime.star +205 -0
- package/engine/topologies/platform/docker/layers/prisma/secret_resolution.star +121 -0
- package/engine/topologies/platform/docker/networking/api_path_constants.star +206 -0
- package/engine/topologies/platform/docker/networking/sablier_container_cycle.star +31 -0
- package/engine/topologies/platform/docker/networking/traefik.star +266 -0
- package/engine/topologies/platform/docker/networking/traefik_constants.star +148 -0
- package/engine/topologies/platform/docker/networking/traefik_helpers.star +162 -0
- package/engine/topologies/platform/docker/networking/traefik_static_routes.star +165 -0
- package/engine/topologies/platform/docker/secrets/env_secrets.star +74 -0
- package/engine/topologies/platform/docker/secrets/infisical.star +109 -0
- package/engine/topologies/platform/net/AGENTS.md +64 -0
- package/engine/topologies/platform/net/proxy.star +6 -0
- package/engine/topologies/platform/registries/local.star +6 -0
- package/engine/topologies/platform/registries/verdaccio_loader.star +20 -0
- package/engine/topologies/platform/security/AGENTS.md +49 -0
- package/engine/topologies/platform/security/secrets.star +241 -0
- package/engine/topologies/platform/state/AGENTS.md +64 -0
- package/engine/topologies/platform/state/relational.star +6 -0
- package/engine/topologies/tilt/common/AGENTS.md +59 -0
- package/engine/topologies/tilt/common/utils.star +409 -0
- package/engine/topologies/tilt/common/utils_debug.star +71 -0
- package/engine/topologies/tilt/common/utils_deterministic.star +170 -0
- package/engine/topologies/tilt/common/utils_docker_networks.star +54 -0
- package/engine/topologies/tilt/common/utils_env.star +92 -0
- package/engine/topologies/tilt/common/utils_output.star +99 -0
- package/engine/topologies/tilt/config/AGENTS.md +68 -0
- package/engine/topologies/tilt/config/defaults.star +5 -0
- package/engine/topologies/tilt/config/feature_flags.star +12 -0
- package/engine/topologies/tilt/config/global.star +57 -0
- package/engine/topologies/tilt/config/profiles.star +398 -0
- package/engine/topologies/tilt/generators/agents_md.star +64 -0
- package/engine/topologies/tilt/generators/api_gateway.star +147 -0
- package/engine/topologies/tilt/generators/index.star +126 -0
- package/engine/topologies/tilt/generators/infisical/README.md +424 -0
- package/engine/topologies/tilt/generators/infisical/examples.star +314 -0
- package/engine/topologies/tilt/generators/infisical/index.star +59 -0
- package/engine/topologies/tilt/generators/infisical/machine_identity.star +422 -0
- package/engine/topologies/tilt/generators/infisical/organization.star +536 -0
- package/engine/topologies/tilt/generators/infisical/path_manager.star +478 -0
- package/engine/topologies/tilt/generators/infisical/secrets_generator.star +422 -0
- package/engine/topologies/tilt/generators/nginx_conf.star +145 -0
- package/engine/topologies/tilt/generators/npmrc.star +132 -0
- package/engine/topologies/tilt/generators/tsconfig.star +25 -0
- package/engine/topologies/tilt/generators/typescript/backend_library_tsconfig.star +73 -0
- package/engine/topologies/tilt/generators/typescript/backend_tsconfig.star +137 -0
- package/engine/topologies/tilt/generators/typescript/common.star +9 -0
- package/engine/topologies/tilt/generators/typescript/frontend_library_tsconfig.star +78 -0
- package/engine/topologies/tilt/generators/typescript/frontend_tsconfig.star +140 -0
- package/engine/topologies/tilt/generators/typescript/include.star +25 -0
- package/engine/topologies/tilt/generators/typescript/playwright_config.star +42 -0
- package/engine/topologies/tilt/generators/typescript/prisma_config.star +51 -0
- package/engine/topologies/tilt/generators/validators.star +868 -0
- package/engine/topologies/tilt/generators/vite/backend.star +80 -0
- package/engine/topologies/tilt/generators/vite/frameworks/lit.star +92 -0
- package/engine/topologies/tilt/generators/vite/frameworks/preact.star +94 -0
- package/engine/topologies/tilt/generators/vite/frameworks/qwik.star +94 -0
- package/engine/topologies/tilt/generators/vite/frameworks/react.star +128 -0
- package/engine/topologies/tilt/generators/vite/frameworks/solid.star +94 -0
- package/engine/topologies/tilt/generators/vite/frameworks/svelte.star +94 -0
- package/engine/topologies/tilt/generators/vite/frameworks/vanilla.star +92 -0
- package/engine/topologies/tilt/generators/vite/frameworks/vue.star +94 -0
- package/engine/topologies/tilt/generators/vite/frontend.star +153 -0
- package/engine/topologies/tilt/generators/vite/generators.star +45 -0
- package/engine/topologies/tilt/generators/vite/helpers.star +256 -0
- package/engine/topologies/tilt/generators/vite/library.star +67 -0
- package/engine/topologies/tilt/generators/vite/sdk.star +75 -0
- package/engine/topologies/tilt/generators/vite/templates.star +460 -0
- package/engine/topologies/tilt/generators/vite_config.star +24 -0
- package/engine/topologies/tilt/manifest/AGENTS.md +61 -0
- package/engine/topologies/tilt/manifest/README.md +679 -0
- package/engine/topologies/tilt/manifest/__init__.star +220 -0
- package/engine/topologies/tilt/manifest/constants.star +262 -0
- package/engine/topologies/tilt/manifest/errors.star +268 -0
- package/engine/topologies/tilt/manifest/integration.star +348 -0
- package/engine/topologies/tilt/manifest/json_to_yaml.py +61 -0
- package/engine/topologies/tilt/manifest/loader.star +239 -0
- package/engine/topologies/tilt/manifest/mapper.star +229 -0
- package/engine/topologies/tilt/manifest/parser.star +490 -0
- package/engine/topologies/tilt/manifest/schema.star +502 -0
- package/engine/topologies/tilt/manifest/tests/test_integration.star +278 -0
- package/engine/topologies/tilt/manifest/tests/test_loader_parser.star +475 -0
- package/engine/topologies/tilt/manifest/tests/test_manifest.star +319 -0
- package/engine/topologies/tilt/manifest/tests/test_validator.star +472 -0
- package/engine/topologies/tilt/manifest/validator.star +744 -0
- package/engine/topologies/tilt/manifest/yaml_to_json.py +20 -0
- package/engine/topologies/tilt/resources/AGENTS.md +71 -0
- package/engine/topologies/tilt/resources/build_concurrency.star +56 -0
- package/engine/topologies/tilt/resources/conditions.star +5 -0
- package/engine/topologies/tilt/resources/databases.star +246 -0
- package/engine/topologies/tilt/resources/declaration.star +5 -0
- package/engine/topologies/tilt/resources/deps.star +5 -0
- package/engine/topologies/tilt/resources/infra-loader.star +504 -0
- package/engine/topologies/tilt/resources/libs.star +32 -0
- package/engine/topologies/tilt/resources/libs_discovery.star +104 -0
- package/engine/topologies/tilt/resources/libs_paths.star +81 -0
- package/engine/topologies/tilt/resources/libs_resource_definition.star +153 -0
- package/engine/topologies/tilt/resources/libs_setup.star +166 -0
- package/engine/topologies/tilt/resources/libs_tsconfig.star +39 -0
- package/engine/topologies/tilt/resources/orchestrator/apply.star +79 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_compose_resource_registration.star +864 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_manifest_orchestration.star +90 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_migrator_orchestration.star +150 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_resource_validation.star +38 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_runtime_flags.star +46 -0
- package/engine/topologies/tilt/resources/orchestrator/builders/typescript.star +193 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/AGENTS.md +75 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/index.star +23 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/resolver.star +136 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/env.star +219 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/frontend.star +172 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/manifest_resource.star +577 -0
- package/engine/topologies/tilt/resources/orchestrator/helpers.star +35 -0
- package/engine/topologies/tilt/resources/orchestrator.star +56 -0
- package/engine/topologies/tilt/resources/ordering.star +5 -0
- package/engine/topologies/tilt/resources/shared-platform-postgres.star +30 -0
- package/engine/topologies/tilt/resources/triggers.star +5 -0
- package/engine/topologies/tilt/resources/watchers.star +304 -0
- package/engine/where-things-live.star +719 -0
- package/examples/tdk-example/LICENSE +21 -0
- package/examples/tdk-example/README.md +23 -0
- package/examples/tdk-example/TILT_SERVICE_DEFAULTS.star +42 -0
- package/examples/tdk-example/TILT_TECH_STACK.star +67 -0
- package/examples/tdk-example/Tiltfile +25 -0
- package/examples/tdk-example/services/platform/messaging/docker-compose.yml +26 -0
- package/examples/tdk-example/services/shop/orders-api/package.json +20 -0
- package/examples/tdk-example/services/shop/orders-api/service.json +14 -0
- package/examples/tdk-example/services/shop/orders-api/src/index.ts +81 -0
- package/examples/tdk-example/services/shop/orders-app/index.html +12 -0
- package/examples/tdk-example/services/shop/orders-app/package.json +23 -0
- package/examples/tdk-example/services/shop/orders-app/public/.gitkeep +0 -0
- package/examples/tdk-example/services/shop/orders-app/service.json +9 -0
- package/examples/tdk-example/services/shop/orders-app/src/main.tsx +9 -0
- package/examples/tdk-example/services/shop/orders-app/src/orders.tsx +67 -0
- package/examples/tdk-example/services/shop/orders-app/src/style.css +15 -0
- package/examples/tdk-example/services/shop/orders-worker/package.json +18 -0
- package/examples/tdk-example/services/shop/orders-worker/service.json +13 -0
- package/examples/tdk-example/services/shop/orders-worker/src/index.ts +33 -0
- package/ext/Tiltfile +66 -0
- package/ext/ide-components/README.md +221 -0
- package/ext/ide-components/code_viewer/server.py +208 -0
- package/ext/ide-components/config_inspector/server.py +1052 -0
- package/ext/ide-components/file_browser/server.py +287 -0
- package/ext/ide-components/shared/config_service.py +471 -0
- package/ext/ide-components/shared/file_utils.py +300 -0
- package/ext/ide-components/shared/http_utils.py +234 -0
- package/ext/ide-components/shared/static/styles.css +1334 -0
- package/ext/ide-components/shared/syntax_highlighter.py +142 -0
- package/ext/ide-components/shared/template_engine.py +125 -0
- package/ext/ide-components/shared/templates/base.html +121 -0
- package/ext/ide-components/shared/test_config_service.py +328 -0
- package/ext/ide-components/shared/tilt_integration.py +160 -0
- package/ext/ui-enhancements/cron-status-server.sh +51 -0
- package/ext/ui-enhancements/cron-status-tracker.sh +148 -0
- package/ext/ui-enhancements/extension.yaml +36 -0
- package/ext/ui-enhancements/tiltfile.py +101 -0
- package/ext/ui-enhancements/ui/cron-jobs-tab.css +396 -0
- package/ext/ui-enhancements/ui/help-panel.css +279 -0
- package/ext/ui-enhancements/ui/icons.css +125 -0
- package/ext/ui-enhancements/ui/tooltips.css +114 -0
- package/package.json +94 -4
- package/shared-platform-engineering/docker-templates/bun-hoisted-symlink-fix.sh +25 -0
- package/shared-platform-engineering/docker-templates/infisical-entrypoint.sh +466 -0
- package/shared-platform-engineering/docker-templates/install-deps.sh +154 -0
- package/shared-platform-engineering/docker-templates/prisma-bun-client-link-fix.sh +14 -0
- package/shared-platform-engineering/docker-templates/prisma-normalize-client.sh +58 -0
- package/specs/specs/TILT_SERVICE_DEFAULTS.star +207 -0
- package/specs/specs/TILT_TECH_STACK.star +161 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import chalk from "chalk";
|
|
4
|
+
import { Command } from "commander";
|
|
5
|
+
import { readProjectConfig } from "../generator/template-engine.js";
|
|
6
|
+
import { addYesOption, handleDryRun } from "../utils/command-helpers.js";
|
|
7
|
+
import { pruneProjectNetworks, stopProjectTiltUp, waitForTiltUpExit, } from "../utils/down-cleanup.js";
|
|
8
|
+
import { errorFactories, handleTiltFailure, withTiltCheck } from "../utils/errors.js";
|
|
9
|
+
import { createJsonEmitter } from "../utils/json-output.js";
|
|
10
|
+
import { writeMachineError } from "../utils/machine-output.js";
|
|
11
|
+
import { findProjectRoot } from "../utils/paths.js";
|
|
12
|
+
import { discoverResources, discoverStacks } from "../utils/services.js";
|
|
13
|
+
import { buildTiltDownArgs, getTiltfilePath, runTilt } from "../utils/tilt.js";
|
|
14
|
+
function allStackNames() {
|
|
15
|
+
try {
|
|
16
|
+
const names = discoverStacks(discoverResources()).map((stack) => stack.name);
|
|
17
|
+
return names.length > 0 ? names : undefined;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function pruneNetworksOrWarn(json) {
|
|
24
|
+
const root = findProjectRoot();
|
|
25
|
+
if (!root)
|
|
26
|
+
return undefined;
|
|
27
|
+
try {
|
|
28
|
+
const result = pruneProjectNetworks(readProjectConfig(root).project.name);
|
|
29
|
+
if (!json) {
|
|
30
|
+
if (result.removed.length > 0) {
|
|
31
|
+
console.log(chalk.gray(`Removed networks: ${result.removed.join(", ")}`));
|
|
32
|
+
}
|
|
33
|
+
for (const kept of result.kept) {
|
|
34
|
+
console.log(chalk.yellow(`Kept network ${kept.name}: ${kept.reason}`));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
if (!json) {
|
|
41
|
+
console.log(chalk.yellow(`Could not remove networks: ${err.message}`));
|
|
42
|
+
}
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export const downCommand = addYesOption(new Command("down"))
|
|
47
|
+
.description("Stop all tilt resources")
|
|
48
|
+
.option("-v, --verbose", "Enable verbose output", false)
|
|
49
|
+
.option("-f, --force", "Deprecated alias for --yes; accepted for script compatibility", false)
|
|
50
|
+
.option("--prune-networks", "Also remove this project's Docker networks (only those no container is attached to)", false)
|
|
51
|
+
.option("--dry-run", "Show what would be stopped without stopping", false)
|
|
52
|
+
.option("--json", "Print one JSON object on stdout; implies quiet human output", false)
|
|
53
|
+
.action(async (options) => {
|
|
54
|
+
if (!findProjectRoot()) {
|
|
55
|
+
const projectRootError = errorFactories.notInProject();
|
|
56
|
+
if (options.json)
|
|
57
|
+
writeMachineError(projectRootError);
|
|
58
|
+
projectRootError.exit();
|
|
59
|
+
}
|
|
60
|
+
if (options.force) {
|
|
61
|
+
options.yes = true;
|
|
62
|
+
if (!options.json) {
|
|
63
|
+
console.warn(chalk.yellow("Note: --force (-f) on flisk down is deprecated; use --yes (-y) instead."));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const emit = options.json ? createJsonEmitter("DOWN_FAILED", "flisk down") : undefined;
|
|
67
|
+
await withTiltCheck(async () => {
|
|
68
|
+
if (emit && options.dryRun) {
|
|
69
|
+
emit({ ok: true, dryRun: true });
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (handleDryRun(options, "not stopping resources", "tilt down")) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const tiltArgs = buildTiltDownArgs({
|
|
76
|
+
focusTargets: allStackNames(),
|
|
77
|
+
});
|
|
78
|
+
// Stop `tilt up` first: `tilt down` does not end it, and a live Tilt re-creates the containers `tilt down` just removed.
|
|
79
|
+
let stoppedTilt = [];
|
|
80
|
+
try {
|
|
81
|
+
const tiltfile = getTiltfilePath();
|
|
82
|
+
stoppedTilt = stopProjectTiltUp(tiltfile);
|
|
83
|
+
if (stoppedTilt.length > 0)
|
|
84
|
+
await waitForTiltUpExit(tiltfile);
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
// Not fatal: the containers are already down.
|
|
88
|
+
}
|
|
89
|
+
if (stoppedTilt.length > 0 && !options.json) {
|
|
90
|
+
console.log(chalk.gray(`Stopped tilt up (pid ${stoppedTilt.join(", ")}).`));
|
|
91
|
+
}
|
|
92
|
+
if (!options.json)
|
|
93
|
+
console.log(chalk.blue("Stopping all tilt resources..."));
|
|
94
|
+
if (options.verbose && !options.json) {
|
|
95
|
+
console.log(chalk.gray("Running: tilt down -f .tdk/.tdk-out/Tiltfile"));
|
|
96
|
+
}
|
|
97
|
+
const result = await runTilt("down", tiltArgs, {
|
|
98
|
+
verbose: options.verbose && !options.json,
|
|
99
|
+
inheritStdio: !options.json,
|
|
100
|
+
});
|
|
101
|
+
if (result.exitCode !== 0) {
|
|
102
|
+
handleTiltFailure("down", result.exitCode);
|
|
103
|
+
}
|
|
104
|
+
let networks;
|
|
105
|
+
if (options.pruneNetworks) {
|
|
106
|
+
networks = pruneNetworksOrWarn(options.json);
|
|
107
|
+
}
|
|
108
|
+
emit?.({
|
|
109
|
+
ok: true,
|
|
110
|
+
stoppedTilt,
|
|
111
|
+
...(networks ? { removedNetworks: networks.removed, keptNetworks: networks.kept } : {}),
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
});
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { existsSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import chalk from "chalk";
|
|
6
|
+
import { Command } from "commander";
|
|
7
|
+
import { addYesOption, confirmOrCancel, handleDryRun } from "../utils/command-helpers.js";
|
|
8
|
+
import { errorFactories, runCommand } from "../utils/errors.js";
|
|
9
|
+
import { findProjectRoot } from "../utils/paths.js";
|
|
10
|
+
// Same location `flisk up` hands to Tilt (see getTiltfilePath in utils/tilt.ts), relative to the project root.
|
|
11
|
+
export const TILTFILE_RELATIVE_PATH = ".tdk/.tdk-out/Tiltfile";
|
|
12
|
+
export const TILT_UP_COMMAND = `tilt up -f ${TILTFILE_RELATIVE_PATH} -- --focus=<stack>`;
|
|
13
|
+
export const EJECTED_CONTENT = `# Ejected from Flisk
|
|
14
|
+
|
|
15
|
+
\`flisk eject\` wrote this file and nothing else. It did not copy, move or generate anything, and it did
|
|
16
|
+
not remove Flisk. What exists is what Flisk had already generated, and that is still Flisk-owned output.
|
|
17
|
+
|
|
18
|
+
## Where the generated files are
|
|
19
|
+
|
|
20
|
+
- \`.tdk/.tdk-out/\` holds the Tiltfile and the engine it loads (\`tdk-cli-ext/\`). It is git-ignored.
|
|
21
|
+
\`flisk config regenerate\` rewrites the master files in it.
|
|
22
|
+
- The per-service Compose files (\`services/<stack>/<name>/.autogenerated/\`), the golden-layer
|
|
23
|
+
Dockerfile and the Traefik file (\`.tdk/.tdk-out/\`) are written by Tilt when it runs, not by
|
|
24
|
+
\`flisk eject\`. Until Tilt has run they do not exist. They are git-ignored too.
|
|
25
|
+
- Your own Dockerfiles, \`service.json\` files and source code are untouched.
|
|
26
|
+
|
|
27
|
+
## Running the stack without the flisk CLI
|
|
28
|
+
|
|
29
|
+
There is no Tiltfile at the project root, so a plain \`tilt up\` does not find one. Flisk runs:
|
|
30
|
+
|
|
31
|
+
${TILT_UP_COMMAND}
|
|
32
|
+
|
|
33
|
+
from the project root (\`<stack>\` is a stack name under \`services/\`; without \`--focus\` the Tiltfile
|
|
34
|
+
falls back to its default phase). The Tiltfile still reads \`.tdk/project.json\` and the
|
|
35
|
+
\`service.json\` files, so those must stay. \`flisk up\` also does steps before Tilt starts (it chooses
|
|
36
|
+
host ports and exports them to Tilt); running Tilt by hand skips them.
|
|
37
|
+
|
|
38
|
+
## Cleaning up
|
|
39
|
+
|
|
40
|
+
Optional to delete later: this file, and \`.tdk/\` plus the \`service.json\` files if you stop using Flisk.
|
|
41
|
+
Deleting them also removes what the Tiltfile needs.
|
|
42
|
+
|
|
43
|
+
To go back to Flisk: install it and run \`flisk config regenerate\`.
|
|
44
|
+
`;
|
|
45
|
+
export const ejectCommand = addYesOption(new Command("eject"))
|
|
46
|
+
.description("Write EJECTED.md describing the generated Tilt files (copies and generates nothing; they stay in .tdk/.tdk-out/)")
|
|
47
|
+
.option("--dry-run", "List the generated files and what would be written, without changing the project", false)
|
|
48
|
+
.action(async (options) => {
|
|
49
|
+
await runCommand(async () => {
|
|
50
|
+
const projectRoot = findProjectRoot();
|
|
51
|
+
if (!projectRoot) {
|
|
52
|
+
throw errorFactories.notInProject();
|
|
53
|
+
}
|
|
54
|
+
const generatedPaths = [".tdk/.tdk-out"];
|
|
55
|
+
const presentPaths = generatedPaths.filter((path) => existsSync(join(projectRoot, path)));
|
|
56
|
+
const files = presentPaths.flatMap((path) => {
|
|
57
|
+
const absolutePath = join(projectRoot, path);
|
|
58
|
+
if (statSync(absolutePath).isFile())
|
|
59
|
+
return [path];
|
|
60
|
+
try {
|
|
61
|
+
return readdirSync(absolutePath, { recursive: true }).map((entry) => join(path, entry.toString()));
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return [path];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
if (!existsSync(join(projectRoot, ".tdk", ".tdk-out", "Tiltfile"))) {
|
|
68
|
+
throw new Error("Generated Tilt files are missing. Run `flisk project --yes` before ejecting.");
|
|
69
|
+
}
|
|
70
|
+
const rootTiltfile = join(projectRoot, "Tiltfile");
|
|
71
|
+
const userTiltfile = existsSync(rootTiltfile) ? ["Tiltfile"] : [];
|
|
72
|
+
const ejectedPath = join(projectRoot, "EJECTED.md");
|
|
73
|
+
const willCreate = existsSync(ejectedPath) ? [] : ["EJECTED.md"];
|
|
74
|
+
// eject's plan is a file list, not the standard "Dry run - ..." pair, so it supplies its own printer.
|
|
75
|
+
if (handleDryRun(options, "", "", () => {
|
|
76
|
+
console.log("Generated files, left where they are (git-ignored):");
|
|
77
|
+
for (const path of files)
|
|
78
|
+
console.log(` ${path}`);
|
|
79
|
+
if (userTiltfile.length > 0) {
|
|
80
|
+
console.log("Root Tiltfile, left where it is (not generated, not git-ignored):");
|
|
81
|
+
for (const path of userTiltfile)
|
|
82
|
+
console.log(` ${path}`);
|
|
83
|
+
}
|
|
84
|
+
console.log("Files written:");
|
|
85
|
+
for (const path of willCreate)
|
|
86
|
+
console.log(` ${path}`);
|
|
87
|
+
if (willCreate.length === 0)
|
|
88
|
+
console.log(" (none)");
|
|
89
|
+
})) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (!options.yes &&
|
|
93
|
+
!(await confirmOrCancel("Write EJECTED.md? (Generated files stay in .tdk/.tdk-out/; nothing is copied or moved.)"))) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (existsSync(ejectedPath)) {
|
|
97
|
+
console.log(chalk.green("EJECTED.md already exists and was left unchanged. Nothing was copied, moved or generated."));
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
writeFileSync(ejectedPath, EJECTED_CONTENT, { flag: "wx" });
|
|
101
|
+
console.log(chalk.green("Wrote EJECTED.md. Nothing was copied, moved or generated."));
|
|
102
|
+
}
|
|
103
|
+
console.log("Generated files stay in .tdk/.tdk-out/ (git-ignored) and still need Flisk inputs.");
|
|
104
|
+
console.log(`Run from the project root: ${TILT_UP_COMMAND}`);
|
|
105
|
+
console.log("Replace <stack> with a stack name under services/, or omit --focus to use the Tiltfile's default phase.");
|
|
106
|
+
console.log("Read EJECTED.md");
|
|
107
|
+
});
|
|
108
|
+
});
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import chalk from "chalk";
|
|
4
|
+
import pkg from "../../package.json" with { type: "json" };
|
|
5
|
+
const TDK_BANNER = `
|
|
6
|
+
${chalk.bold.cyan("flisk")} ${chalk.gray(`v${pkg.version}`)} ${chalk.white("Flisk CLI — start services on your machine.")}
|
|
7
|
+
`;
|
|
8
|
+
const COMMAND_GROUPS = [
|
|
9
|
+
{
|
|
10
|
+
title: "Project Level",
|
|
11
|
+
color: chalk.blue,
|
|
12
|
+
commands: [
|
|
13
|
+
{
|
|
14
|
+
name: "project",
|
|
15
|
+
desc: "Initialize master configs (TILT_RESOURCE_DEFAULTS.star)",
|
|
16
|
+
alias: "",
|
|
17
|
+
},
|
|
18
|
+
{ name: "projects, info", desc: "Show project information and config status", alias: "" },
|
|
19
|
+
{
|
|
20
|
+
name: "import",
|
|
21
|
+
desc: "Import the services a directory describes",
|
|
22
|
+
alias: "[dir] --dry-run --yes",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "eject",
|
|
26
|
+
desc: "Write EJECTED.md describing the generated Tilt files",
|
|
27
|
+
alias: "--dry-run --yes",
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
title: "Stack Level",
|
|
33
|
+
color: chalk.magenta,
|
|
34
|
+
commands: [
|
|
35
|
+
{ name: "stack", desc: "Organize resources into stacks (interactive)", alias: "" },
|
|
36
|
+
{ name: "stacks, ls", desc: "List all stacks and their resources", alias: "" },
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
title: "Resource Level",
|
|
41
|
+
color: chalk.yellow,
|
|
42
|
+
commands: [
|
|
43
|
+
{ name: "resource", desc: "Create new resource with templates", alias: "" },
|
|
44
|
+
{ name: "resources", desc: "List all resources with filtering", alias: "--stack, --ports" },
|
|
45
|
+
{
|
|
46
|
+
name: "agent",
|
|
47
|
+
desc: "Inspect and operate AI agent resources",
|
|
48
|
+
alias: "sessions <resource>",
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
title: "Lifecycle",
|
|
54
|
+
color: chalk.green,
|
|
55
|
+
commands: [
|
|
56
|
+
{ name: "up, deploy", desc: "Start services (optionally by stack)", alias: "[stack-name]" },
|
|
57
|
+
{ name: "down", desc: "Stop all tilt resources", alias: "" },
|
|
58
|
+
{ name: "restart", desc: "Restart a running resource in the stack", alias: "<resource>" },
|
|
59
|
+
{ name: "status", desc: "Show status of services and stacks", alias: "" },
|
|
60
|
+
{ name: "logs", desc: "Print recent logs from the running stack", alias: "--json" },
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
title: "Networking",
|
|
65
|
+
color: chalk.blueBright,
|
|
66
|
+
commands: [
|
|
67
|
+
{
|
|
68
|
+
name: "networks, traefik",
|
|
69
|
+
desc: "Show Traefik-routed URLs for all services",
|
|
70
|
+
alias: "--stack, --json",
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
title: "Utilities",
|
|
76
|
+
color: chalk.cyan,
|
|
77
|
+
commands: [
|
|
78
|
+
{ name: "ui, interactive", desc: "Interactive TUI for managing services", alias: "" },
|
|
79
|
+
{
|
|
80
|
+
name: "config",
|
|
81
|
+
desc: "Manage project configuration and regenerate master files",
|
|
82
|
+
alias: "regenerate, verify, edit",
|
|
83
|
+
},
|
|
84
|
+
{ name: "doctor", desc: "Check environment readiness", alias: "" },
|
|
85
|
+
{ name: "mcp", desc: "Run an MCP server over stdio for coding agents", alias: "" },
|
|
86
|
+
{
|
|
87
|
+
name: "runtime",
|
|
88
|
+
desc: "Inspect packaged engine and template assets",
|
|
89
|
+
alias: "--check-assets",
|
|
90
|
+
},
|
|
91
|
+
{ name: "completion", desc: "Generate shell completions", alias: "--install --shell zsh" },
|
|
92
|
+
{ name: "upgrade, update", desc: "Self-update to latest version", alias: "--force --all" },
|
|
93
|
+
{ name: "version, -v", desc: "Display version number", alias: "" },
|
|
94
|
+
{ name: "help", desc: "Show help", alias: "[command]" },
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
];
|
|
98
|
+
/** Every command name and alias that the help table lists. */
|
|
99
|
+
export function listedCommandNames() {
|
|
100
|
+
return COMMAND_GROUPS.flatMap((group) => group.commands.flatMap((command) => command.name.split(",").map((name) => name.trim())));
|
|
101
|
+
}
|
|
102
|
+
function formatCommand(name, desc, alias, color) {
|
|
103
|
+
const nameFormatted = color(name.padEnd(20));
|
|
104
|
+
const descFormatted = chalk.white(desc);
|
|
105
|
+
const aliasFormatted = alias ? chalk.gray(` ${alias}`) : "";
|
|
106
|
+
return ` ${nameFormatted} ${descFormatted}${aliasFormatted}`;
|
|
107
|
+
}
|
|
108
|
+
export function showHelp() {
|
|
109
|
+
console.log(TDK_BANNER);
|
|
110
|
+
console.log(chalk.gray("\n Local development inner loop; Flisk does not replace Helm for cluster deployments.\n"));
|
|
111
|
+
console.log(chalk.bold.white(" Project → Phase → Stack → Resource\n"));
|
|
112
|
+
console.log(chalk.gray(" Usage: flisk [command] [options]\n"));
|
|
113
|
+
console.log(chalk.bold.yellow(" Global Options:"));
|
|
114
|
+
console.log(` ${chalk.cyan("-v, --version".padEnd(20))} ${chalk.white("Display version number")}`);
|
|
115
|
+
console.log(` ${chalk.cyan("--verbose".padEnd(20))} ${chalk.white("Enable verbose output")}`);
|
|
116
|
+
console.log(` ${chalk.cyan("-h, --help".padEnd(20))} ${chalk.white("Show help")}`);
|
|
117
|
+
console.log();
|
|
118
|
+
for (const group of COMMAND_GROUPS) {
|
|
119
|
+
console.log(group.color.bold(` ${group.title}`));
|
|
120
|
+
console.log(group.color(` ${"─".repeat(50)}`));
|
|
121
|
+
for (const cmd of group.commands) {
|
|
122
|
+
console.log(formatCommand(cmd.name, cmd.desc, cmd.alias, group.color));
|
|
123
|
+
}
|
|
124
|
+
console.log();
|
|
125
|
+
}
|
|
126
|
+
console.log(chalk.bold.yellow(" Quick start:"));
|
|
127
|
+
console.log(chalk.gray(` ${"─".repeat(50)}`));
|
|
128
|
+
console.log(chalk.white(`
|
|
129
|
+
${chalk.cyan("1.")} Initialize project: ${chalk.green("flisk project")}
|
|
130
|
+
${chalk.cyan("2.")} Create a resource: ${chalk.green("flisk resource my-api --type backend")}
|
|
131
|
+
${chalk.cyan("3.")} Assign to stack: ${chalk.green("flisk stack my-stack")}
|
|
132
|
+
${chalk.cyan("4.")} Start development: ${chalk.green("flisk up my-stack")}
|
|
133
|
+
`));
|
|
134
|
+
console.log(chalk.bold.yellow(" Examples:"));
|
|
135
|
+
console.log(chalk.gray(` ${"─".repeat(50)}`));
|
|
136
|
+
console.log(chalk.white(`
|
|
137
|
+
${chalk.cyan("$")} flisk project # Create master configs
|
|
138
|
+
${chalk.cyan("$")} flisk resource api --type backend # Create a backend service
|
|
139
|
+
${chalk.cyan("$")} flisk resource app --type frontend # Create a frontend app
|
|
140
|
+
${chalk.cyan("$")} flisk resource bot --type agent # Create an AI agent (sessions survive flisk down)
|
|
141
|
+
${chalk.cyan("$")} flisk stacks --services # List stacks with their resources
|
|
142
|
+
${chalk.cyan("$")} flisk up my-stack # Start a stack
|
|
143
|
+
${chalk.cyan("$")} flisk networks # Show Traefik-routed URLs
|
|
144
|
+
${chalk.cyan("$")} flisk doctor # Check your environment
|
|
145
|
+
${chalk.cyan("$")} flisk upgrade # Self-update
|
|
146
|
+
${chalk.cyan("$")} flisk upgrade --all # Update all Flisk installs on PATH
|
|
147
|
+
`));
|
|
148
|
+
console.log(chalk.gray(` ${"═".repeat(50)}`));
|
|
149
|
+
console.log(chalk.gray(` For more help: ${chalk.cyan("flisk help [command]")}`));
|
|
150
|
+
console.log(chalk.gray(` GitHub: ${chalk.cyan("https://github.com/flisk-sh/flisk")}`));
|
|
151
|
+
console.log();
|
|
152
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
import { Command } from "commander";
|
|
5
|
+
import { addYesOption } from "../utils/command-helpers.js";
|
|
6
|
+
import { getPackageVersion } from "../utils/paths.js";
|
|
7
|
+
/**
|
|
8
|
+
* The importer lives in its own repo so it can ship without a CLI release, and is run from npm at a
|
|
9
|
+
* pinned version so a push to its main branch cannot change what `flisk import` does. Move the pin
|
|
10
|
+
* when a new importer is published. `TDK_IMPORT_PACKAGE` overrides the package spec.
|
|
11
|
+
*/
|
|
12
|
+
export const IMPORT_PACKAGE = "@tdk-landscape/tdk-import@0.2.1";
|
|
13
|
+
/** Minimum Flisk core release supporting buildContext required by flisk import (#634). */
|
|
14
|
+
export const MIN_CORE_VERSION = "1.3.104";
|
|
15
|
+
/** Recommended core version with automatic Tiltfile bootstrapping for imported stacks (#1018). */
|
|
16
|
+
export const RECOMMENDED_CORE_VERSION = "1.3.145";
|
|
17
|
+
/** Parses a semver version string, extracting major, minor, patch, and prerelease identifiers. */
|
|
18
|
+
export function parseSemver(raw) {
|
|
19
|
+
const cleaned = raw.trim().replace(/^v/, "").split("+")[0];
|
|
20
|
+
const match = cleaned.match(/^(\d+)\.(\d+)(?:\.(\d+))?(?:-([0-9A-Za-z.-]+))?$/);
|
|
21
|
+
if (!match)
|
|
22
|
+
return null;
|
|
23
|
+
const major = Number(match[1]);
|
|
24
|
+
const minor = Number(match[2]);
|
|
25
|
+
const patch = Number(match[3] ?? 0);
|
|
26
|
+
const prereleaseRaw = match[4];
|
|
27
|
+
const prerelease = prereleaseRaw
|
|
28
|
+
? prereleaseRaw.split(".").map((part) => (/^\d+$/.test(part) ? Number(part) : part))
|
|
29
|
+
: [];
|
|
30
|
+
return { major, minor, patch, prerelease };
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Compares two semver version strings per the SemVer 2.0.0 specification:
|
|
34
|
+
* Returns 1 if a > b, -1 if a < b, 0 if a === b, or null if either is unparseable.
|
|
35
|
+
*/
|
|
36
|
+
export function compareSemver(aStr, bStr) {
|
|
37
|
+
const a = parseSemver(aStr);
|
|
38
|
+
const b = parseSemver(bStr);
|
|
39
|
+
if (!a || !b)
|
|
40
|
+
return null;
|
|
41
|
+
if (a.major !== b.major)
|
|
42
|
+
return a.major > b.major ? 1 : -1;
|
|
43
|
+
if (a.minor !== b.minor)
|
|
44
|
+
return a.minor > b.minor ? 1 : -1;
|
|
45
|
+
if (a.patch !== b.patch)
|
|
46
|
+
return a.patch > b.patch ? 1 : -1;
|
|
47
|
+
const aHasPre = a.prerelease.length > 0;
|
|
48
|
+
const bHasPre = b.prerelease.length > 0;
|
|
49
|
+
// A normal version has greater precedence than a prerelease of the same major.minor.patch
|
|
50
|
+
if (aHasPre && !bHasPre)
|
|
51
|
+
return -1;
|
|
52
|
+
if (!aHasPre && bHasPre)
|
|
53
|
+
return 1;
|
|
54
|
+
if (!aHasPre && !bHasPre)
|
|
55
|
+
return 0;
|
|
56
|
+
const len = Math.max(a.prerelease.length, b.prerelease.length);
|
|
57
|
+
for (let i = 0; i < len; i++) {
|
|
58
|
+
const pA = a.prerelease[i];
|
|
59
|
+
const pB = b.prerelease[i];
|
|
60
|
+
if (pA === undefined)
|
|
61
|
+
return -1;
|
|
62
|
+
if (pB === undefined)
|
|
63
|
+
return 1;
|
|
64
|
+
if (pA === pB)
|
|
65
|
+
continue;
|
|
66
|
+
const numA = typeof pA === "number";
|
|
67
|
+
const numB = typeof pB === "number";
|
|
68
|
+
if (numA && !numB)
|
|
69
|
+
return -1;
|
|
70
|
+
if (!numA && numB)
|
|
71
|
+
return 1;
|
|
72
|
+
if (numA && numB) {
|
|
73
|
+
return pA > pB ? 1 : -1;
|
|
74
|
+
}
|
|
75
|
+
return pA.localeCompare(pB) > 0 ? 1 : -1;
|
|
76
|
+
}
|
|
77
|
+
return 0;
|
|
78
|
+
}
|
|
79
|
+
/** Compares two semver version strings. Returns true if current >= minimum. */
|
|
80
|
+
export function isVersionAtLeast(current, minimum) {
|
|
81
|
+
const cmp = compareSemver(current, minimum);
|
|
82
|
+
if (cmp === null)
|
|
83
|
+
return false;
|
|
84
|
+
return cmp >= 0;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Checks whether the running Flisk CLI meets the minimum version required to adopt Compose repos.
|
|
88
|
+
* If the installed core is older than the buildContext release (1.3.104), exit before writing
|
|
89
|
+
* and print the upgrade command.
|
|
90
|
+
*/
|
|
91
|
+
export function checkCoreVersion(currentVersion = getPackageVersion(), args = []) {
|
|
92
|
+
const isWriting = !args.includes("--dry-run") && !args.includes("--help") && !args.includes("-h");
|
|
93
|
+
if (!isWriting) {
|
|
94
|
+
return { ok: true };
|
|
95
|
+
}
|
|
96
|
+
if (!isVersionAtLeast(currentVersion, MIN_CORE_VERSION)) {
|
|
97
|
+
return {
|
|
98
|
+
ok: false,
|
|
99
|
+
message: `flisk import: installed Flisk core (${currentVersion}) is older than the required ${MIN_CORE_VERSION} (buildContext release). Upgrade with: flisk upgrade`,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
return { ok: true };
|
|
103
|
+
}
|
|
104
|
+
export function importInvocation(args, env = process.env, platform = process.platform) {
|
|
105
|
+
const pkg = env.TDK_IMPORT_PACKAGE || IMPORT_PACKAGE;
|
|
106
|
+
return {
|
|
107
|
+
command: platform === "win32" ? "npx.cmd" : "npx",
|
|
108
|
+
args: ["--yes", pkg, ...args],
|
|
109
|
+
shell: platform === "win32",
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/** Runs tdk-import with the caller's terminal and resolves to its exit code. */
|
|
113
|
+
export function runImport(args, spawnFn = spawn, getVersionFn = getPackageVersion) {
|
|
114
|
+
const check = checkCoreVersion(getVersionFn(), args);
|
|
115
|
+
if (!check.ok) {
|
|
116
|
+
console.error(check.message);
|
|
117
|
+
return Promise.resolve(1);
|
|
118
|
+
}
|
|
119
|
+
const invocation = importInvocation(args);
|
|
120
|
+
return new Promise((resolve) => {
|
|
121
|
+
const child = spawnFn(invocation.command, invocation.args, {
|
|
122
|
+
stdio: "inherit",
|
|
123
|
+
shell: invocation.shell,
|
|
124
|
+
});
|
|
125
|
+
child.on("error", (err) => {
|
|
126
|
+
console.error(`flisk import: could not run npx (${err.message}). Install Node.js/npm and retry.`);
|
|
127
|
+
resolve(127);
|
|
128
|
+
});
|
|
129
|
+
child.on("close", (code) => resolve(code ?? 1));
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
export function buildForwardedImportArgs(args, options = {}) {
|
|
133
|
+
let yes = Boolean(options.yes);
|
|
134
|
+
let force = Boolean(options.force);
|
|
135
|
+
const filtered = [];
|
|
136
|
+
for (const arg of args) {
|
|
137
|
+
if (arg === "--yes" || arg === "-y") {
|
|
138
|
+
yes = true;
|
|
139
|
+
}
|
|
140
|
+
else if (arg === "--force" || arg === "-f") {
|
|
141
|
+
force = true;
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
filtered.push(arg);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (yes) {
|
|
148
|
+
filtered.push("--yes");
|
|
149
|
+
}
|
|
150
|
+
if (force) {
|
|
151
|
+
filtered.push("--force");
|
|
152
|
+
}
|
|
153
|
+
return filtered;
|
|
154
|
+
}
|
|
155
|
+
export const importCommand = addYesOption(new Command("import"))
|
|
156
|
+
.description("Import the services in a directory's root docker-compose.yml (runs tdk-import)")
|
|
157
|
+
.argument("[args...]", "Passed to tdk-import: [dir] --dry-run --yes --force")
|
|
158
|
+
.option("-f, --force", "Overwrite an existing service.json", false)
|
|
159
|
+
.allowUnknownOption()
|
|
160
|
+
.helpOption(false)
|
|
161
|
+
.action(async (args, options) => {
|
|
162
|
+
const forwardedArgs = buildForwardedImportArgs(args, options);
|
|
163
|
+
process.exitCode = await runImport(forwardedArgs);
|
|
164
|
+
});
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { Command } from "commander";
|
|
4
|
+
import { STANDARD_PORTS } from "../utils/constants.js";
|
|
5
|
+
import { errorFactories, runCommand, showErrorAndExit, TdkError } from "../utils/errors.js";
|
|
6
|
+
import { createMachineEnvelope } from "../utils/machine-output.js";
|
|
7
|
+
import { findProjectRoot } from "../utils/paths.js";
|
|
8
|
+
import { EnvUnreadableError, envSecretValues, redactSecrets, redactValue, } from "../utils/secret-redaction.js";
|
|
9
|
+
import { isTiltAvailable, runTilt } from "../utils/tilt.js";
|
|
10
|
+
import { DEFAULT_LOG_TAIL, isTiltConnectionFailure, isValidPort, isValidSince, isValidTail, MAX_LOG_TAIL, parseTiltLogLines, } from "../utils/tilt-logs.js";
|
|
11
|
+
import { tiltUnreachableMessage } from "../utils/tilt-unreachable-message.js";
|
|
12
|
+
/** Resource names Tilt knows about, or null when they cannot be listed (the logs call then reports the real error). */
|
|
13
|
+
async function tiltResourceNames(port) {
|
|
14
|
+
try {
|
|
15
|
+
const result = await runTilt("get", ["uiresources", "-o", "json", "--port", port], {
|
|
16
|
+
inheritStdio: false,
|
|
17
|
+
});
|
|
18
|
+
if (result.exitCode !== 0)
|
|
19
|
+
return null;
|
|
20
|
+
const items = JSON.parse(result.stdout)
|
|
21
|
+
.items;
|
|
22
|
+
return (items ?? []).flatMap((item) => (item.metadata?.name ? [item.metadata.name] : []));
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export const logsCommand = new Command("logs")
|
|
29
|
+
.description("Print a bounded snapshot of recent logs from the running stack")
|
|
30
|
+
.option("-s, --service <names...>", "Only these services (Tilt resource names)")
|
|
31
|
+
.option("--tail <n>", "Number of most recent lines to return", String(DEFAULT_LOG_TAIL))
|
|
32
|
+
.option("--since <duration>", "Only logs newer than this duration, for example 30s, 5m, 1h")
|
|
33
|
+
.option("--port <n>", "Tilt UI port (default: TILT_PORT or 10350)")
|
|
34
|
+
.option("--json", "Output one JSON object and exit", false)
|
|
35
|
+
.action(async (options) => {
|
|
36
|
+
let secrets = [];
|
|
37
|
+
const fail = (code, rawMessage, exitCode = 1, suggestions = []) => {
|
|
38
|
+
const message = redactSecrets(rawMessage, secrets);
|
|
39
|
+
const redactedSuggestions = redactValue(suggestions, secrets);
|
|
40
|
+
if (options.json) {
|
|
41
|
+
console.log(JSON.stringify(createMachineEnvelope(null, [
|
|
42
|
+
{
|
|
43
|
+
code,
|
|
44
|
+
message,
|
|
45
|
+
...(redactedSuggestions.length > 0 ? { suggestions: redactedSuggestions } : {}),
|
|
46
|
+
},
|
|
47
|
+
])));
|
|
48
|
+
console.error(message);
|
|
49
|
+
process.exit(exitCode);
|
|
50
|
+
}
|
|
51
|
+
if (redactedSuggestions.length > 0) {
|
|
52
|
+
return new TdkError(message, redactedSuggestions, exitCode).exit();
|
|
53
|
+
}
|
|
54
|
+
return showErrorAndExit(message, exitCode);
|
|
55
|
+
};
|
|
56
|
+
if (!isValidTail(options.tail))
|
|
57
|
+
fail("USAGE", `--tail must be an integer from 1 to ${MAX_LOG_TAIL}`, 2);
|
|
58
|
+
if (options.since !== undefined && !isValidSince(options.since)) {
|
|
59
|
+
fail("USAGE", "--since must be a duration such as 30s, 5m or 1h", 2);
|
|
60
|
+
}
|
|
61
|
+
const portText = options.port ?? process.env.TILT_PORT ?? String(STANDARD_PORTS.tiltUi);
|
|
62
|
+
if (!isValidPort(portText))
|
|
63
|
+
fail("USAGE", "--port must be a valid port number", 2);
|
|
64
|
+
const tail = Number(options.tail);
|
|
65
|
+
const services = options.service ?? [];
|
|
66
|
+
const action = async () => {
|
|
67
|
+
const projectRoot = findProjectRoot();
|
|
68
|
+
if (!projectRoot) {
|
|
69
|
+
// Same code `writeMachineError` gives this error in `down`, `stacks` and `resources`.
|
|
70
|
+
const error = errorFactories.notInProject();
|
|
71
|
+
return fail("COMMAND_FAILED", error.message, error.exitCode, error.suggestions);
|
|
72
|
+
}
|
|
73
|
+
try {
|
|
74
|
+
secrets = envSecretValues(projectRoot);
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
if (!(error instanceof EnvUnreadableError))
|
|
78
|
+
throw error;
|
|
79
|
+
fail("ENV_UNREADABLE", error.message, 1, [
|
|
80
|
+
"Fix the read permission on .env, or move it out of the project",
|
|
81
|
+
]);
|
|
82
|
+
}
|
|
83
|
+
if (!(await isTiltAvailable())) {
|
|
84
|
+
fail("TILT_MISSING", "Tilt is not installed. Run: flisk doctor");
|
|
85
|
+
}
|
|
86
|
+
if (services.length > 0) {
|
|
87
|
+
const known = await tiltResourceNames(portText);
|
|
88
|
+
const unknown = services.filter((name) => known && !known.includes(name));
|
|
89
|
+
if (unknown.length > 0) {
|
|
90
|
+
const error = errorFactories.unknownServices(unknown, known ?? []);
|
|
91
|
+
const suggestions = error.suggestions;
|
|
92
|
+
fail("UNKNOWN_SERVICE", error.message, error.exitCode, suggestions);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const args = ["--port", portText, "--tail", String(tail)];
|
|
96
|
+
if (options.since !== undefined)
|
|
97
|
+
args.push("--since", options.since);
|
|
98
|
+
if (options.json)
|
|
99
|
+
args.push("--json");
|
|
100
|
+
// `--` so a service name that starts with "-" is never read as a Tilt flag.
|
|
101
|
+
if (services.length > 0)
|
|
102
|
+
args.push("--", ...services);
|
|
103
|
+
const result = await runTilt("logs", args, { inheritStdio: false });
|
|
104
|
+
if (result.exitCode !== 0) {
|
|
105
|
+
const detail = result.stderr.trim();
|
|
106
|
+
if (!detail || isTiltConnectionFailure(detail)) {
|
|
107
|
+
fail("TILT_NOT_RUNNING", tiltUnreachableMessage(portText));
|
|
108
|
+
}
|
|
109
|
+
fail("TILT_LOGS_FAILED", `tilt logs failed: ${detail}`);
|
|
110
|
+
}
|
|
111
|
+
if (!options.json) {
|
|
112
|
+
process.stdout.write(redactSecrets(result.stdout, secrets));
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const lines = parseTiltLogLines(result.stdout, tail);
|
|
116
|
+
console.log(JSON.stringify(redactValue(createMachineEnvelope({ services, tail, since: options.since ?? null, lines }), secrets)));
|
|
117
|
+
};
|
|
118
|
+
await runCommand(action);
|
|
119
|
+
});
|