Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.

Commit 5be97cf

Browse files
authored
Merge pull request #60 from docker/list-install-status
standalone: display install progress in list if safe to do
2 parents 0e4d562 + 7df8d08 commit 5be97cf

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

commands/list.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"github.com/docker/model-cli/commands/completion"
88
"github.com/docker/model-cli/commands/formatter"
99
"github.com/docker/model-cli/desktop"
10+
"github.com/docker/model-cli/pkg/standalone"
1011
"github.com/olekukonko/tablewriter"
1112
"github.com/spf13/cobra"
1213
"os"
@@ -23,7 +24,13 @@ func newListCmd() *cobra.Command {
2324
if openai && quiet {
2425
return fmt.Errorf("--quiet flag cannot be used with --openai flag")
2526
}
26-
if err := ensureStandaloneRunnerAvailable(cmd.Context(), nil); err != nil {
27+
// If we're doing an automatic install, only show the installation
28+
// status if it won't corrupt machine-readable output.
29+
var standaloneInstallPrinter standalone.StatusPrinter
30+
if !jsonFormat && !openai && !quiet {
31+
standaloneInstallPrinter = cmd
32+
}
33+
if err := ensureStandaloneRunnerAvailable(cmd.Context(), standaloneInstallPrinter); err != nil {
2734
return fmt.Errorf("unable to initialize standalone model runner: %w", err)
2835
}
2936
models, err := listModels(openai, desktopClient, quiet, jsonFormat)

0 commit comments

Comments
 (0)