{"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 codewhale_palette as palette;\n    use colored::Colorize;\n    let (r, g, b) = palette::WHALE_ACTION_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/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/remote_setup/mod.rs#L131-L167","documentation":"`resolve_cloud` requires an explicit `--cloud` slug when running remote setup in `--non-interactive` mode, because there is no TTY to prompt for a choice. Without it the command cannot determine the cloud target and fails fast.","triggerScenarios":"Calling `remote_setup` with `--non-interactive` and no `--cloud <slug>` flag, or with a `--cloud` slug unknown to the registry (which raises the sibling 'unknown cloud' error).","commonSituations":"Scripting/CI automation of remote setup where all interactive prompts must be satisfied by flags; forgetting the required flag in a shell script or Docker entrypoint.","solutions":["Add `--cloud <slug>` to the command line","Run `remote_setup` without `--non-interactive` to get the interactive prompt","List valid slugs by triggering the error message or checking the cloud registry docs"],"exampleFix":"// before\ncodewhale remote-setup --non-interactive --bridge slack\n// after\ncodewhale remote-setup --non-interactive --cloud aws --bridge slack","handlingStrategy":"validation","validationCode":"if [[ $CI ]] && [[ ! \"$*\" =~ --cloud ]]; then echo \"--cloud required with --non-interactive\"; exit 2; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass --cloud, --bridge and --provider together with --non-interactive","Wrap remote-setup invocations in a script that asserts required flags","Discover valid slugs once and pin them in your automation"],"tags":["cli","remote-setup","non-interactive"],"backgroundTag":"missing-required-flag","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"}