public String getHelp(String buffer, int terminalWidth) {
    if (StringUtils.isBlank(buffer)) {
      return getHelp().toString(terminalWidth);
    }

    List<Method> methodList = commands.keySet()
        .stream()
        .filter(key -> key.startsWith(buffer))
        .map(commands::get).collect(Collectors.toList());

    boolean summarize = methodList.size() > 1;
    String helpString = methodList.stream()
        .map(m -> getHelp(m.getDeclaredAnnotation(CliCommand.class),
            summarize ? null : m.getParameterAnnotations(),
            summarize ? null : m.getParameterTypes()))
        .map(helpBlock -> helpBlock.toString(terminalWidth))
        .reduce((s, s2) -> s + s2)
        .orElse(NO_HELP_EXISTS_FOR_THIS_COMMAND);

    if (summarize) {
      helpString += HELP_INSTRUCTIONS;
    }

    return helpString;
  }
get help string for a specific command, or a brief description of all the commands if buffer is
null or empty
geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/help/Helper.java