spring-projects/spring-boot · error · NoSuchCommandException
'%1$s' is not a valid command. See 'help'.
Error message
'%1$s' is not a valid command. See 'help'.
What it means
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.
Source
Thrown at cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/core/HelpCommand.java:121
}
if (command.getHelp() != null) {
Log.info(command.getHelp());
}
Collection<HelpExample> examples = command.getExamples();
if (examples != null) {
Log.info((examples.size() != 1) ? "examples:" : "example:");
Log.info("");
for (HelpExample example : examples) {
Log.info(" " + example.getDescription() + ":");
Log.info(" $ " + example.getExample());
Log.info("");
}
Log.info("");
}
return ExitStatus.OK;
}
}
throw new NoSuchCommandException(commandName);
}
}
View on GitHub (pinned to 270dfe353f)
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
Example fix
// before $ spring help buld // after $ spring help build
Defensive patterns
Strategy: validation
Validate before calling
// Validate the target command name before requesting help.
String name = requestedHelpTarget;
if (name != null && !knownCommandNames.contains(name)) {
System.err.println("No help for '" + name + "'. Run 'spring help' for the list.");
return;
} Try / catch
try {
runner.run("help", name);
} catch (org.springframework.boot.cli.command.NoSuchCommandException ex) {
System.err.println(ex.getMessage());
} Prevention
- Run 'spring help' (no argument) to enumerate commands before asking help on one
- Avoid scripting 'spring help <name>' for commands from optional extensions
When it happens
Trigger: Running 'spring help foobar' where foobar is not a registered command name.
Common situations: Asking for help on a command from an extension that is not loaded; misspelling the command name when invoking help.
Related errors
- '%1$s' is not a valid command. See 'help'.
- Invalid content received from server ({})
- No content received from server '{}'
- Failed to {} from service at '{}' ({})
- Initializr service call failed using '{}' - service returned
AI-assisted analysis of spring-projects/spring-boot@270dfe353f (2026-08-11).
Data as JSON: /api/errors/52fb023afe4aa53c.
Report an issue: GitHub.