{"record":{"id":"404086d8a5b35f6d","repo":"Hmbown/CodeWhale","slug":"cloud-is-required-in-non-interactive-mode","errorCode":null,"errorMessage":"--cloud is required in --non-interactive mode. {}","messagePattern":"--cloud is required in --non-interactive mode\\. (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/remote_setup/mod.rs","lineNumber":149,"sourceCode":"    use crate::palette;\n    use colored::Colorize;\n    let (r, g, b) = palette::WHALE_INFO_RGB;\n    println!(\"{}\", \"Codewhale Remote Setup\".truecolor(r, g, b).bold());\n    println!(\"{}\", \"======================\".truecolor(r, g, b));\n    println!(\"Generate a deploy bundle for a remote Codewhale agent (cloud + chat bridge).\");\n}\n\n// ---------------------------------------------------------------------------\n// Resolution: flag -> prompt (unless --non-interactive) -> validated value\n// ---------------------------------------------------------------------------\n\nfn resolve_cloud(args: &RemoteSetupArgs) -> Result<&'static CloudTarget> {\n    if let Some(slug) = &args.cloud {\n        return registry::cloud_by_slug(slug)\n            .ok_or_else(|| anyhow::anyhow!(\"unknown cloud '{slug}'. {}\", cloud_choices()));\n    }\n    if args.non_interactive {\n        bail!(\n            \"--cloud is required in --non-interactive mode. {}\",\n            cloud_choices()\n        );\n    }\n    let idx = prompt_choice(\n        \"Cloud target\",\n        &CLOUD_TARGETS\n            .iter()\n            .map(|c| format!(\"{} ({})\", c.display, c.slug))\n            .collect::<Vec<_>>(),\n    )?;\n    Ok(&CLOUD_TARGETS[idx])\n}\n\nfn resolve_bridge(args: &RemoteSetupArgs) -> Result<&'static BridgeSpec> {\n    if let Some(slug) = &args.bridge {\n        return registry::bridge_by_slug(slug)\n            .ok_or_else(|| anyhow::anyhow!(\"unknown bridge '{slug}'. {}\", bridge_choices()));","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/remote_setup/mod.rs#L131-L167","documentation":"The remote setup wizard resolves its cloud target from the --cloud flag, an interactive prompt, or fails. In --non-interactive mode there is no prompt fallback, so if --cloud was not supplied resolution aborts immediately. The message includes the list of valid cloud slugs to make the fix mechanical.","triggerScenarios":"Running remote setup with --non-interactive but without --cloud; or passing a slug that is not in CLOUD_TARGETS (that case produces the separate 'unknown cloud' error). Resolution happens in resolve_cloud in crates/tui/src/remote_setup/mod.rs before anything is provisioned.","commonSituations":"CI or provisioning scripts adopt the non-interactive flag but were written against an older CLI that prompted or defaulted; copy-pasted command lines from docs that omit the cloud flag; new environments where no default cloud exists.","solutions":["Add --cloud <slug> to the command, using one of the slugs listed in the error message (rendered by cloud_choices()).","Re-run without --non-interactive to get the interactive cloud picker if you do not know the slug.","Pin the exact slug in your automation config so CI does not depend on prompt defaults."],"exampleFix":"# before\ncodewhale remote-setup --non-interactive --bridge ...\n# fails: --cloud is required in --non-interactive mode\n\n# after\ncodewhale remote-setup --non-interactive --cloud <slug> --bridge ...","handlingStrategy":"validation","validationCode":"# Shell: require the flag before invoking non-interactive setup\n: \"${CODEWHALE_CLOUD:?--cloud is required in --non-interactive mode; set CODEWHALE_CLOUD}\"\ncodewhale remote-setup --non-interactive --cloud \"$CODEWHALE_CLOUD\" --bridge ... --provider ...","typeGuard":null,"tryCatchPattern":null,"preventionTips":["In automation, always pass --cloud, --bridge, and --provider together with --non-interactive.","Fail fast in your wrapper script (e.g. parameter expansion checks) before spawning the CLI.","Pin slugs in version-controlled config so flag requirements are caught in review, not at runtime."],"tags":["cli","remote-setup","non-interactive","cloud","rust"],"backgroundTag":"missing-required-cli-flag","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}