import { list } from "../../bucket/list/handler.js";
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";
export default {
    desc: "Lists the buckets in your account",
    command: "list",
    builder: (yargs) => {
        return yargs
            .usage("$0 bucket list [options]")
            .option("api-key", {
            type: "string",
            describe: "The API Key from Zuplo",
            envVar: "API_KEY",
            alias: "apikey",
        })
            .option("account", {
            type: "string",
            describe: "The account name",
        })
            .option("project", {
            type: "string",
            describe: "Filter buckets by project name",
        })
            .option("output", {
            type: "string",
            alias: "o",
            describe: "Output format",
            choices: ["default", "json"],
            default: "default",
        })
            .example([
            ["$0 bucket list", "List all buckets in your account"],
            ["$0 bucket list --output json", "List all buckets as JSON"],
            [
                "$0 bucket list --account my-account",
                "Explicitly specify the account",
            ],
            [
                "$0 bucket list --project my-project",
                "Filter buckets by project name",
            ],
        ])
            .middleware([authenticate, configure, fetchAccount, identify]);
    },
    handler: async (argv) => {
        await captureEvent({ argv, event: "zuplo bucket list" });
        await list(argv);
    },
};
//# sourceMappingURL=list.js.map