nikivdev/code · error

missing prompt. Usage: f ai everruns "your prompt"

Error message

missing prompt. Usage: f ai everruns "your prompt"

What it means

Thrown by resolve_prompt() when no prompt arguments were given AND stdin is a terminal, meaning there is no piped input to read. Since `f ai everruns` requires a prompt either as an argument or via stdin pipe, running it interactively with no argument would block forever waiting for terminal stdin, so the tool bails with usage guidance instead.

Source

Thrown at src/ai_everruns.rs:98

            "runtime_ms": runtime_ms,
            "error": err.to_string(),
            "error_class": classify_error_text(&err.to_string()),
        })),
    }
    result
}

fn resolve_prompt(opts: &AiEverrunsOpts) -> Result<String> {
    if !opts.prompt.is_empty() {
        let joined = opts.prompt.join(" ").trim().to_string();
        if joined.is_empty() {
            bail!("prompt is empty");
        };
        return Ok(joined);
    }

    if io::stdin().is_terminal() {
        bail!("missing prompt. Usage: f ai everruns \"your prompt\"");
    }

    let mut buf = String::new();
    io::stdin()
        .read_to_string(&mut buf)
        .context("failed to read prompt from stdin")?;
    let prompt = buf.trim().to_string();
    if prompt.is_empty() {
        bail!("prompt from stdin is empty");
    }
    Ok(prompt)
}

fn wait_for_completion(
    api: &EverrunsApi,
    seq_bridge: &SeqBridge,
    session_id: &str,
    input_message_id: &str,

View on GitHub (pinned to a747e741ae)

Solutions

  1. Pass the prompt as an argument: f ai everruns "your prompt"
  2. Pipe the prompt via stdin: echo "your prompt" | f ai everruns
  3. If invoked from a script, ensure the script forwards its prompt argument through
  4. Read the usage hint in the message and supply one of the two accepted input forms

Example fix

// before
f ai everruns          # no args, interactive TTY
// after
echo "audit the everruns output" | f ai everruns
// or
f ai everruns "audit the everruns output"
Defensive patterns

Strategy: validation

Validate before calling

# shell: ensure one of the two accepted inputs is present
if [ $# -eq 0 ] && ! [ -p /dev/stdin ]; then
  echo 'usage: f ai everruns "your prompt" (arg or stdin pipe)'; exit 1
fi
f ai everruns "$@"

Try / catch

// caller-side arg check; no runtime catch needed
anyhow::ensure!(
    !args.is_empty() || !std::io::stdin().is_terminal(),
    "f ai everruns needs a prompt argument or piped stdin"
);

Prevention

When it happens

Trigger: Running `f ai everruns` with zero prompt arguments in an interactive terminal (io::stdin().is_terminal() == true), so neither the args path nor a piped-stdin path can supply a prompt.

Common situations: Forgetting to quote/pass the prompt when testing the command manually; running the bare command to 'see what it does'; copy-pasting a piped example without the pipe (`echo x |` dropped); aliases or wrappers that drop arguments.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/181e5dd1e72079ee. Report an issue: GitHub.