charmbracelet/crush · error
no providers found
Error message
no providers found
What it means
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.
Source
Thrown at internal/cmd/models.go:118
continue
}
}
entry.models = append(entry.models, model.ID)
}
if len(entry.models) > 0 {
slices.Sort(entry.models)
entries[providerID] = entry
}
}
var providerIDs []string
for id := range entries {
providerIDs = append(providerIDs, id)
}
sort.Strings(providerIDs)
if len(providerIDs) == 0 && len(args) == 0 {
return fmt.Errorf("no providers found")
}
if len(providerIDs) == 0 {
return fmt.Errorf("no providers found matching %q", term)
}
if !isatty.IsTerminal(os.Stdout.Fd()) {
for _, providerID := range providerIDs {
entry := entries[providerID]
for _, modelID := range entry.models {
fmt.Println(providerID + "/" + modelID)
}
}
return nil
}
t := tree.New()
for _, providerID := range providerIDs {
entry := entries[providerID]View on GitHub (pinned to 7944b8e522)
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
Example fix
# before (empty crushrc)
# after
provider "anthropic" {
api_key = env.ANTHROPIC_API_KEY
}
model "claude-sonnet-4" {
provider = "anthropic"
} Defensive patterns
Strategy: validation
Validate before calling
providers := config.Providers()
if len(providers) == 0 {
return errors.New("no providers configured; add a provider block to crushrc or run `crush login`")
} Try / catch
entries, err := loadProviderEntries(ctx)
if err != nil {
var netErr net.Error
if errors.As(err, &netErr) { /* offline: prompt user */ }
return err
} Prevention
- Always define at least one provider in crushrc
- Run `crush login` on fresh installs
- Check network access to the provider catalog
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- no providers found matching %q
- failed to configure selected models: %w
- no providers configured, please configure at least one provi
- model configuration not found
- no providers configured - please run 'crush' to set up a pro
AI-assisted analysis of charmbracelet/crush@7944b8e522 (2026-08-29).
Data as JSON: /api/errors/d76ea3be0c6ca70b.
Report an issue: GitHub.