def list_command(
    search: str | None,
    output: t.Literal["json", "yaml", "table"],
    _cloud_client: BentoCloudClient = Provide[BentoMLContainer.bentocloud_client],
):
    """List all secrets on BentoCloud."""
    try:
        secrets = _cloud_client.secret.list(search=search)
    except BentoMLException as e:
        raise_secret_error(e, "list")
    if output == "table":
        table = Table(box=None, expand=True)
        table.add_column("Secret", overflow="fold")
        table.add_column("Created_At", overflow="fold")
        table.add_column("Mount_As", overflow="fold")
        table.add_column("Keys", overflow="fold")
        table.add_column("Path", overflow="fold")
        table.add_column("Cluster", overflow="fold")

        for secret in secrets:
            keys = [item.key for item in secret.content.items]
            mountAs = secret.content.type
            if mountAs == "env":
                mountAs = "Environment Variable"
            elif mountAs == "mountfile":
                mountAs = "File"
            table.add_row(
                secret.name,
                secret.created_at.strftime("%Y-%m-%d %H:%M:%S"),
                mountAs,
                ", ".join(keys),
                secret.content.path if secret.content.path else "-",
                secret.cluster.name,
            )
        rich.print(table)
    elif output == "json":
        res: t.List[dict[str, t.Any]] = [s.to_dict() for s in secrets]
        info = json.dumps(res, indent=2, default=str)
        rich.print(info)
    elif output == "yaml":
        res: t.List[dict[str, t.Any]] = [s.to_dict() for s in secrets]
        info = yaml.dump(res, indent=2, sort_keys=False)
        rich.print(Syntax(info, "yaml", background_color="default"))
List all secrets on BentoCloud.
src/bentoml_cli/secret.py