> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: create init

## Article: create init

## Article Link: https://dev.wix.com/docs/wix-cli/command-reference/project-creation/create-init.md

## Article Content:

# npm create @wix/new init

Initializes a new [Wix-managed headless](https://dev.wix.com/docs/go-headless/get-started/choose-your-development-path.md) project in the current folder.

Run this command at the root of the folder you want to connect. The command signs you in, creates the project, and saves the generated configuration locally so you can start developing. It runs without prompts: the business name is derived from the current folder's name, and the project is created from the blank template.

> **Note:** This command is provided by the [`@wix/create-new`](https://www.npmjs.com/package/@wix/create-new) package, which is invoked through `npm create`. It's a separate package from `@wix/cli` and operates on the project in the current working directory.

## Before you begin

You need to have a folder that already contains your project code.

## Usage

```bash
npm create @wix/new@latest init
```

This command takes no flags other than `-h`, `--help` to display help for the command.

## After the command runs

The command operates on the current folder in place — it doesn't create a new project folder or modify your existing files. It:

- Provisions a Wix site for your project, listed on the [Sites page](https://manage.wix.com/account/sites) of your Wix account.
- Writes a `wix.config.json` file containing the site's `siteId` and the `appId` of its private app.

After the command runs, your folder contains a `wix.config.json` similar to the following:

```json
{
  "projectType": "Site",
  "appId": "<appId>",
  "siteId": "<siteId>",
  "site": {
    "outputDirectory": "./dist"
  }
}
```

To start a local development environment, run [`wix dev`](https://dev.wix.com/docs/wix-cli/command-reference/project-commands/dev.md).

## Errors

The command fails if the current folder already contains a `wix.config.json` file.

## `create headless` vs. `init`

Both commands provision the same Wix headless project and write a local `wix.config.json` file that connects it to your code. A Wix headless project consists of:

- **Site**: The Wix site your code targets, identified by the `siteId` in `wix.config.json`. It's the same entity as your [business](https://dev.wix.com/docs/go-headless/get-started/choose-your-development-path.md), which is the workspace in your Wix account with a dashboard, billing, and business solutions, listed on the [Sites page](https://manage.wix.com/account/sites).
- **[Private app](https://dev.wix.com/docs/build-apps/get-started/overview/exposing-apps-publicly-and-privately.md)**: Authorizes that code to call the site's APIs and add extensions, identified by the `appId` in `wix.config.json`.

### When to use each

- [`create headless`](https://dev.wix.com/docs/wix-cli/command-reference/project-creation/create-headless.md) scaffolds a complete, opinionated Astro project for you. It generates project files from a site template, installs dependencies, initializes a Git repository, and publishes your site. Use it when you want Wix to set up the project structure and frontend for you.
- `init` connects project code you already have. It only provisions the Wix headless project and writes `wix.config.json`, leaving the rest of your folder untouched. It doesn't generate a template, install dependencies, initialize Git, or publish your site. Use it when you just want to connect existing code to Wix.