> 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 headless link ## Article: create headless link ## Article Link: https://dev.wix.com/docs/wix-cli/command-reference/project-creation/create-headless-link.md ## Article Content: # npm create @wix/new headless link Links an existing Astro project to Wix. Use this command when you have an existing Astro project that wasn't created through [`create headless`](https://dev.wix.com/docs/wix-cli/command-reference/project-creation/create-headless.md), and you want to connect it to Wix. This command creates a [Wix-managed headless project](https://dev.wix.com/docs/go-headless/develop-your-project/about-headless-development-paths.md). Run this command at the root folder of your Astro project. The command provisions a Wix [business](https://dev.wix.com/docs/go-headless/develop-your-project/about-headless-development-paths.md) and site for the project.
**Important:** Your project must use Astro 5. Astro 6 isn't supported.
Learn more about [linking an existing Astro project to Wix](https://dev.wix.com/docs/go-headless/get-started/overview/link-an-existing-astro-project-to-wix.md). Running the command without flags starts interactive mode, prompting you for a business name and project name. To run non-interactively, pass the `--business-name` and `--project-name` flags. > **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 The link command verifies that your project: - Contains an Astro configuration file such as `astro.config.js`, `astro.config.cjs`, `astro.config.mjs`, or `astro.config.ts`. Without one, the command fails with an `Only Astro projects can be linked to Wix.` error. - Isn't already a Wix-managed headless project and doesn't contain a `wix.config.json` file. If it does, the command fails with a `This project is already connected to Wix, so no changes were made.` error. In addition, the project you want to link must be an Astro 5 project. Astro 6 isn't supported. ## Usage ```bash npm create @wix/new@latest -- headless link [flags] ``` The `--` separator tells `npm` to forward everything after it to the `@wix/create-new` package, instead of treating the flags as options for `npm create` itself. ## Flags The following flags are available for the `link` command: | Flag | Description | | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--business-name ` | The name of your business as it appears in the Wix dashboard.

Required if running non-interactively; otherwise the CLI prompts you for it. | | `--project-name ` | The name of your project, used as the project identifier. Must be 3 to 20 characters long and contain only lowercase letters and numbers. Don't use hyphens, underscores, uppercase letters, or other characters.

Required if running non-interactively; otherwise the CLI prompts you for it. | | `-h`, `--help` | Display help for the command. | ## Examples Link the Astro project in the current folder to a new Wix business non-interactively: ```bash npm create @wix/new@latest -- headless link \ --project-name myproject \ --business-name "My Business" ``` ## After the command runs The `npm create @wix/new -- headless link` command modifies your existing Astro project in place. It doesn't create a new project folder. Rather, the command: - Provisions a new Wix business and site for the project. The site appears on the [Sites page](https://manage.wix.com/account/sites) of your Wix account. - Adds a `wix.config.json` file to the project root, populated with a `siteId` for the new site and an `appId` for the project's [private app](https://dev.wix.com/docs/build-apps/get-started/overview/exposing-apps-publicly-and-privately.md). - Updates your existing Astro configuration by: - Adding the `@wix/astro` and `@astrojs/react` integrations. - Setting `output: 'server'`. - Adding `static.wixstatic.com` to the allowed image domains. - Adding the `@wix/cloud-provider-fetch-adapter` for production builds. - Replaces your `package.json` scripts with CLI equivalents that route `dev`, `build`, `preview`, and `release` through the `wix` command. Also adds Wix and React dependencies. - Installs dependencies automatically. To start a local development environment, run [`wix dev`](https://dev.wix.com/docs/wix-cli/command-reference/project-commands/dev.md). Learn more about the [architecture and project structure](https://dev.wix.com/docs/go-headless/develop-your-project/wix-managed-headless/core-concepts/architecture-and-project-structure.md) of a Wix-managed headless project. ## See also - [About Wix-Managed Headless](https://dev.wix.com/docs/go-headless/develop-your-project/about-headless-development-paths.md) - [create headless](https://dev.wix.com/docs/wix-cli/command-reference/project-creation/create-headless.md)