{"record":{"id":"daa948ca79ff1fe3","repo":"astral-sh/uv","slug":"there-is-no-command-did-you-mean-one-of","errorCode":null,"errorMessage":"There is no command {}. Did you mean one of:\n    {}","messagePattern":"There is no command (.+?)\\. Did you mean one of:\n    (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/uv/src/commands/help.rs","lineNumber":38,"sourceCode":"\npub(crate) fn help(query: &[String], printer: Printer, no_pager: bool) -> Result<ExitStatus> {\n    let mut uv: clap::Command = SHOW_HIDDEN_COMMANDS\n        .iter()\n        .fold(Cli::command(), |uv, &name| {\n            uv.mut_subcommand(name, |cmd| cmd.hide(false))\n        });\n\n    // It is very important to build the command before beginning inspection or subcommands\n    // will be missing all of the propagated options.\n    uv.build();\n\n    let command = find_command(query, &uv).map_err(|(unmatched, nearest)| {\n        let missing = if unmatched.len() == query.len() {\n            format!(\"`{}` for `uv`\", query.join(\" \"))\n        } else {\n            format!(\"`{}` for `uv {}`\", unmatched.join(\" \"), nearest.get_name())\n        };\n        anyhow!(\n            \"There is no command {}. Did you mean one of:\\n    {}\",\n            missing,\n            nearest\n                .get_subcommands()\n                .filter(|cmd| !cmd.is_hide_set())\n                .map(clap::Command::get_name)\n                .filter(|name| *name != \"help\")\n                .join(\"\\n    \"),\n        )\n    })?;\n\n    let name = command.get_name();\n    let is_root = name == uv.get_name();\n    let mut command = command.clone();\n\n    let help = if is_root {\n        command\n            .after_help(format!(","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/astral-sh/uv/blob/f1a42680ff5272232d65748acf338b19778dde24/crates/uv/src/commands/help.rs#L20-L56","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","solutions":["Read the suggestion list in the error and re-run with one of those exact subcommand names.","Check spelling/order: each query term must descend the command tree (`uv help pip compile`, not `uv help compile pip`).","Run bare `uv help` to see the full top-level command list, then narrow down."],"exampleFix":"# before\nuv help synk\n# after\nuv help sync","handlingStrategy":"fallback","validationCode":"# Shell: verify a command path exists before generating help topics\nuv help 2>/dev/null | grep -qx \".*$CMD.*\" || { echo \"unknown topic: $CMD\" >&2; uv help; exit 1; }","typeGuard":"fn is_known_command(query: &[String], uv: &clap::Command) -> bool {\n    find_command(query, uv).is_ok()\n}","tryCatchPattern":"match help(&query, printer, no_pager) {\n    Ok(status) => Ok(status),\n    Err(err) if err.to_string().contains(\"There is no command\") => {\n        // fall back to top-level help listing real commands\n        help(&[], printer, no_pager)\n    }\n    Err(err) => Err(err),\n}","preventionTips":["Run bare `uv help` first and copy command names verbatim.","Query terms must descend the tree in order (`uv help pip compile`).","Regenerate any scripted help-topic lists when upgrading uv, since commands get renamed."],"tags":["help","cli-usage","clap"],"backgroundTag":null,"analyzedSha":"f1a42680ff5272232d65748acf338b19778dde24","analyzedAt":"2026-08-16T04:51:47.599Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}