{"record":{"id":"fbdf8b32ec3f87b1","repo":"charmbracelet/crush","slug":"no-providers-configured-please-run-crush-to-se","errorCode":null,"errorMessage":"no providers configured - please run 'crush' to set up a provider interactively","messagePattern":"no providers configured - please run 'crush' to set up a provider interactively","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cmd/run.go","lineNumber":108,"sourceCode":"\n\t\tswitch {\n\t\tcase sessionID != \"\":\n\t\t\tevent.SetContinueBySessionID(true)\n\t\tcase useLast:\n\t\t\tevent.SetContinueLastSession(true)\n\t\t}\n\n\t\tif useClientServer() {\n\t\t\tc, ws, cleanup, err := connectToServer(cmd)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer cleanup()\n\n\t\t\tevent.AppInitialized()\n\n\t\t\tif !ws.Config.IsConfigured() {\n\t\t\t\treturn fmt.Errorf(\"no providers configured - please run 'crush' to set up a provider interactively\")\n\t\t\t}\n\n\t\t\tclientWs := workspace.NewClientWorkspace(c, *ws)\n\t\t\tif err := clientWs.InitCoderAgentNonInteractive(ctx); err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to initialize agent: %w\", err)\n\t\t\t}\n\n\t\t\tif sessionID != \"\" {\n\t\t\t\tsess, err := resolveSessionByID(ctx, c, ws.ID, sessionID)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsessionID = sess.ID\n\t\t\t}\n\n\t\t\tif verbose {\n\t\t\t\tslog.SetDefault(slog.New(log.New(os.Stderr)))\n\t\t\t}","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/charmbracelet/crush/blob/7944b8e52225d8805e31eacbf7ef24856b0dfb7a/internal/cmd/run.go#L90-L126","documentation":"Returned by `crush run` when the loaded config has no providers configured (Config.IsConfigured() is false). Non-interactive mode cannot open the setup wizard, so it directs the user to run interactive `crush` once to configure a provider/model and credentials.","triggerScenarios":"Fresh machine or repo with no crush.json/crushrc and no provider keys; config exists but defines no providers; running in CI where interactive setup was never completed.","commonSituations":"CI pipelines missing ANTHROPIC_API_KEY/OPENAI_API_KEY secrets; running crush outside the project directory so the config isn't discovered; deleted config files after a migration to crushrc.","solutions":["Run `crush` interactively once to complete provider setup","Or create a crushrc/crush.json manually with a provider, model, and API key env var","Export the required API key environment variable in your shell or CI secrets","Verify the config is discovered by running from the project root"],"exampleFix":"# before: no providers configured\ncrush run \"task\"   # error\n# after: configure a provider\nexport ANTHROPIC_API_KEY=sk-...\ncrush          # interactive setup, writes crush config\ncrush run \"task\"","handlingStrategy":"validation","validationCode":"cfg, err := config.Load(...)\nif err != nil {\n\treturn err\n}\nif !cfg.IsConfigured() {\n\treturn fmt.Errorf(\"no providers configured; run 'crush' to set one up\")\n}","typeGuard":null,"tryCatchPattern":"if err := runCmd.Execute(); err != nil {\n\tif strings.Contains(err.Error(), \"no providers configured\") {\n\t\tslog.Error(\"Run 'crush' interactively once, or export the provider API key\")\n\t}\n\treturn err\n}","preventionTips":["Complete interactive `crush` setup before using `run` in CI","Export provider API keys in shell profiles or CI secrets","Run from the project root so the config file is discovered","Keep the config file present after migrating between formats"],"tags":["config","providers","setup"],"backgroundTag":"missing-provider-configuration","analyzedSha":"7944b8e52225d8805e31eacbf7ef24856b0dfb7a","analyzedAt":"2026-08-29T12:48:59.079Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}