{"record":{"id":"d9a67f7a386feb9a","repo":"Hmbown/CodeWhale","slug":"unknown-cloud-slug","errorCode":null,"errorMessage":"unknown cloud '{slug}'. {}","messagePattern":"unknown cloud '(.+?)'\\. (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/remote_setup/mod.rs","lineNumber":146,"sourceCode":"}\n\nfn print_header() {\n    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> {","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/remote_setup/mod.rs#L128-L164","documentation":"resolve_cloud looks up the --cloud flag value in the static cloud registry via registry::cloud_by_slug. If the slug does not match any known cloud target, it throws with the full list of valid choices appended.","triggerScenarios":"Running remote setup with `--cloud <slug>` where slug is misspelled, has wrong casing, or refers to a cloud not present in CLOUD_TARGETS.","commonSituations":"Typo in the slug (e.g. `--cloud aws` vs the exact registry name), docs/script drift after a rename, autocompletion from an older version.","solutions":["Run remote setup without --cloud to see the interactive choice list, or read the choices shown in the error message","Correct the slug to exactly match a registered cloud target","Check registry::CLOUD_TARGETS (or the help output) for current valid slugs","Update any scripts/aliases that reference old slugs after upgrading"],"exampleFix":"// before\ncodewhale remote-setup --cloud awss\n// after\ncodewhale remote-setup --cloud aws   # exact slug from the choices list","handlingStrategy":"validation","validationCode":"let slug = args.cloud.as_deref().unwrap_or(\"\");\nif !VALID_CLOUD_SLUGS.contains(&slug) {\n    eprintln!(\"--cloud must be one of: {}\", VALID_CLOUD_SLUGS.join(\", \"));\n    std::process::exit(2);\n}","typeGuard":null,"tryCatchPattern":"match run_remote_setup(args) {\n    Err(e) if e.to_string().starts_with(\"unknown cloud\") => {\n        eprintln!(\"{e}\"); // message already lists valid choices\n        std::process::exit(2);\n    }\n    other => other?,\n}","preventionTips":["Copy slugs from the error's choice list, never from memory","Shell-complete flags against current registry slugs","Re-check scripts after upgrading (slugs can be renamed)","Use interactive mode (omit --cloud) when unsure"],"tags":["cli","validation","slug","remote-setup"],"backgroundTag":"invalid-cli-argument","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"}