{"record":{"id":"962e1a7a5a9b1489","repo":"Hmbown/CodeWhale","slug":"provider-auth-source-command-must-include-at-least","errorCode":null,"errorMessage":"provider auth source command must include at least one non-empty argv item","messagePattern":"provider auth source command must include at least one non-empty argv item","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/config/src/auth_source.rs","lineNumber":30,"sourceCode":"#[serde(deny_unknown_fields)]\npub struct ProviderAuthSourceToml {\n    #[serde(alias = \"type\")]\n    pub source: AuthSourceKind,\n    #[serde(default, skip_serializing_if = \"Vec::is_empty\")]\n    pub command: Vec<String>,\n    #[serde(default, skip_serializing_if = \"Option::is_none\")]\n    pub timeout_ms: Option<u64>,\n    #[serde(default, skip_serializing_if = \"Option::is_none\")]\n    pub secret_id: Option<String>,\n}\n\nimpl ProviderAuthSourceToml {\n    pub fn validate(&self) -> Result<()> {\n        match self.source {\n            AuthSourceKind::Command => {\n                if self.command.is_empty() || self.command.iter().all(|part| part.trim().is_empty())\n                {\n                    bail!(\n                        \"provider auth source command must include at least one non-empty argv item\"\n                    );\n                }\n            }\n            AuthSourceKind::Secret => {\n                if self\n                    .secret_id\n                    .as_deref()\n                    .is_none_or(|secret_id| secret_id.trim().is_empty())\n                {\n                    bail!(\"provider auth source secret must include secret_id\");\n                }\n            }\n        }\n        Ok(())\n    }\n\n    #[must_use]","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/config/src/auth_source.rs#L12-L48","documentation":"Validation error from ProviderAuthSourceToml::validate for command-based auth sources. When source = \"command\", the command field is the argv used to obtain credentials; it must contain at least one entry with non-whitespace content, otherwise the provider config is unusable and load-time validation fails.","triggerScenarios":"A provider's auth source in the TOML config is declared as kind Command with command = [] or command = [\"\", \"  \"] (empty or whitespace-only argv).","commonSituations":"Hand-editing the config and leaving the command array empty; templating that produced an empty argv; commenting out the command items but keeping the Command kind.","solutions":["Set command to a real argv, e.g. command = [\"op\", \"read\", \"op://vault/item/credential\"].","If credentials come from a secret reference instead, change source to Secret and set secret_id.","Remove surrounding whitespace-only entries from the command array.","Run the config validator (or CLI startup) again after editing to confirm the fix."],"exampleFix":"// before\n[[providers]]\n[providers.auth_source]\nsource = \"command\"\ncommand = []\n// after\n[[providers]]\n[providers.auth_source]\nsource = \"command\"\ncommand = [\"pass\", \"show\", \"codewhale/api-key\"]","handlingStrategy":"validation","validationCode":"// Pre-validate the auth source before handing the config to the library\nif auth_source.source == \"command\"\n    && auth_source.command.iter().all(|p| p.trim().is_empty()) {\n    return Err(\"providers.auth_source.command must list a real argv\".into());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep at least one non-empty argv entry whenever source = \"command\".","Run config validation (CLI startup) after every manual config edit.","Prefer switching to source = \"secret\" with a secret_id when credentials are stored.","Check templating output so variable expansion cannot produce an empty array."],"tags":["config","validation","auth"],"backgroundTag":"empty-required-field","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"}