public function init($_, $assoc_args)
    {
        $this->init_args(func_get_args());
        $path = $this->resolve_file_path();

        if (file_exists($path) && ! $this->get_flag('force')) {
            WP_CLI::error("Environment file already exists at: $path");

            return;
        }

        $env = File::create($path);

        if (! $env->exists()) {
            WP_CLI::error('Failed to create environment file at: ' . $env->path());

            return;
        }

        if ($this->args->template) {
            $this->init_from_template($env, $this->args->template);
        }

        if ($this->get_flag('with-salts')) {
            WP_CLI::run_command(['dotenv', 'salts', 'generate'], ['file' => $env->path()]);
        }

        WP_CLI::success("$path created.");
    }