{"record":{"id":"4b4085195be303aa","repo":"pypa/pip","slug":"unknown-command-cmd-name-maybe-you-meant-g","errorCode":null,"errorMessage":"unknown command \"{cmd_name}\" - maybe you meant \"{guess}\"","messagePattern":"unknown command \"(.+?)\" - maybe you meant \"(.+?)\"","errorType":"exception","errorClass":"CommandError","httpStatus":null,"severity":"error","filePath":"src/pip/_internal/commands/help.py","lineNumber":35,"sourceCode":"            commands_dict,\n            create_command,\n            get_similar_commands,\n        )\n\n        try:\n            # 'pip help' with no args is handled by pip.__init__.parseopt()\n            cmd_name = args[0]  # the command we need help for\n        except IndexError:\n            return SUCCESS\n\n        if cmd_name not in commands_dict:\n            guess = get_similar_commands(cmd_name)\n\n            msg = [f'unknown command \"{cmd_name}\"']\n            if guess:\n                msg.append(f'maybe you meant \"{guess}\"')\n\n            raise CommandError(\" - \".join(msg))\n\n        command = create_command(cmd_name)\n        command.parser.print_help()\n\n        return SUCCESS\n","sourceCodeStart":17,"sourceCodeEnd":41,"githubUrl":"https://github.com/pypa/pip/blob/f399c3718970b1b0e2478dac5296eb62679a9b86/src/pip/_internal/commands/help.py#L17-L41","documentation":"Raised by `pip help` when the requested command name does not exist. HelpCommand.run at help.py:28 looks up cmd_name in commands_dict; on miss it calls get_similar_commands to find a likely match and raises a CommandError with 'unknown command' plus an optional 'maybe you meant' suggestion.","triggerScenarios":"Invoking `pip help <bad-name>` where <bad-name> is not a registered pip command (e.g. `pip help instal`, `pip help instal`). Levenshtein-style suggestions are attempted.","commonSituations":"Typos, deprecated command names, or confusion between pip and another tool's vocabulary. The suggestion helps catch simple misspellings.","solutions":["Check the suggestion in the message — 'maybe you meant \"install\"'.","Run `pip help` (no args) or `pip --help` to list all available commands.","Correct the command name and retry."],"exampleFix":"// before\npip help instal\n// after\npip help install","handlingStrategy":"validation","validationCode":"# Validate the command name before pip help\nfrom pip._internal.commands import commands_dict, get_similar_commands\n\ndef validate_help_cmd(name):\n    if name not in commands_dict:\n        guess = get_similar_commands(name)\n        raise ValueError(\"unknown command %r%s\" % (name, (\"; did you mean %r?\" % guess) if guess else \"\"))\n    return True\n","typeGuard":null,"tryCatchPattern":null,"preventionTips":["List valid commands with `pip help` (no args) before requesting help on one.","Use the suggestion in the error to correct typos."],"tags":["cli","pip-help","command-resolution","typo","usage-error"],"backgroundTag":null,"analyzedSha":"f399c3718970b1b0e2478dac5296eb62679a9b86","analyzedAt":"2026-08-08T23:01:42.227Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}