def METHOD_NAME(
    ctx,
    project_dir,
    project_conf,
    environment,
    load_mode,
    verbose,
    interface,
    __unprocessed,
):
    app.set_session_var("custom_project_conf", project_conf)
    # use env variables from Eclipse or CLion
    for name in ("CWD", "PWD", "PLATFORMIO_PROJECT_DIR"):
        if is_platformio_project(project_dir):
            break
        if os.getenv(name):
            project_dir = os.getenv(name)
    with fs.cd(project_dir):
        project_config = ProjectConfig.get_instance(project_conf)
        project_config.validate(envs=[environment] if environment else None)
        env_name = environment or helpers.get_default_debug_env(project_config)
        if not interface:
            return helpers.predebug_project(
                ctx, project_dir, project_config, env_name, False, verbose
            )
        configure_args = (
            ctx,
            project_config,
            env_name,
            load_mode,
            verbose,
            __unprocessed,
        )
        if helpers.is_gdbmi_mode():
            os.environ["PLATFORMIO_DISABLE_PROGRESSBAR"] = "true"
            stream = helpers.GDBMIConsoleStream()
            with proc.capture_std_streams(stream):
                debug_config = _configure(*configure_args)
            stream.close()
        else:
            debug_config = _configure(*configure_args)
        _run(project_dir, debug_config, __unprocessed)
    return None