Open source AI coding agent. Designed for large projects and real world tasks.
Go aiai-agentsai-developer-toolsai-toolsclicommand-linedeveloper-toolsgitgolanggpt-4llmopenaipolyglot-programmingterminalterminal-basedterminal-ui
Update CLI commands for new models custom workflow
Dane Schneiderf52bc6e800e6
diff --git a/app/cli/cmd/model_packs.go b/app/cli/cmd/model_packs.goindex 27c0f591..a7035680 100644--- a/app/cli/cmd/model_packs.go+++ b/app/cli/cmd/model_packs.go@@ -113,11 +113,11 @@ func listModelPacks(cmd *cobra.Command, args []string) {}if customModelPacksOnly && len(customModelPacks) > 0 {- term.PrintCmds("", "model-packs create", "model-packs show", "model-packs update", "model-packs delete")+ term.PrintCmds("", "model-packs show", "models custom")} else if len(customModelPacks) > 0 {- term.PrintCmds("", "model-packs --custom", "model-packs create", "model-packs show", "model-packs update", "model-packs delete")+ term.PrintCmds("", "model-packs --custom", "model-packs show", "models custom")} else {- term.PrintCmds("", "model-packs create", "model-packs show")+ term.PrintCmds("", "model-packs show", "models custom")}}@@ -190,7 +190,7 @@ func showModelPack(cmd *cobra.Command, args []string) {fmt.Println()- term.PrintCmds("", "model-packs update", "model-packs delete", "set-model", "set-model default")+ term.PrintCmds("", "set-model", "set-model default", "models custom")}// func getModelRoleConfig(customModels []*shared.CustomModel, modelRole shared.ModelRole) shared.ModelRoleConfig {diff --git a/app/cli/cmd/model_providers.go b/app/cli/cmd/model_providers.goindex c89b4c5e..5781c540 100644--- a/app/cli/cmd/model_providers.go+++ b/app/cli/cmd/model_providers.go@@ -25,13 +25,6 @@ var providersCmd = &cobra.Command{Run: listProviders,}-var showProviderCmd = &cobra.Command{- Use: "show [id|name]",- Short: "Show a custom model provider",- Args: cobra.MaximumNArgs(1),- Run: showProvider,-}-var addProviderCmd = &cobra.Command{Use: "add",Aliases: []string{"create"},@@ -49,7 +42,6 @@ var updateProviderCmd = &cobra.Command{func init() {RootCmd.AddCommand(providersCmd)providersCmd.Flags().BoolVarP(&customProvidersOnly, "custom", "c", false, "List custom providers only")- providersCmd.AddCommand(showProviderCmd)providersCmd.AddCommand(addProviderCmd)providersCmd.AddCommand(updateProviderCmd)}@@ -78,7 +70,7 @@ func listProviders(cmd *cobra.Command, args []string) {if customProvidersOnly && len(customProviders) == 0 {fmt.Println("🤷♂️ No custom providers")fmt.Println()- term.PrintCmds("", "providers add")+ term.PrintCmds("", "models custom")return}@@ -143,75 +135,5 @@ func listProviders(cmd *cobra.Command, args []string) {fmt.Println()}- term.PrintCmds("", "providers show", "providers update", "models import")-}--func showProvider(cmd *cobra.Command, args []string) {- auth.MustResolveAuthWithOrg()-- term.StartSpinner("")- providers, apiErr := api.Client.ListCustomProviders()- term.StopSpinner()- if apiErr != nil {- term.OutputErrorAndExit("Error fetching providers: %v", apiErr.Msg)- return- }-- if len(providers) == 0 {- fmt.Println("🤷♂️ No custom providers")- fmt.Println()- term.PrintCmds("", "providers add")- return- }-- var selected *shared.CustomProvider- if len(args) == 1 {- input := args[0]- idx, err := strconv.Atoi(input)- if err == nil && idx > 0 && idx <= len(providers) {- selected = providers[idx-1]- } else {- for _, p := range providers {- if p.Name == input || p.Id == input {- selected = p- break- }- }- }- }-- if selected == nil {- opts := make([]string, len(providers))- for i, p := range providers {- opts[i] = fmt.Sprintf("%s (%s)", p.Name, p.BaseUrl)- }- choice, err := term.SelectFromList("Select provider:", opts)- if err != nil {- term.OutputErrorAndExit("Error selecting provider: %v", err)- return- }- for i, o := range opts {- if o == choice {- selected = providers[i]- break- }- }- }-- table := tablewriter.NewWriter(os.Stdout)- table.SetAutoWrapText(false)- table.SetHeader([]string{"Field", "Value"})- table.Append([]string{"Name", selected.Name})- table.Append([]string{"Base URL", selected.BaseUrl})- table.Append([]string{"Skip Auth", fmt.Sprintf("%v", selected.SkipAuth)})- table.Append([]string{"API Key Env Var", selected.ApiKeyEnvVar})- if len(selected.ExtraAuthVars) > 0 {- for i, v := range selected.ExtraAuthVars {- label := fmt.Sprintf("Extra Auth %d", i+1)- table.Append([]string{label, v.Var})- }- }- table.Render()- fmt.Println()- term.PrintCmds("", "providers update", "providers list")+ term.PrintCmds("", "models custom")}diff --git a/app/cli/term/help.go b/app/cli/term/help.goindex fa368195..1a49fb7b 100644--- a/app/cli/term/help.go+++ b/app/cli/term/help.go@@ -105,22 +105,18 @@ var CliCommands = []CmdConfig{{"models", "", "show current plan model settings", true},{"models default", "", "show the default model settings for new plans", true},+{"models available", "", "show all available models", true},{"models available --custom", "", "show available custom models only", true},- {"models delete", "", "delete a custom model", true},- {"models add", "", "add a custom model", true},++ {"models custom", "", "manage custom models, providers, and model packs", true},{"providers", "", "show all available model providers", true},{"providers --custom", "", "show available custom model providers only", true},- {"providers show", "", "show a built-in or custom model provider's settings", true},- {"providers update", "", "update a custom model provider's settings", true},- {"providers delete", "", "delete a custom model provider", true},{"model-packs", "", "show all available model packs", true},- {"model-packs create", "", "create a new custom model pack", true},- {"model-packs delete", "", "delete a custom model pack", true},+{"model-packs --custom", "", "show custom model packs only", true},- {"model-packs update", "", "update a custom model pack", true},{"model-packs show", "", "show a built-in or custom model pack's settings", true},{"set-model", "", "update current plan model settings", true},@@ -333,7 +329,8 @@ func PrintHelpAllCommands() {fmt.Fprintln(builder)color.New(color.Bold, color.BgCyan, color.FgHiWhite).Fprintln(builder, " Custom Models ")- printCmds(builder, " ", []color.Attribute{color.Bold, ColorHiCyan}, "models available", "models available --custom", "models add", "models delete", "providers", "providers --custom", "providers show", "providers update", "providers delete", "model-packs --custom", "model-packs create", "model-packs show", "model-packs update", "model-packs delete")+ printCmds(builder, " ", []color.Attribute{color.Bold, ColorHiCyan},+ "models custom", "models available", "models available --custom", "providers", "providers --custom", "model-packs", "model-packs --custom", "model-packs show")fmt.Fprintln(builder)color.New(color.Bold, color.BgCyan, color.FgHiWhite).Fprintln(builder, " Accounts ")