7 "charm.land/lipgloss/v2"
8 "github.com/charmbracelet/crush/internal/config"
9 "github.com/charmbracelet/x/exp/charmtone"
10 "github.com/spf13/cobra"
13var updateProvidersCmd = &cobra.Command{
14 Use: "update-providers [path-or-url]",
15 Short: "Update providers",
16 Long: `Update the list of providers from a specified local path or remote URL.`,
18# Update providers remotely from Catwalk
21# Update providers from a custom URL
22crush update-providers https://example.com/
24# Update providers from a local file
25crush update-providers /path/to/local-providers.json
27# Update providers from embedded version
28crush update-providers embedded
30 RunE: func(cmd *cobra.Command, args []string) error {
31 // NOTE(@andreynering): We want to skip logging output do stdout here.
32 slog.SetDefault(slog.New(slog.DiscardHandler))
39 if err := config.UpdateProviders(pathOrUrl); err != nil {
43 // NOTE(@andreynering): This style is more-or-less copied from Fang's
44 // error message, adapted for success.
45 headerStyle := lipgloss.NewStyle().
46 Foreground(charmtone.Butter).
47 Background(charmtone.Guac).
53 textStyle := lipgloss.NewStyle().
55 SetString("Providers updated successfully.")
57 fmt.Printf("%s\n%s\n\n", headerStyle.Render(), textStyle.Render())
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list