{"record":{"id":"86d8ed4958e1cf1d","repo":"Hmbown/CodeWhale","slug":"has-no-supported-external-cli-credential-source","errorCode":null,"errorMessage":"{} has no supported external CLI credential source","messagePattern":"(.+?) has no supported external CLI credential source","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/lib.rs","lineNumber":2822,"sourceCode":"    path_override: Option<PathBuf>,\n) -> Result<(codewhale_config::ExternalCredentialSource, PathBuf)> {\n    let (source, default_path) = match provider {\n        ProviderKind::OpenaiCodex => (\n            codewhale_config::ExternalCredentialSource::CodexCli,\n            openai_codex_auth_file_path(),\n        ),\n        ProviderKind::Xai => (\n            codewhale_config::ExternalCredentialSource::GrokCli,\n            grok_auth_file_path(),\n        ),\n        ProviderKind::Deepseek | ProviderKind::DeepseekAnthropic => (\n            codewhale_config::ExternalCredentialSource::DshCli,\n            codewhale_config::default_dsh_credentials_path(),\n        ),\n        ProviderKind::Moonshot => bail!(\n            \"Kimi is API-key-only in Codewhale. Create a key at https://platform.kimi.ai/console/api-keys; Kimi CLI OAuth import is unsupported.\"\n        ),\n        _ => bail!(\n            \"{} has no supported external CLI credential source\",\n            provider.as_str()\n        ),\n    };\n    let path =\n        codewhale_config::resolve_external_credential_path(path_override.unwrap_or(default_path))?;\n    Ok((source, path))\n}\n\nfn provider_config_api_key(store: &ConfigStore, provider: ProviderKind) -> Option<&str> {\n    let slot = store\n        .config\n        .providers\n        .for_provider(provider)\n        .api_key\n        .as_deref();\n    let root = (provider == ProviderKind::Deepseek)\n        .then_some(store.config.api_key.as_deref())","sourceCodeStart":2804,"sourceCodeEnd":2840,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/lib.rs#L2804-L2840","documentation":"Catch-all arm of the external credential target resolver: the provider has no recognized external CLI credential source, so managed import cannot proceed. The message interpolates the provider's string form (e.g. via Display/fmt).","triggerScenarios":"Calling the external-credential import flow with a ProviderKind that is not one of the explicitly mapped kinds (Grok, Deepseek variants handled; Moonshot rejected with its own message).","commonSituations":"Adding a new provider to config and assuming import works; typos or aliases resolving to an unmapped kind; scripts looping over all configured providers including ones with no CLI source.","solutions":["Check which providers support external CLI import (`codewhale auth --help` or provider docs)","Authenticate the provider with Codewhale-owned storage: `codewhale auth set --provider <provider>`","If it is a newly added provider, extend external_credential_target's match in crates/cli/src/lib.rs"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"IMPORTABLE_PROVIDERS = {'grok', 'deepseek', 'deepseek-anthropic'};\nif provider.toLowerCase() not in IMPORTABLE_PROVIDERS: skip_import(provider)","typeGuard":null,"tryCatchPattern":"try { importExternalCredential(provider) } catch (e) { if (String(e).includes('no supported external CLI credential source')) { fallbackToAuthSet(provider); } else { throw e; } }","preventionTips":["Enumerate providers and only call the import path for known-mapped kinds","Default new providers to `codewhale auth set`"],"tags":["cli","auth","providers"],"backgroundTag":"unsupported-enum-value","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"}