{"record":{"id":"d76ea3be0c6ca70b","repo":"charmbracelet/crush","slug":"no-providers-found","errorCode":null,"errorMessage":"no providers found","messagePattern":"no providers found","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cmd/models.go","lineNumber":118,"sourceCode":"\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tentry.models = append(entry.models, model.ID)\n\t\t\t}\n\t\t\tif len(entry.models) > 0 {\n\t\t\t\tslices.Sort(entry.models)\n\t\t\t\tentries[providerID] = entry\n\t\t\t}\n\t\t}\n\n\t\tvar providerIDs []string\n\t\tfor id := range entries {\n\t\t\tproviderIDs = append(providerIDs, id)\n\t\t}\n\t\tsort.Strings(providerIDs)\n\n\t\tif len(providerIDs) == 0 && len(args) == 0 {\n\t\t\treturn fmt.Errorf(\"no providers found\")\n\t\t}\n\t\tif len(providerIDs) == 0 {\n\t\t\treturn fmt.Errorf(\"no providers found matching %q\", term)\n\t\t}\n\n\t\tif !isatty.IsTerminal(os.Stdout.Fd()) {\n\t\t\tfor _, providerID := range providerIDs {\n\t\t\t\tentry := entries[providerID]\n\t\t\t\tfor _, modelID := range entry.models {\n\t\t\t\t\tfmt.Println(providerID + \"/\" + modelID)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\n\t\tt := tree.New()\n\t\tfor _, providerID := range providerIDs {\n\t\t\tentry := entries[providerID]","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/charmbracelet/crush/blob/7944b8e52225d8805e31eacbf7ef24856b0dfb7a/internal/cmd/models.go#L100-L136","documentation":"internal/cmd/models.go raises 'no providers found' when the model listing has zero provider entries after resolving the provider catalog and no search term was supplied. It signals the config/catalog resolved to an empty provider set, so there is nothing to list or complete against.","triggerScenarios":"Running `crush models` (or interactive model selection) with an empty or misconfigured provider config, offline/failed catalog fetch, or config that filtered out all providers.","commonSituations":"Fresh install without a crushrc/crush.json defining providers; malformed provider config; catalog endpoint unreachable so entries is empty; typo in provider definitions in crushrc.","solutions":["Define at least one provider in crushrc (e.g. `provider \"anthropic\" { ... }`) or run `crush login`","Check config with the documented provider builtins; ensure provider blocks parse and are not gated off","Verify network access to the provider catalog; retry when online","Run `crush models <term>` with an explicit provider id to see if any match"],"exampleFix":"# before (empty crushrc)\n# after\nprovider \"anthropic\" {\n  api_key = env.ANTHROPIC_API_KEY\n}\nmodel \"claude-sonnet-4\" {\n  provider = \"anthropic\"\n}","handlingStrategy":"validation","validationCode":"providers := config.Providers()\nif len(providers) == 0 {\n    return errors.New(\"no providers configured; add a provider block to crushrc or run `crush login`\")\n}","typeGuard":null,"tryCatchPattern":"entries, err := loadProviderEntries(ctx)\nif err != nil {\n    var netErr net.Error\n    if errors.As(err, &netErr) { /* offline: prompt user */ }\n    return err\n}","preventionTips":["Always define at least one provider in crushrc","Run `crush login` on fresh installs","Check network access to the provider catalog"],"tags":["config","providers","models"],"backgroundTag":"no-providers-configured","analyzedSha":"7944b8e52225d8805e31eacbf7ef24856b0dfb7a","analyzedAt":"2026-08-29T12:48:59.079Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}