{"record":{"id":"2db087028dfb4cf3","repo":"charmbracelet/crush","slug":"invalid-source-q-must-be-catwalk-or-hyper","errorCode":null,"errorMessage":"invalid source %q, must be 'catwalk' or 'hyper'","messagePattern":"invalid source %q, must be 'catwalk' or 'hyper'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cmd/update_providers.go","lineNumber":54,"sourceCode":"crush update-providers --source=hyper https://hyper.example.com\n`,\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t// NOTE(@andreynering): We want to skip logging output do stdout here.\n\t\tslog.SetDefault(slog.New(slog.DiscardHandler))\n\n\t\tvar pathOrURL string\n\t\tif len(args) > 0 {\n\t\t\tpathOrURL = args[0]\n\t\t}\n\n\t\tvar err error\n\t\tswitch updateProvidersSource {\n\t\tcase \"catwalk\":\n\t\t\terr = config.UpdateProviders(pathOrURL)\n\t\tcase \"hyper\":\n\t\t\terr = config.UpdateHyper(pathOrURL)\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"invalid source %q, must be 'catwalk' or 'hyper'\", updateProvidersSource)\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// NOTE(@andreynering): This style is more-or-less copied from Fang's\n\t\t// error message, adapted for success.\n\t\theaderStyle := lipgloss.NewStyle().\n\t\t\tForeground(charmtone.Butter).\n\t\t\tBackground(charmtone.Guac).\n\t\t\tBold(true).\n\t\t\tPadding(0, 1).\n\t\t\tMargin(1).\n\t\t\tMarginLeft(2).\n\t\t\tSetString(\"SUCCESS\")\n\t\ttextStyle := lipgloss.NewStyle().\n\t\t\tMarginLeft(2).","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/charmbracelet/crush/blob/7944b8e52225d8805e31eacbf7ef24856b0dfb7a/internal/cmd/update_providers.go#L36-L72","documentation":"The `crush update-providers` command validates the --source flag against a closed set: only \"catwalk\" or \"hyper\" are accepted (each dispatching to a different config updater). Any other value is rejected with this error before any network call is made. It is a pure flag-validation error, not a fetch failure.","triggerScenarios":"Running `crush update-providers` with --source set to anything other than catwalk or hyper — e.g. a typo (`catwalks`), different casing (`Catwalk`), or an empty value if the flag is passed without one.","commonSituations":"Misspelling or miscapitalizing the source name; copy-pasting an example that used a different source name; forgetting that hyper is a separate source.","solutions":["Use exactly `--source catwalk` (default provider catalog) or `--source hyper`.","Check spelling and case — the match is exact and case-sensitive.","Run `crush update-providers --help` to see the accepted values."],"exampleFix":"// before\ncrush update-providers --source Catwalk --url ./providers.json\n// after\ncrush update-providers --source catwalk --url ./providers.json","handlingStrategy":"validation","validationCode":"# shell check before invoking\nsource=\"catwalk\"\ncase \"$source\" in catwalk|hyper) ;; *) echo \"invalid --source: $source\"; exit 1 ;; esac\ncrush update-providers --source \"$source\" --url \"$url\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only pass --source catwalk or --source hyper, lowercase and unquoted-exact.","Consult `crush update-providers --help` before scripting the command.","Quote variables in scripts to avoid empty --source values."],"tags":["cli","flag-validation","config","providers"],"backgroundTag":"invalid-flag-value","analyzedSha":"7944b8e52225d8805e31eacbf7ef24856b0dfb7a","analyzedAt":"2026-08-29T12:48:59.079Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}