CLI: sort commands alphabetically in help output

Fixes #7964

Added sortSubcommands: true to configureHelp() to display
commands in alphabetical order when running 'openclaw --help'.
This commit is contained in:
Soumyadeep Ghosh
2026-02-04 10:50:14 +05:30
committed by Ayaan Zaidi
parent 34424ce536
commit 203e3804b3

View File

@@ -47,6 +47,9 @@ export function configureProgramHelp(program: Command, ctx: ProgramContext) {
program.option("--no-color", "Disable ANSI colors", false);
program.configureHelp({
// sort options and subcommands alphabetically
sortSubcommands: true,
sortOptions: true,
optionTerm: (option) => theme.option(option.flags),
subcommandTerm: (cmd) => theme.command(cmd.name()),
});