import { captureEvent } from "../common/analytics/lib.js";
import { init } from "../init/handler.js";
export default {
    desc: "Initialize a Zuplo project on the platform (create project and deploy initial environment)",
    command: "init [directory]",
    hidden: true,
    builder: (yargs) => {
        return yargs
            .usage("$0 init [directory] [options]")
            .positional("directory", {
            type: "string",
            describe: "Directory containing the project (defaults to current directory)",
        })
            .option("with-account", {
            type: "string",
            describe: "Pre-select the account name for project creation",
        })
            .option("with-project", {
            type: "string",
            describe: "Pre-select or create a project with this name",
        })
            .option("yes", {
            alias: "y",
            type: "boolean",
            describe: "Use defaults for all prompts",
        })
            .example([
            ["$0 init", "Initialize the current directory with Zuplo platform"],
            [
                "$0 init my-api",
                "Initialize the my-api directory with Zuplo platform",
            ],
            [
                "$0 init --with-account my-account --with-project my-api",
                "Initialize with a specific account and project",
            ],
            ["$0 init -y", "Initialize with all defaults (create project, deploy)"],
        ]);
    },
    handler: async (argv) => {
        const args = argv;
        const initArgs = {
            dir: args._[1],
            withAccount: args.withAccount,
            withProject: args.withProject,
            yes: args.yes,
        };
        await captureEvent({ argv, event: "zuplo init" });
        await init(initArgs);
    },
};
//# sourceMappingURL=init.js.map