code: def shell(args: argparse.Namespace) -> None:
      """Talk with a bot though the command line."""
      from rasa.cli.utils import get_validated_path
      from rasa.shared.constants import DEFAULT_MODELS_PATH
  
      args.connector = "cmdline"
  
      model = get_validated_path(
          args.model, "model", DEFAULT_MODELS_PATH
      )
  
      try:
          model = get_local_model(model)
      except ModelNotFound:
          print_error(
              "No model found. Train a model before running the "
              "server using `rasa train`."
          )
          return
  
      metadata = LocalModelStorage.metadata_from_archive(model)
  
      if metadata.assistant_id is None:
          print_error(
              f"The model metadata does not contain a value for the '{ASSISTANT_ID_KEY}' "
              f"attribute. Check that 'config.yml' file contains a value for "
              f"the '{ASSISTANT_ID_KEY}' key and re-train the model.",
          )
  
      if metadata.training_type == TrainingType.NLU:
          import rasa.nlu.run
  
          telemetry.track_shell_started("nlu")
  
          rasa.nlu.run.run_cmdline(model)
      else:
          import rasa.cli.run
  
          telemetry.track_shell_started("rasa")
  
          rasa.cli.run.run(args)
  
file_path: rasa/rasa/cli/shell.py
imports: import argparse
  import logging
  import uuid
  from typing import List
  from rasa import telemetry
  from rasa.cli import SubParsersAction
  from rasa.cli.arguments import shell
  from rasa.engine.storage.local_model_storage import LocalModelStorage
  from rasa.model import get_local_model
  from rasa.shared.constants import ASSISTANT_ID_KEY
  from rasa.shared.data import TrainingType
  from rasa.shared.utils.cli import print_error
  from rasa.exceptions import ModelNotFound
label_desc: Use image node_id 3 for calling a global function with example usage: shell(args) without return types