Skip to content

Commit 7637bc8

Browse files
authored
feat: animate plugin marketplace list with progress spinner (#287)
Wrap the network-backed marketplace index fetch (plugin marketplace list) in a CLIProgress spinner, matching the doctor/preflight pattern. Non-TTY renders clean static lines.
1 parent 0be638a commit 7637bc8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

cmd/plugin_dynamic.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,15 @@ var pluginMarketplaceListCmd = &cobra.Command{
426426
Short: "List plugins available from marketplace sources",
427427
RunE: func(cmd *cobra.Command, _ []string) error {
428428
mc := plugin.NewMarketplaceClient()
429+
prog := NewCLIProgress("Marketplace", []string{"Fetching marketplace indexes"})
430+
prog.StartStep(0)
429431
entries, err := mc.FetchAll()
430432
if err != nil {
433+
prog.Abort()
431434
return fmt.Errorf("fetch marketplace: %w (indexes may be unpublished; add a source with graycode plugin marketplace add)", err)
432435
}
436+
prog.CompleteStep(0)
437+
prog.Done()
433438
if len(entries) == 0 {
434439
cmd.Println(auditTint("No marketplace plugins found.", textMuted))
435440
cmd.Println(auditTint("Add a source: graycode plugin marketplace add <name> <index-url>", textMuted))

0 commit comments

Comments
 (0)