{"id":"4b4085195be303aa","repo":"pypa/pip","slug":"unknown-command-cmd-name-maybe-you-meant-g-4b4085","errorCode":null,"errorMessage":"unknown command \"{cmd_name}\" - maybe you meant \"{guess}\"","messagePattern":"unknown command \"(.+?)\" - maybe you meant \"(.+?)\"","errorType":"exception","errorClass":"CommandError","httpStatus":null,"severity":"warning","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/d7d0d0a39494e28ec1c407bd0680e4a4d1067791/src/pip/_internal/commands/help.py#L17-L41","documentation":"Raised by HelpCommand.run when 'pip help <cmd>' is invoked with a command name that is not registered in commands_dict. pip computes the closest match via get_similar_commands (difflib-based) and, if a suggestion exists, appends 'maybe you meant \"<guess>\"'.","triggerScenarios":"Running 'pip help instal', 'pip help isntall', 'pip help frozenset' - any token that is not a real pip command. help.py:28 checks commands_dict and help.py:29 computes a guess.","commonSituations":"Typos; tab-completion off; scripts referencing a renamed/removed command; users coming from another package manager's vocabulary.","solutions":["Use the suggested command if one is offered.","Run 'pip help' with no argument to list all available commands.","Check spelling against 'pip list' of commands or the docs."],"exampleFix":"// before\npip help instal\n// after\npip help install","handlingStrategy":"validation","validationCode":"from difflib import get_close_matches\nknown = {\"install\", \"download\", \"uninstall\", \"list\", \"show\", \"freeze\", \"search\", \"wheel\", \"cache\", \"config\", \"help\"}\nif cmd not in known:\n    guess = get_close_matches(cmd, known, n=1)\n    raise SystemExit(f\"unknown command {cmd!r}\" + (f\", did you mean {guess[0]!r}?\" if guess else \"\"))","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run 'pip help' (no arg) to list valid commands.","Validate user-supplied command names against commands_dict before dispatch."],"tags":["pip","help","cli","unknown-command","typo"],"analyzedSha":"d7d0d0a39494e28ec1c407bd0680e4a4d1067791","analyzedAt":"2026-08-04T20:55:04.259Z","schemaVersion":2}