Hmbown/CodeWhale · error

--cloud is required in --non-interactive mode. {}

Error message

--cloud is required in --non-interactive mode. {}

What it means

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.

Source

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

    use crate::palette;
    use colored::Colorize;
    let (r, g, b) = palette::WHALE_INFO_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> {
    if let Some(slug) = &args.bridge {
        return registry::bridge_by_slug(slug)
            .ok_or_else(|| anyhow::anyhow!("unknown bridge '{slug}'. {}", bridge_choices()));

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Add --cloud <slug> to the command, using one of the slugs listed in the error message (rendered by cloud_choices()).
  2. Re-run without --non-interactive to get the interactive cloud picker if you do not know the slug.
  3. Pin the exact slug in your automation config so CI does not depend on prompt defaults.

Example fix

# before
codewhale remote-setup --non-interactive --bridge ...
# fails: --cloud is required in --non-interactive mode

# after
codewhale remote-setup --non-interactive --cloud <slug> --bridge ...
Defensive patterns

Strategy: validation

Validate before calling

# Shell: require the flag before invoking non-interactive setup
: "${CODEWHALE_CLOUD:?--cloud is required in --non-interactive mode; set CODEWHALE_CLOUD}"
codewhale remote-setup --non-interactive --cloud "$CODEWHALE_CLOUD" --bridge ... --provider ...

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/404086d8a5b35f6d. Report an issue: GitHub.