Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cmd/cli/commands/configure_show.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,37 @@
"fmt"

"github.com/docker/model-runner/cmd/cli/commands/completion"

Check failure on line 8 in cmd/cli/commands/configure_show.go

View workflow job for this annotation

GitHub Actions / lint (linux)

File is not properly formatted (gci)
"github.com/spf13/cobra"
)

func newConfigureShowCmd() *cobra.Command {
c := &cobra.Command{
Use: "show [MODEL]",
Short: "Show model configurations",
Short: "Show effective runtime configuration for models",
Long: "Show the effective runtime configuration that Docker Model Runner has stored for one model or all models.",
Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
var modelFilter string
if len(args) > 0 {
modelFilter = args[0]
}

configs, err := desktopClient.ShowConfigs(modelFilter)
if err != nil {
return err
}

jsonResult, err := json.MarshalIndent(configs, "", " ")
if err != nil {
return fmt.Errorf("failed to marshal configs to JSON: %w", err)
}

cmd.Println(string(jsonResult))
return nil
},
ValidArgsFunction: completion.ModelNames(getDesktopClient, 1),
}

return c
}
Loading