nikivdev/code · error

No prompt provided. Usage: f agents run {} "your prompt here

Error message

No prompt provided.
Usage: f agents run {} "your prompt here"

What it means

run_agent joins the prompt arguments into a single string and rejects an empty result, including usage text naming the agent. This is the canonical 'missing prompt' guard for `f agents run <agent>`; unlike error 11 it tells the caller exactly how to invoke the command.

Source

Thrown at src/agents.rs:874

/// Get the configured agent tool and model.
fn get_agent_config() -> (String, Option<String>) {
    if let Some(ts_config) = config::load_ts_config() {
        if let Some(flow) = ts_config.flow {
            if let Some(agents) = flow.agents {
                let tool = agents.tool.unwrap_or_else(|| "gen".to_string());
                return (tool, agents.model);
            }
        }
    }
    ("gen".to_string(), None)
}

/// Run an agent with a prompt.
fn run_agent(agent: &str, prompt: Vec<String>) -> Result<()> {
    let prompt_str = prompt.join(" ");
    if prompt_str.is_empty() {
        bail!(
            "No prompt provided.\nUsage: f agents run {} \"your prompt here\"",
            agent
        );
    }

    // Build the full prompt based on agent type
    let full_prompt = if agent == FLOW_AGENT_NAME {
        build_flow_prompt(&prompt_str)?
    } else {
        // Regular subagent - use Task tool
        format!(
            "Use the Task tool with subagent_type='{}' to: {}",
            agent, prompt_str
        )
    };

    println!("Invoking {} agent...\n", agent);

View on GitHub (pinned to a747e741ae)

Solutions

  1. Provide the prompt as shown in the usage line: `f agents run <agent> "your prompt here"`.
  2. Quote prompts with spaces/special characters.
  3. Ensure the calling script substitutes a non-empty prompt variable.
  4. If invoking programmatically, validate the prompt vec is non-empty before calling run_agent.

Example fix

// before
f agents run claude
// error includes usage
// after
f agents run claude "summarize the failing tests"
Defensive patterns

Strategy: validation

Validate before calling

[ $# -ge 1 ] && f agents run "$1" "${@:2}" || { echo 'Usage: f agents run <agent> "prompt"'; exit 2; }

Type guard

fn prompt_supplied(args: &[String]) -> bool {
    !args.join(" ").trim().is_empty()
}

Try / catch

match run_agent(agent, prompt) {
    Err(e) if e.to_string().contains("No prompt provided") => {
        eprintln!("Pass a prompt: f agents run {agent} \"...\"");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Invoking run_agent (directly, via run, run_fuzzy_agents, or run_agent_optional fallback) with an empty prompt vector, e.g. `f agents run claude` with no prompt words.

Common situations: Forgot the prompt argument; shell quoting swallowed the argument; a script passed an empty variable as the prompt.

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/265514fa894e5fc1. Report an issue: GitHub.