Hmbown/CodeWhale · error

unknown cloud ' '.

Error message

unknown cloud '{slug}'. {}

What it means

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.

Solutions

  1. Run remote setup without --cloud to see the interactive choice list, or read the choices shown in the error message
  2. Correct the slug to exactly match a registered cloud target
  3. Check registry::CLOUD_TARGETS (or the help output) for current valid slugs
  4. Update any scripts/aliases that reference old slugs after upgrading

Example fix

// before
codewhale remote-setup --cloud awss
// after
codewhale remote-setup --cloud aws   # exact slug from the choices list
Defensive patterns

Strategy: validation

Validate before calling

let slug = args.cloud.as_deref().unwrap_or("");
if !VALID_CLOUD_SLUGS.contains(&slug) {
    eprintln!("--cloud must be one of: {}", VALID_CLOUD_SLUGS.join(", "));
    std::process::exit(2);
}

Try / catch

match run_remote_setup(args) {
    Err(e) if e.to_string().starts_with("unknown cloud") => {
        eprintln!("{e}"); // message already lists valid choices
        std::process::exit(2);
    }
    other => other?,
}

Prevention

When it happens

Trigger: Running remote setup with `--cloud <slug>` where slug is misspelled, has wrong casing, or refers to a cloud not present in CLOUD_TARGETS.

Common situations: Typo in the slug (e.g. `--cloud aws` vs the exact registry name), docs/script drift after a rename, autocompletion from an older version.

Understand the failure class

Background: "Unknown argument", "Invalid value", and "must be one of": invalid CLI argument errors explained — this error's family across 35 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/d9a67f7a386feb9a. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/remote_setup/mod.rs:146

}

fn print_header() {
    use codewhale_palette as palette;
    use colored::Colorize;
    let (r, g, b) = palette::WHALE_ACTION_RGB;
    println!("{}", "Codewhale Remote Setup".truecolor(r, g, b).bold());
    println!("{}", "======================".truecolor(r, g, b));
    println!("Generate a deploy bundle for a remote Codewhale agent (cloud + chat bridge).");
}

// ---------------------------------------------------------------------------
// Resolution: flag -> prompt (unless --non-interactive) -> validated value
// ---------------------------------------------------------------------------

fn resolve_cloud(args: &RemoteSetupArgs) -> Result<&'static CloudTarget> {
    if let Some(slug) = &args.cloud {
        return registry::cloud_by_slug(slug)
            .ok_or_else(|| anyhow::anyhow!("unknown cloud '{slug}'. {}", cloud_choices()));
    }
    if args.non_interactive {
        bail!(
            "--cloud is required in --non-interactive mode. {}",
            cloud_choices()
        );
    }
    let idx = prompt_choice(
        "Cloud target",
        &CLOUD_TARGETS
            .iter()
            .map(|c| format!("{} ({})", c.display, c.slug))
            .collect::<Vec<_>>(),
    )?;
    Ok(&CLOUD_TARGETS[idx])
}

fn resolve_bridge(args: &RemoteSetupArgs) -> Result<&'static BridgeSpec> {

View on GitHub (pinned to 73e0f67d83)