astral-sh/uv · warning

There is no command {}. Did you mean one of: {}

Error message

There is no command {}. Did you mean one of:
    {}

What it means

Produced by `uv help <query...>`: find_command walks the clap command tree and, on failure, returns the unmatched trailing terms plus the nearest matched command. The error formats which subcommand path was unresolved and lists that command's visible subcommands (hidden ones and `help` filtered out) as suggestions. It is purely a lookup failure in the help subsystem, not a runtime error.

Source

Thrown at crates/uv/src/commands/help.rs:38

pub(crate) fn help(query: &[String], printer: Printer, no_pager: bool) -> Result<ExitStatus> {
    let mut uv: clap::Command = SHOW_HIDDEN_COMMANDS
        .iter()
        .fold(Cli::command(), |uv, &name| {
            uv.mut_subcommand(name, |cmd| cmd.hide(false))
        });

    // It is very important to build the command before beginning inspection or subcommands
    // will be missing all of the propagated options.
    uv.build();

    let command = find_command(query, &uv).map_err(|(unmatched, nearest)| {
        let missing = if unmatched.len() == query.len() {
            format!("`{}` for `uv`", query.join(" "))
        } else {
            format!("`{}` for `uv {}`", unmatched.join(" "), nearest.get_name())
        };
        anyhow!(
            "There is no command {}. Did you mean one of:\n    {}",
            missing,
            nearest
                .get_subcommands()
                .filter(|cmd| !cmd.is_hide_set())
                .map(clap::Command::get_name)
                .filter(|name| *name != "help")
                .join("\n    "),
        )
    })?;

    let name = command.get_name();
    let is_root = name == uv.get_name();
    let mut command = command.clone();

    let help = if is_root {
        command
            .after_help(format!(

View on GitHub (pinned to f1a42680ff)

Solutions

  1. Read the suggestion list in the error and re-run with one of those exact subcommand names.
  2. Check spelling/order: each query term must descend the command tree (`uv help pip compile`, not `uv help compile pip`).
  3. Run bare `uv help` to see the full top-level command list, then narrow down.

Example fix

# before
uv help synk
# after
uv help sync
Defensive patterns

Strategy: fallback

Validate before calling

# Shell: verify a command path exists before generating help topics
uv help 2>/dev/null | grep -qx ".*$CMD.*" || { echo "unknown topic: $CMD" >&2; uv help; exit 1; }

Type guard

fn is_known_command(query: &[String], uv: &clap::Command) -> bool {
    find_command(query, uv).is_ok()
}

Try / catch

match help(&query, printer, no_pager) {
    Ok(status) => Ok(status),
    Err(err) if err.to_string().contains("There is no command") => {
        // fall back to top-level help listing real commands
        help(&[], printer, no_pager)
    }
    Err(err) => Err(err),
}

Prevention

When it happens

Trigger: `uv help pip compile` when 'pip' has no child 'compile' (`uv pip compile` exists but the query structure was wrong); `uv help synk` (typo for sync); querying a hidden command's subcommands that are themselves hidden.

Common situations: Users coming from pip trying `uv help install`; typos; scripts generating help topics from a list where one entry is stale after a command rename across uv versions.

Related errors


AI-assisted analysis of astral-sh/uv@f1a42680ff (2026-08-16). Data as JSON: /api/errors/daa948ca79ff1fe3. Report an issue: GitHub.