import fs from "node:fs"; import { downloadTemplate } from "@bluwy/giget-core"; import * as $p from "@clack/prompts"; import type { CliCommand } from "cli/types"; import { typewriter, wait } from "cli/utils/cli"; import { execAsync, getVersion } from "cli/utils/sys"; import { Option } from "commander"; import { env } from "bknd"; import color from "picocolors"; import { overridePackageJson, updateBkndPackages } from "./npm"; import { type Template, templates, type TemplateSetupCtx } from "./templates"; import { createScoped, flush } from "cli/utils/telemetry"; import path from "node:path"; const config = { types: { runtime: "Runtime", framework: "Framework", }, runtime: { node: "Node.js", bun: "Bun", cloudflare: "Cloudflare", deno: "Deno", aws: "AWS Lambda", }, framework: { nextjs: "Next.js", "react-router": "React Router", astro: "Astro", }, } as const; export const create: CliCommand = (program) => { program .command("create") .addOption(new Option("-i, --integration ", "integration to use")) .addOption(new Option("-t, --template