npm create @wix/new headless

Creates a new Wix-managed Headless project. This is the recommended path for new headless projects, where Wix handles hosting, OAuth, environment variables, and infrastructure. Run this command in the parent directory where you want the project folder. The command provisions a business and site for the project, scaffolds the chosen site template into a new local folder, installs dependencies, and initializes a Git repository.

If you don't include flags, it runs in interactive mode, prompting you for a business name, project name, and site template. To run non-interactively, use the headless command together with the flags below.

For a step-by-step walkthrough, see Quick Start a Headless Project.

Note: This command is provided by the @wix/create-new package, which is invoked through npm create. It's a separate package from @wix/cli and doesn't require an existing project.

Usage

Copy

The -- separator tells npm to forward everything after it to the @wix/create-new package, instead of consuming the flags itself.

Flags

The following flags are available for the headless command:

FlagDescription
--project-name <project-name>Optional. The name of your project, used as the local folder name and 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. If omitted, the CLI prompts you for a project name in interactive mode. To run non-interactively, pass this flag together with --site-template-id.
--business-name <business-name>Optional. The name of your business as it will appear in the Wix dashboard. If omitted, the CLI prompts you in interactive mode.
--site-template-id <site-template-id>Optional. The ID of the site template to scaffold from. If omitted, the CLI prompts you to pick a template in interactive mode. Required whenever you pass --project-name to run non-interactively. For valid IDs, see Site template IDs.
--skip-installSkip automatic dependency installation. If you set this flag, run npm install manually before starting the project.
--skip-gitSkip initializing a Git repository during setup.
--no-publishDon't publish your site after creating the project. To publish later, run npm run release.
-v, --versionOutput the version number of @wix/create-new.
-h, --helpDisplay help for the command.

Site template IDs

The following Astro-based site templates are supported. Pass the ID via --site-template-id to scaffold against the corresponding template non-interactively. For descriptions of each template's features and links to the source repositories, see Wix CLI for Headless Templates.

TemplateIDDescription
Commerce (Wix Stores)e5da13f4-c01e-4b61-a9c7-55dacd961d54Product catalog, checkout, and more.
Scheduler (Wix Bookings)72ade0e3-1871-4c04-ac54-419ca874d9d3Appointment booking and calendar.
Registration (Wix Forms)e5d63bf1-cd06-48eb-ad77-0da9235adcf1Inputs, dropdowns, and field validations.
Blank212b41cb-0da6-4401-9c72-7c579e6477a2Basic Astro project with no business solution preconfigured.

Examples

Scaffold an ecommerce project built on Astro non-interactively, without auto-publishing:

Copy

Scaffold a blank Astro project and skip dependency installation, with auto-publishing:

Copy

After the command runs

The command creates a new folder named after --project-name. The folder follows the standard project structure for Wix CLI projects.

In addition to scaffolding the standard layout, this command:

  • Provisions a business and site for your project. The site appears on the Sites page of your Wix account, where you can manage business settings, billing, and more.
  • Populates wix.config.json with the appId and siteId provisioned for the new project.
  • Creates a Git repository with an initial commit, unless you pass --skip-git.

To start a local development environment, run wix dev.

Did this help?