def METHOD_NAME(
    ctx,
    message,
    directory,
    import_from,
    do_checkout,
    bare,
    initial_branch,
    wc_location,
    max_delta_depth,
    num_workers,
    spatial_filter_spec,
):
    """
    Initialise a new repository and optionally import data.
    DIRECTORY must be empty. Defaults to the current directory.
    """
    if directory is None:
        directory = os.curdir
    repo_path = Path(directory).resolve()
    if repo_path.exists() and any(repo_path.iterdir()):
        raise InvalidOperation(f'"{repo_path}" isn\'t empty', param_hint="directory")
    from kart.tabular.working_copy.base import TableWorkingCopy
    TableWorkingCopy.check_valid_creation_location(
        wc_location, PotentialRepo(repo_path)
    )
    if not repo_path.exists():
        repo_path.mkdir(parents=True)
    if import_from:
        check_git_user(repo=None)
        base_source = TableImportSource.open(import_from)
        # Import all tables.
        # If you need finer grained control than this,
        # use `kart init` and *then* `kart import` as a separate command.
        tables = base_source.get_tables().keys()
        sources = [base_source.clone_for_table(t) for t in tables]
    # Create the repository
    repo = KartRepo.init_repository(
        repo_path,
        wc_location,
        bare,
        initial_branch=initial_branch,
        spatial_filter_spec=spatial_filter_spec,
    )
    if import_from:
        validate_dataset_paths([s.dest_path for s in sources])
        fast_import_tables(
            repo,
            sources,
            settings=FastImportSettings(max_delta_depth=max_delta_depth),
            from_commit=None,
            message=message,
        )
        if do_checkout:
            repo.working_copy.reset_to_head(create_parts_if_missing=[PartType.TABULAR])
    else:
        click.echo(
            f"Created an empty repository at {repo_path} — import some data with `kart import`"
        )