{"record":{"id":"e12c93ef20e43eb4","repo":"zeroclaw-labs/zeroclaw","slug":"cli-secret-empty","errorCode":"cli-secret-empty","errorMessage":"Value cannot be empty.","messagePattern":"Value cannot be empty\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/main.rs","lineNumber":164,"sourceCode":"#[cfg(feature = \"agent-runtime\")]\nfn secret_prompt(prompt_text: &str, allow_empty: bool) -> Result<String> {\n    use std::io::IsTerminal;\n\n    if !std::io::stdin().is_terminal() || !std::io::stderr().is_terminal() {\n        bail!(ta(\n            \"cli-secret-needs-tty\",\n            &[],\n            \"Secret input requires a terminal on stdin and stderr.\"\n        ));\n    }\n\n    let value = cli_input::SecretInput::new()\n        .with_prompt(prompt_text)\n        .interact()?;\n    if allow_empty || !value.trim().is_empty() {\n        Ok(value)\n    } else {\n        bail!(ta(\"cli-secret-empty\", &[], \"Value cannot be empty.\"))\n    }\n}\n\n#[cfg(feature = \"agent-runtime\")]\nfn qta(key: &str, args: &[(&str, &str)]) -> String {\n    zeroclaw_runtime::i18n::get_required_cli_string_with_args(key, args)\n}\n\n#[cfg(feature = \"agent-runtime\")]\nfn quickstart_row(key: &str, glyph: &str, summary: &str) -> String {\n    qta(key, &[(\"glyph\", glyph), (\"summary\", summary)])\n}\n\n#[cfg(feature = \"agent-runtime\")]\nfn quickstart_step_label(step: zeroclaw_runtime::quickstart::QuickstartStep) -> String {\n    t(step.label_key(), step.label())\n}\n","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/src/main.rs#L146-L182","documentation":"After collecting the hidden value in secret_prompt, an empty or whitespace-only result is rejected unless the specific call site passed allow_empty (only done where an empty secret is a meaningful choice). This is the last-chance check that a required secret was actually entered (i18n key 'cli-secret-empty').","triggerScenarios":"Pressing Enter at a secret prompt without typing anything, or a paste that put only whitespace into the buffer, on a prompt created with allow_empty=false.","commonSituations":"Users skipping a prompt to 'see what happens'; clipboard paste failing silently; terminal input quirks swallowing the pasted value so the user submits empty.","solutions":["Re-run the command and enter a non-empty value at the prompt (leading/trailing whitespace alone does not count).","Verify the paste actually landed by checking the prompt's mask/feedback before submitting.","If you legitimately need no secret for that flow, use the flow's documented skip/unset option instead of submitting empty input."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"match secret_prompt(\"API key:\", false) {\n    Err(e) if e.to_string().contains(\"cannot be empty\") => {\n        // re-prompt the user; a required secret was submitted blank\n    }\n    other => other,\n}","preventionTips":["Confirm the paste landed (the prompt shows mask feedback once input is non-empty) before pressing Enter.","Trim-check secrets in onboarding docs so users do not submit whitespace-only values.","For optional secrets, use the flow's documented skip/unset option rather than empty input."],"tags":["cli","input-validation","secret-input"],"backgroundTag":"empty-required-input","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}