{"record":{"id":"836bd139d49714f9","repo":"Hmbown/CodeWhale","slug":"unrecognized-provider-provider-arg-known-pr","errorCode":null,"errorMessage":"Unrecognized --provider {provider_arg:?}. Known providers: {} or a configured [providers.<name>] custom provider","messagePattern":"Unrecognized --provider (.+?)\\. Known providers: (.+?) or a configured \\[providers\\.<name>\\] custom provider","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":925,"sourceCode":"fn apply_exec_provider_override(config: &mut Config, provider_arg: &str) -> Result<()> {\n    let provider_arg = provider_arg.trim();\n    if provider_arg.is_empty() {\n        return Ok(());\n    }\n    if config\n        .providers\n        .as_ref()\n        .and_then(|providers| providers.custom_provider_config(provider_arg))\n        .is_some()\n    {\n        config.provider = Some(provider_arg.to_string());\n        return Ok(());\n    }\n    if let Some(provider) = crate::config::ApiProvider::parse(provider_arg) {\n        config.provider = Some(provider.as_str().to_string());\n        return Ok(());\n    }\n    bail!(\n        \"Unrecognized --provider {provider_arg:?}. Known providers: {} \\\n         or a configured [providers.<name>] custom provider\",\n        crate::config::ApiProvider::names_hint()\n    );\n}\n\nfn exec_model_env_override() -> Option<String> {\n    let read = || {\n        [\"CODEWHALE_MODEL\", \"DEEPSEEK_MODEL\"]\n            .into_iter()\n            .find_map(|key| {\n                std::env::var(key)\n                    .ok()\n                    .map(|model| model.trim().to_string())\n                    .filter(|model| !model.is_empty())\n            })\n    };\n    #[cfg(test)]","sourceCodeStart":907,"sourceCodeEnd":943,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/lib.rs#L907-L943","documentation":"The `--provider` CLI flag only accepts values that ApiProvider::parse recognizes (built-in providers) or names that match a configured `[providers.<name>]` custom provider. Any other string bails with the list of known providers.","triggerScenarios":"Running `codewhale --provider <name> ...` where <name> is misspelled, not a built-in provider, and has no matching `[providers.<name>]` table in the config file.","commonSituations":"Typo in provider name; using a provider's marketing name instead of its configured id; forgetting to add the [providers.<name>] section before passing a custom provider on the CLI; case-sensitivity mismatches.","solutions":["Run with a valid built-in provider name from the Known providers hint","Add a `[providers.<name>]` section to your config for the custom provider, then retry","Check spelling/case of the --provider value against the hint list"],"exampleFix":"// before\ncodewhale --provider openai-chat ...\n// after\ncodewhale --provider openai ...   # or add [providers.openai-chat] to the config","handlingStrategy":"validation","validationCode":"// pre-check the value before invoking the CLI\n// valid = builtin provider name or a table present in config: [providers.<name>]","typeGuard":null,"tryCatchPattern":"match run_result { Err(e) if e.to_string().contains(\"Unrecognized --provider\") => { eprintln!(\"{}\", e); /* surface hint and exit non-zero */ }, other => other? }","preventionTips":["Copy provider names from the Known providers hint verbatim","Define [providers.<name>] in config before referencing a custom provider","Validate provider names in scripts against a fixed allowlist"],"tags":["cli","provider","config"],"backgroundTag":"invalid-cli-argument","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}