Hmbown/CodeWhale · error

Use one of: a prompt, --status, --list, --show

Error message

Use one of: a prompt, --status, --list, --show <id>, or --cancel <id>.

What it means

This error is thrown by the CLI dispatch layer (`run_with` in crates/cli/src/dispatch.rs) when the user supplied more than one mutually exclusive top-level invocation mode at once (e.g. a positional prompt together with --status, --list, --show, or --cancel). The dispatch loop counts the enabled mode flags and refuses any combination greater than one, since exactly one action per invocation is the only well-defined dispatch. It exists to give a clear usage message instead of silently picking one mode.

Solutions

  1. Remove all but one invocation mode: either a positional prompt, or exactly one of --status, --list, --show <id>, --cancel <id>.
  2. If you wanted to run a prompt AND query status, split it into two separate CLI invocations.
  3. Check the shell script/alias composing the command line for a hardcoded flag that duplicates the interactive one.

Example fix

// before
codewhale "refactor module" --status
// after
codewhale --status
codewhale "refactor module"
Defensive patterns

Strategy: validation

Validate before calling

const MODES = ['--status','--list','--show','--cancel'];
const argv = process.argv.slice(2);
const used = MODES.filter(f => argv.includes(f));
const hasPrompt = argv.some(a => !a.startsWith('--'));
if (used.length + (hasPrompt ? 1 : 0) > 1) throw new Error('Use one invocation mode per codewhale call');

Prevention

When it happens

Trigger: Running `codewhale "do stuff" --status`, `codewhale --list --show job1`, or any invocation where the `.iter().filter(|flag| **flag).count() > 1` check over the mode flags ([status, list, show, cancel] plus presence of a prompt) is satisfied by two or more flags.

Common situations: Shell scripts appending a default flag to a user-supplied command; typos where an id like `--show abc --status` was meant to be a single subcommand; muscle memory from tools where a flag and prompt can combine; copied example commands that were concatenated.

Understand the failure class

Background: "mutually exclusive" flag errors: what "can't supply both nx and xx", "--raw is not compatible with -i" and "cannot be used with" mean, and how to fix them — this error's family across 29 libraries.

Related errors


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

Appendix: source

Thrown at crates/cli/src/dispatch.rs:81

pub(crate) fn run(args: DispatchArgs) -> Result<()> {
    let mut out = io::stdout().lock();
    run_with(args, &mut out)
}

fn run_with<W: Write>(args: DispatchArgs, out: &mut W) -> Result<()> {
    if [
        args.status,
        args.list,
        args.show.is_some(),
        args.cancel.is_some(),
        !args.prompt.is_empty(),
    ]
    .iter()
    .filter(|flag| **flag)
    .count()
        > 1
    {
        bail!("Use one of: a prompt, --status, --list, --show <id>, or --cancel <id>.");
    }

    let workspace = args
        .cwd
        .clone()
        .unwrap_or_else(|| std::env::current_dir().unwrap_or_else(|_| PathBuf::from(".")));
    let remotes = discover_remotes(&workspace);
    let credentials = discover_credentials();
    let store = CloudJobStore::from_env()?;

    if args.status
        || (args.prompt.is_empty() && args.show.is_none() && args.cancel.is_none() && !args.list)
    {
        writeln!(
            out,
            "{}",
            format_status(&remotes, &credentials, &recent_jobs(&store))
        )?;

View on GitHub (pinned to 73e0f67d83)