import { captureEvent } from "../../common/analytics/lib.js";
import { authenticate } from "../../common/middleware/authentication.js";
import { identify } from "../../common/middleware/user-identification.js";
import setBlocking from "../../common/output.js";
import { create } from "../../tunnel/create/handler.js";
import { configure } from "../../common/middleware/user-configuration.js";
export default {
    desc: "Creates a new tunnel in your account",
    command: "create",
    builder: (yargs) => {
        return yargs
            .option("tunnel-name", {
            type: "string",
            describe: "The name of the tunnel to create",
        })
            .option("api-key", {
            type: "string",
            describe: "The API Key from Zuplo",
            envVar: "API_KEY",
        })
            .demandOption(["tunnel-name"])
            .demandOption("api-key", "You must provide an API key with --api-key")
            .middleware([setBlocking, authenticate, configure, identify]);
    },
    handler: async (argv) => {
        await captureEvent({ argv, event: "zuplo tunnel create" });
        await create(argv);
    },
};
//# sourceMappingURL=create.js.map