{"record":{"id":"52fb023afe4aa53c","repo":"spring-projects/spring-boot","slug":"1-s-is-not-a-valid-command-see-help-52fb02","errorCode":null,"errorMessage":"'%1$s' is not a valid command. See 'help'.","messagePattern":"'%1\\$s' is not a valid command\\. See 'help'\\.","errorType":"exception","errorClass":"NoSuchCommandException","httpStatus":null,"severity":"error","filePath":"cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/core/HelpCommand.java","lineNumber":121,"sourceCode":"\t\t\t\t}\n\t\t\t\tif (command.getHelp() != null) {\n\t\t\t\t\tLog.info(command.getHelp());\n\t\t\t\t}\n\t\t\t\tCollection<HelpExample> examples = command.getExamples();\n\t\t\t\tif (examples != null) {\n\t\t\t\t\tLog.info((examples.size() != 1) ? \"examples:\" : \"example:\");\n\t\t\t\t\tLog.info(\"\");\n\t\t\t\t\tfor (HelpExample example : examples) {\n\t\t\t\t\t\tLog.info(\"    \" + example.getDescription() + \":\");\n\t\t\t\t\t\tLog.info(\"        $ \" + example.getExample());\n\t\t\t\t\t\tLog.info(\"\");\n\t\t\t\t\t}\n\t\t\t\t\tLog.info(\"\");\n\t\t\t\t}\n\t\t\t\treturn ExitStatus.OK;\n\t\t\t}\n\t\t}\n\t\tthrow new NoSuchCommandException(commandName);\n\t}\n\n}\n","sourceCodeStart":103,"sourceCodeEnd":125,"githubUrl":"https://github.com/spring-projects/spring-boot/blob/270dfe353fb830fd69b823a8a859287ff103854b/cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/core/HelpCommand.java#L103-L125","documentation":"Thrown by HelpCommand when 'spring help <name>' is invoked and <name> matches no registered command. HelpCommand walks its own known-command list and, on no match, throws NoSuchCommandException with the requested name. Same exception type as [80] but reached via the help subcommand's lookup.","triggerScenarios":"Running 'spring help foobar' where foobar is not a registered command name.","commonSituations":"Asking for help on a command from an extension that is not loaded; misspelling the command name when invoking help.","solutions":["Run 'spring help' with no argument to see the full command list","Correct the command name you are requesting help for","Ensure any extension providing the command is installed"],"exampleFix":"// before\n$ spring help buld\n// after\n$ spring help build","handlingStrategy":"validation","validationCode":"// Validate the target command name before requesting help.\nString name = requestedHelpTarget;\nif (name != null && !knownCommandNames.contains(name)) {\n    System.err.println(\"No help for '\" + name + \"'. Run 'spring help' for the list.\");\n    return;\n}","typeGuard":null,"tryCatchPattern":"try {\n    runner.run(\"help\", name);\n} catch (org.springframework.boot.cli.command.NoSuchCommandException ex) {\n    System.err.println(ex.getMessage());\n}","preventionTips":["Run 'spring help' (no argument) to enumerate commands before asking help on one","Avoid scripting 'spring help <name>' for commands from optional extensions"],"tags":["cli","command-not-found","help","spring-boot-cli"],"backgroundTag":null,"analyzedSha":"270dfe353fb830fd69b823a8a859287ff103854b","analyzedAt":"2026-08-11T19:42:06.541Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}