{"record":{"id":"55e7a25aacb3832f","repo":"charmbracelet/crush","slug":"no-providers-configured-please-configure-at-least","errorCode":null,"errorMessage":"no providers configured, please configure at least one provider","messagePattern":"no providers configured, please configure at least one provider","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/config/load.go","lineNumber":718,"sourceCode":"\t\t}\n\t\tif len(cfg.RootMarkers) == 0 {\n\t\t\tcfg.RootMarkers = base.RootMarkers\n\t\t}\n\t\tcfg.Command = cmp.Or(cfg.Command, base.Command)\n\t\tif len(cfg.Args) == 0 {\n\t\t\tcfg.Args = base.Args\n\t\t}\n\t\tif len(cfg.Env) == 0 {\n\t\t\tcfg.Env = base.Environment\n\t\t}\n\t\t// Update the config in the map\n\t\tc.LSP[name] = cfg\n\t}\n}\n\nfunc (c *Config) defaultModelSelection(knownProviders []catwalk.Provider) (largeModel SelectedModel, smallModel SelectedModel, err error) {\n\tif len(knownProviders) == 0 && c.Providers.Len() == 0 {\n\t\terr = fmt.Errorf(\"no providers configured, please configure at least one provider\")\n\t\treturn largeModel, smallModel, err\n\t}\n\n\t// Use the first provider enabled based on the known providers order\n\t// if no provider found that is known use the first provider configured\n\tfor _, p := range knownProviders {\n\t\tproviderConfig, ok := c.Providers.Get(string(p.ID))\n\t\tif !ok || providerConfig.Disable {\n\t\t\tcontinue\n\t\t}\n\t\tdefaultLargeModel := c.GetModel(string(p.ID), p.DefaultLargeModelID)\n\t\tif defaultLargeModel == nil {\n\t\t\tslog.Warn(\"Default large model %s not found for provider %s\", p.DefaultLargeModelID, p.ID)\n\t\t\tif len(providerConfig.Models) == 0 {\n\t\t\t\treturn largeModel, smallModel, fmt.Errorf(\"default large model %s not found for provider %s\", p.DefaultLargeModelID, p.ID)\n\t\t\t}\n\t\t\tdefaultLargeModel = &providerConfig.Models[0]\n\t\t}","sourceCodeStart":700,"sourceCodeEnd":736,"githubUrl":"https://github.com/charmbracelet/crush/blob/7944b8e52225d8805e31eacbf7ef24856b0dfb7a/internal/config/load.go#L700-L736","documentation":"defaultModelSelection picks default large/small models when none are explicitly selected. If there are no known catalog providers AND no configured custom providers, there is nothing to choose from, so it returns this error which propagates through resolveSelectedModels and Load.","triggerScenarios":"resolveSelectedModels -> defaultModelSelection with len(knownProviders) == 0 && c.Providers.Len() == 0 — e.g. empty providers section, catwalk catalog empty/unavailable, or all providers disabled.","commonSituations":"Fresh install with no crush.json and the provider catalog failed to load; user deleted the providers section; offline environment where catwalk provider list can't be fetched and nothing is locally configured.","solutions":["Configure at least one provider (custom or via login/models command)","Check network access / catwalk catalog sync if known providers should exist","Restore the providers section in crush.json/crushrc","Run `crush models` to configure a provider and selected models explicitly"],"exampleFix":"// before\ncrush  // no crush.json, catalog unavailable -> error\n// after (crush.json)\n{\"providers\": {\"anthropic\": {\"api_key\": \"$ANTHROPIC_API_KEY\"}}, \"options\": {\"preferred_model\": {\"large\": \"anthropic/claude-sonnet-4-20250514\", \"small\": \"anthropic/claude-haiku-4-20250514\"}}}","handlingStrategy":"fallback","validationCode":"if len(knownProviders) == 0 {\n    hasCustom := false\n    raw, _ := os.ReadFile(\"crush.json\")\n    var c map[string]json.RawMessage\n    if json.Unmarshal(raw, &c) == nil {\n        if p, ok := c[\"providers\"]; ok && string(p) != \"{}\" && string(p) != \"null\" {\n            hasCustom = true\n        }\n    }\n    if !hasCustom {\n        return errors.New(\"no providers available: configure one or restore network/catalog access\")\n    }\n}","typeGuard":null,"tryCatchPattern":"store, err := config.Load(ctx, opts)\nif err != nil {\n    if strings.Contains(err.Error(), \"no providers configured\") {\n        // fallback: guide user to run `crush login` / `crush models`\n        return fmt.Errorf(\"run `crush models` to configure a provider: %w\", err)\n    }\n    return err\n}","preventionTips":["Run `crush models` right after install to configure a provider","Ensure network access or a cached provider catalog on offline machines","Always keep at least one provider entry in config","Pin selected large/small models so bootstrap selection isn't required"],"tags":["config","providers","models","bootstrap"],"backgroundTag":"no-providers-configured","analyzedSha":"7944b8e52225d8805e31eacbf7ef24856b0dfb7a","analyzedAt":"2026-08-29T12:48:59.079Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}