func NewCmdVersionstream() (*cobra.Command, *Options) {
	o := &Options{}
	cmd := &cobra.Command{
		Use:     "versionstream",
		Short:   "Administer the cluster version stream settings",
		Long:    createLong,
		Example: fmt.Sprintf(createExample, rootcmd.BinaryName, rootcmd.BinaryName, rootcmd.BinaryName),
		Run: func(cmd *cobra.Command, args []string) {
			o.Cmd = cmd
			o.Args = args
			err := o.Run()
			helper.CheckErr(err)
		},
	}
	o.Cmd = cmd
	cmd.Flags().BoolVarP(&o.LTS, "lts", "", false, "Switch the cluster version stream to the LTS (long term support on monthly release cadence) git repo, https://github.com/jenkins-x/jx3-lts-versions")
	cmd.Flags().BoolVarP(&o.Latest, "latest", "", false, "Switch the cluster version stream to the latest (latest releases) git repo, https://github.com/jenkins-x/jxr-versions")
	cmd.Flags().BoolVarP(&o.Custom, "custom", "", false, "Switch the cluster version stream to a custom version stream, requires url and ref flags set")
	cmd.Flags().StringVarP(&o.GitURL, "url", "", "", "The git URL to clone to fetch the initial set of files for a helm 3 / helmfile based git configuration if this command is not run inside a git clone or against a GitOps based cluster")
	cmd.Flags().StringVarP(&o.GitRef, "ref", "", "", "The kind of git server for the development environment")
	cmd.Flags().StringVarP(&o.GitDir, "directory", "", "/", "The directory used in the versionstream, defaults to root")
	return cmd, o
}
NewCmdVersionstream administer the cluster version stream
package versionstream
import (
	"fmt"
	"path/filepath"
	"github.com/jenkins-x/jx-helpers/v3/pkg/cmdrunner"
	"github.com/jenkins-x/jx-helpers/v3/pkg/gitclient"
	"github.com/jenkins-x/jx-helpers/v3/pkg/gitclient/cli"
	"github.com/jenkins-x-plugins/jx-gitops/pkg/rootcmd"
	"sigs.k8s.io/kustomize/kyaml/yaml"
	"github.com/jenkins-x/jx-logging/v3/pkg/log"
	"github.com/jenkins-x/jx-helpers/v3/pkg/termcolor"
	"github.com/jenkins-x/jx-helpers/v3/pkg/files"
	"github.com/pkg/errors"
	"github.com/jenkins-x/jx-helpers/v3/pkg/cobras/helper"
	"github.com/jenkins-x/jx-helpers/v3/pkg/cobras/templates"
	"github.com/spf13/cobra"
)
var (
	createLong = templates.LongDesc(`
		Administer the cluster version stream settings
`)
	createExample = templates.Examples(`
		# switch to LTS (stable) version stream
		%s versionstream --lts
		# switch to latest version stream
		%s versionstream --latest
		# switch to a custom version stream
		%s versionstream --custom --url https: 
	`)
)
const (
	ltsVersionStreamURL    = "https://github.com/jenkins-x/jx3-lts-versions"
	latestVersionStreamURL = "https://github.com/jenkins-x/jxr-versions"
)
type Options struct {
	LTS         bool
	Latest      bool
	Custom      bool
	DoGitCommit bool
	GitURL      string
	GitRef      string
	GitDir      string
	Cmd         *cobra.Command
	Args        []string
	Dir         string
	Gitter      gitclient.Interface
}