package cli import ( "fmt" "strconv" "strings" "golang.org/x/xerrors" "github.com/coder/coder/v2/cli/cliui" "github.com/coder/coder/v2/codersdk" "github.com/coder/serpent" ) func (r *RootCmd) templatePresets() *serpent.Command { cmd := &serpent.Command{ Use: "presets", Short: "Manage presets of the specified template", Aliases: []string{"preset"}, Long: FormatExamples( Example{ Description: "List presets for the active version of a template", Command: "coder templates presets list my-template", }, Example{ Description: "List presets for a specific version of a template", Command: "coder templates presets list my-template --template-version my-template-version", }, ), Handler: func(inv *serpent.Invocation) error { return inv.Command.HelpHandler(inv) }, Children: []*serpent.Command{ r.templatePresetsList(), }, } return cmd } func (r *RootCmd) templatePresetsList() *serpent.Command { defaultColumns := []string{ "name", "description", "parameters", "default", "desired prebuild instances", } formatter := cliui.NewOutputFormatter( cliui.TableFormat([]TemplatePresetRow{}, defaultColumns), cliui.JSONFormat(), ) orgContext := NewOrganizationContext() var templateVersion string cmd := &serpent.Command{ Use: "list