import { captureEvent } from "../../common/analytics/lib.js";
import { authenticate } from "../../common/middleware/authentication.js";
import { fetchAccount } from "../../common/middleware/get-account-param.js";
import { configure } from "../../common/middleware/user-configuration.js";
import { identify } from "../../common/middleware/user-identification.js";
import { list } from "../../tunnel/list/handler.js";
export default {
    desc: "Lists the tunnels in your account",
    command: "list",
    builder: (yargs) => {
        return yargs
            .usage("$0 tunnel list [options]")
            .option("api-key", {
            type: "string",
            describe: "The API Key from Zuplo",
            envVar: "API_KEY",
            alias: "apikey",
        })
            .demandOption("api-key", "You must provide an API key with --api-key")
            .example([
            ["$0 tunnel list", "List all tunnels"],
            [
                "$0 tunnel list --account my-account",
                "Explicitly specify the account",
            ],
        ])
            .middleware([authenticate, configure, fetchAccount, identify]);
    },
    handler: async (argv) => {
        await captureEvent({ argv, event: "zuplo tunnel list" });
        await list(argv);
    },
};
//# sourceMappingURL=list.js.map