{"record":{"id":"b1694c3c8145d5a0","repo":"Hmbown/CodeWhale","slug":"bridge-is-required-in-non-interactive-mode","errorCode":null,"errorMessage":"--bridge is required in --non-interactive mode. {}","messagePattern":"--bridge is required in --non-interactive mode\\. (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/remote_setup/mod.rs","lineNumber":170,"sourceCode":"        );\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()));\n    }\n    if args.non_interactive {\n        bail!(\n            \"--bridge is required in --non-interactive mode. {}\",\n            bridge_choices()\n        );\n    }\n    let idx = prompt_choice(\n        \"Chat bridge\",\n        &BRIDGES\n            .iter()\n            .map(|b| format!(\"{} ({})\", b.display, b.slug))\n            .collect::<Vec<_>>(),\n    )?;\n    Ok(&BRIDGES[idx])\n}\n\nfn resolve_provider(args: &RemoteSetupArgs) -> Result<ProviderInfo> {\n    if let Some(slug) = &args.provider {\n        return ProviderInfo::from_slug(slug).ok_or_else(|| {\n            anyhow::anyhow!(","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/remote_setup/mod.rs#L152-L188","documentation":"The remote setup wizard resolves the chat bridge from the --bridge flag, an interactive prompt, or fails. With --non-interactive there is no prompt, so a missing --bridge aborts before provisioning. The error text appends the valid bridge slugs (bridge_choices()) so the correct value can be supplied without reading source.","triggerScenarios":"Running remote setup with --non-interactive but no --bridge argument in resolve_bridge (crates/tui/src/remote_setup/mod.rs). Supplying an unknown slug raises the distinct 'unknown bridge' error instead.","commonSituations":"Automation scripts that pass --cloud and --provider but were never updated for the bridge flag; environments cloned from an example that predates bridge selection; users who assume a default bridge exists.","solutions":["Add --bridge <slug> using one of the slugs listed in the error message.","Drop --non-interactive to get the interactive bridge picker when unsure which slug applies.","Store the chosen bridge slug next to the cloud slug in your provisioning configuration so both are always supplied together."],"exampleFix":"# before\ncodewhale remote-setup --non-interactive --cloud <slug>\n# fails: --bridge is required in --non-interactive mode\n\n# after\ncodewhale remote-setup --non-interactive --cloud <slug> --bridge <slug>","handlingStrategy":"validation","validationCode":"# Shell: require the bridge flag alongside --non-interactive\n: \"${CODEWHALE_BRIDGE:?--bridge is required in --non-interactive mode; set CODEWHALE_BRIDGE}\"\ncodewhale remote-setup --non-interactive --cloud \"$CODEWHALE_CLOUD\" --bridge \"$CODEWHALE_BRIDGE\" --provider \"$CODEWHALE_PROVIDER\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bundle cloud, bridge, and provider into one required-flags check in provisioning scripts.","Run the interactive wizard once to discover valid slugs, then codify them.","Re-verify slugs after upgrading Codewhale, since registries can change between versions."],"tags":["cli","remote-setup","non-interactive","bridge","rust"],"backgroundTag":"missing-required-cli-flag","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}