Hmbown/CodeWhale · error

--set is not supported by auth commands; use a saved config

Error message

--set is not supported by auth commands; use a saved config

What it means

The CLI main dispatcher rejects `--set` overrides when the resolved subcommand is `Auth`: auth flows use stored credentials and applying runtime config overrides to them is not supported. If `cli.overrides` is non-empty and the command matches `Commands::Auth(_)`, it bails with a pointer to saved configs. This prevents users from believing a transient `--set` influenced authentication.

Solutions

  1. Drop the `--set` flags and configure behavior via `codewhale config set` before running the auth command.
  2. Run the auth command without overrides, then apply runtime settings to the actual session/exec invocation.
  3. If you need different settings per environment, use separate saved config profiles rather than `--set` on auth.

Example fix

// before
codewhale --set model=gpt-x auth login
// error: --set is not supported by auth commands

// after
codewhale auth login
codewhale config set model gpt-x
Defensive patterns

Strategy: validation

Validate before calling

# guard in wrapper script
case "$*" in
  *auth*) [ -n "$OVERRIDES" ] && { echo "drop --set for auth commands"; exit 2; };;
esac

Try / catch

match run(args) {
    Err(e) if e.to_string().contains("not supported by auth commands") => {
        eprintln!("configure via `codewhale config set` before auth");
    }
    r => r?,
}

Prevention

When it happens

Trigger: Running any `codewhale auth ...` subcommand while supplying one or more `--set key=value` overrides on the same invocation.

Common situations: Scripted login attempts that bundle model/provider overrides with `auth login`, or users assuming runtime overrides apply globally to all subcommands.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


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

Appendix: source

Thrown at crates/cli/src/lib.rs:1951

    cli.telemetry = cli.telemetry.or(values.telemetry);
    Ok(())
}

fn run() -> Result<()> {
    let matches = Cli::command().get_matches();
    let project_bundle_scope = config_command_targets_project(&matches);
    let mut cli = Cli::from_arg_matches(&matches).unwrap_or_else(|error| error.exit());

    // The detached log proxy must not depend on user config parsing: its job
    // is to frame child output and publish a terminal receipt even when the
    // delegated command's own config is malformed.
    let (proxy, command) = split_lane_log_proxy_command(cli.command.take());
    if let Some(args) = proxy {
        return run_lane_log_proxy_command(args);
    }

    if !cli.overrides.is_empty() && matches!(command, Some(Commands::Auth(_))) {
        bail!("--set is not supported by auth commands; use a saved config");
    }
    if !cli.overrides.is_empty()
        && matches!(&command, Some(Commands::AppServer(args)) if !args.http && !args.mobile)
    {
        bail!(
            "--set is not supported by the legacy app-server transport; use app-server --http or a saved config"
        );
    }
    if !matches!(command, Some(Commands::Config(_))) {
        apply_runtime_set_overrides(&mut cli)?;
    }

    let pipe_api_key_handoff = matches!(
        &command,
        Some(Commands::Auth(AuthArgs {
            command: AuthCommand::PrintApiKey { .. }
        }))
    );

View on GitHub (pinned to 73e0f67d83)