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 command(
      self, *args: t.Any, **kwargs: t.Any
  ) -> t.Callable[[F[P]], Command]:
      if "context_settings" not in kwargs:
          kwargs["context_settings"] = {}
      kwargs["context_settings"]["max_content_width"] = 120
      aliases = kwargs.pop("aliases", None)
  
      def wrapper(func: F[P]) -> Command:
          # add common parameters to command.
          options = BentoMLCommandGroup.bentoml_common_params(func)
          # Send tracking events before command finish.
          usage = BentoMLCommandGroup.bentoml_track_usage(
              options, self, **kwargs
          )
          # If BentoMLException raise ClickException instead before exit.
          wrapped = BentoMLCommandGroup.raise_click_exception(
              usage, self, **kwargs
          )
  
          # move common parameters to end of the parameters list
          wrapped.__click_params__ = (
              wrapped.__click_params__[-self.NUMBER_OF_COMMON_PARAMS :]
              + wrapped.__click_params__[
                  : -self.NUMBER_OF_COMMON_PARAMS
              ]
          )
          cmd = super(BentoMLCommandGroup, self).command(
              *args, **kwargs
          )(wrapped)
          # add aliases to a given commands if it is specified.
          if aliases is not None:
              assert cmd.name
              self._commands[cmd.name] = aliases
              self._aliases.update(
                  {alias: cmd.name for alias in aliases}
              )
          return cmd
  
      return wrapper
  
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 5 for calling the BentoMLCommandGroup obj's underlying member method code with example usage: obj.command() and returns: wrapper, cmd