docs: def cli(ctx, database, username, password, authdb, port, host, uri, verbose, config, test):
      """loqusdb: manage a local variant count database."""
      loglevel = "INFO"
      if verbose:
          loglevel = "DEBUG"
      coloredlogs.install(level=loglevel)
      LOG.info("Running loqusdb version %s", __version__)
  
      configs = {}
      if config:
          try:
              configs = yaml.safe_load(config)
          except yaml.YAMLError as err:
              LOG.warning(err)
              ctx.abort()
      
      uri = configs.get('uri') or uri
      if test:
          uri = "mongomock://"
      try:
          client = get_client(
              host=configs.get('host') or host,
              port=configs.get('port') or port,
              username=configs.get('username') or username,
              password=configs.get('password') or password,
              authdb=authdb or database or 'loqusdb',
              uri=uri,
          )
      except DB_Error as err:
          LOG.warning(err)
          ctx.abort()
      
      database = configs.get('db_name') or database
      
      if not database:
          database = 'loqusdb'
          if uri:
              uri_info = uri_parser.parse_uri(uri)
              database = uri_info.get('database')
  
      adapter = MongoAdapter(client, db_name=database)
  
      ctx.obj = {}
      ctx.obj['db'] = database
      ctx.obj['user'] = username
      ctx.obj['password'] = password
      ctx.obj['port'] = port
      ctx.obj['host'] = host
      ctx.obj['adapter'] = adapter
      ctx.obj['version'] = __version__