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 raise_click_exception(
      func: F[P] | WrappedCLI[bool],
      cmd_group: click.Group,
      **kwargs: t.Any,
  ) -> ClickFunctionWrapper[t.Any]:
      from bentoml._internal.configuration import get_debug_mode
      from bentoml.exceptions import BentoMLException
  
      command_name = kwargs.get("name", func.__name__)
  
      @functools.wraps(func)
      def wrapper(*args: P.args, **kwargs: P.kwargs) -> t.Any:
          try:
              return func(*args, **kwargs)
          except BentoMLException as err:
              msg = f"[{cmd_group.name}] `{command_name}` failed: {str(err)}"
              if get_debug_mode():
                  ClickException(click.style(msg, fg="red")).show()
                  raise err from None
              else:
                  raise ClickException(
                      click.style(msg, fg="red")
                  ) from err
  
      return t.cast("ClickFunctionWrapper[t.Any]", 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 3 for calling the BentoMLCommandGroup obj's underlying member method code with example usage: obj.raise_click_exception(func, cmd_group) and returns: t, func