class_docstr: Click command class customized for BentoML CLI, allow specifying a default
  command for each group defined.
  
  This command groups will also introduce support for aliases for commands and groups.
  
  Example:
  
  .. code-block:: python
  
      @click.group(cls=BentoMLCommandGroup)
      def cli(): ...
  
      @click.group(name="cloud", aliases=["cloud"], cls=BentoMLCommandGroup)
      def cli(): ...
  
      @cli.command(aliases=["serve-http"])
      def serve(): ...
code: def format_commands(
      self, ctx: Context, formatter: HelpFormatter
  ) -> None:
      rows: list[tuple[str, str]] = []
      sub_commands = self.list_commands(ctx)
  
      max_len = max(len(cmd) for cmd in sub_commands)
      limit = formatter.width - 6 - max_len
  
      for sub_command in sub_commands:
          cmd = self.get_command(ctx, sub_command)
          if cmd is None:
              continue
          # If the command is hidden, then we skip it.
          if hasattr(cmd, "hidden") and cmd.hidden:
              continue
          if sub_command in self._commands:
              aliases = ", ".join(sorted(self._commands[sub_command]))
              sub_command = "%s (%s)" % (sub_command, aliases)
          # this cmd_help is available since click>=7
          # BentoML requires click>=7.
          cmd_help = cmd.get_short_help_str(limit)
          rows.append((sub_command, cmd_help))
      if rows:
          with formatter.section("Commands"):
              formatter.write_dl(rows)
  
imports: from __future__ import annotations
  import difflib
  import functools
  import logging
  import os
  import re
  import time
  import typing
  import attr
  import click
  import click_option_group
  from click import ClickException
  from click.exceptions import UsageError
label_desc: Use image node_id 9 for calling the BentoMLCommandGroup obj's underlying member method code with example usage: obj.format_commands(ctx, formatter) without return types