func NewGetAlertsCommand() *cobra.Command {
	var (
		pageSize int
	)
	cmd := &cobra.Command{
		Use:              "alerts",
		Short:            "Print the registered alerts",
		Example:          "alerts",
		TraverseChildren: true,
		SilenceErrors:    true,
		RunE: func(cmd *cobra.Command, args []string) error {
			alerts, err := config.Client.GetAlerts(pageSize)
			if err != nil {
				return fmt.Errorf("failed to retrieve alerts. Error: [%s]", err.Error())
			}
			return bite.PrintObject(cmd, alerts)
		},
	}
	cmd.Flags().IntVar(&pageSize, "page-size", 25, "Size of items to be included in the list")
	bite.CanPrintJSON(cmd)
	cmd.AddCommand(DeleteAlertEventsCommand())
	return cmd
}
NewGetAlertsCommand creates the `alerts` command
package alert
import (
	"errors"
	"fmt"
	"strconv"
	"strings"
	"github.com/kataras/golog"
	"github.com/lensesio/bite"
	"github.com/lensesio/lenses-go/pkg/api"
	config "github.com/lensesio/lenses-go/pkg/configs"
	"github.com/spf13/cobra"
)
func NewAlertGroupCommand() *cobra.Command {
	root := &cobra.Command{
		Use:              "alert",
		Short:            "Manage alerts",
		Example:          "alert",
		TraverseChildren: true,
		SilenceErrors:    true,
	}
	root.AddCommand(
		NewGetAlertSettingsCommand(),
		NewAlertSettingGroupCommand(),
	)
	return root
}