> 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 a Project with the Wix CLI

## Article: Quick Start with the Wix CLI

## Article Link: https://dev.wix.com/docs/go-headless/wix-managed-headless/full-integration-astro/get-started/create-a-project-with-the-wix-cli.md

## Article Content:

# Create a Project with the Wix CLI

This guide explains the minimum steps required to get a [Wix-managed headless project](https://dev.wix.com/docs/go-headless/wix-managed-headless/about-wix-managed-headless.md) up and running using the [Wix CLI](https://dev.wix.com/docs/wix-cli/guides/about-the-wix-cli.md). Every CLI command used in this guide is documented in the [Command Reference](https://dev.wix.com/docs/wix-cli/command-reference/introduction.md).

As part of this setup, you'll get a frontend site and [private app](https://dev.wix.com/docs/wix-cli/guides/about-the-wix-cli.md#projects-private-app) integrated with a headless project. This setup also initializes useful headless settings for your project, such as [adding allowed redirect domains](https://dev.wix.com/docs/go-headless/authentication/setup/allow-redirect-uris-and-domains.md) and [setting a Wix Pages domain](https://dev.wix.com/docs/go-headless/business-solutions/wix-hosted-pages/set-a-wix-pages-domain.md).

> **Note:** To develop with AI assistance, install the [Wix Plugin](https://dev.wix.com/docs/api-reference/articles/ai-tools/about-the-wix-plugin.md) for your IDE. It adds [Wix Skills](https://dev.wix.com/docs/api-reference/articles/ai-tools/about-wix-skills.md) and the [Wix MCP](https://dev.wix.com/docs/sdk/articles/use-the-wix-mcp/about-the-wix-mcp.md), giving your AI client the context it needs to help you build CLI projects.

<div style="text-align:center">
<iframe width="560" height="315" src="https://youtube.com/embed/F54iht4cAoU" title="How to Create a Wix Headless Site Step by Step" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
</div>

## Before you begin

Before getting started, make sure that you:

- Have [Node.js](https://nodejs.org/en/) (v20.11.0 or higher).
- Have Git installed and [configured](https://git-scm.com/docs/git-config).
- Are logged into your Wix account. If you don't already have one, [sign up for a Wix account](https://manage.wix.com/account/custom-apps).

## Step 1 | Create a new headless project

1. Open a terminal and navigate to the folder where you want to create your project.

2. Run the following [command to create a new headless project](https://dev.wix.com/docs/wix-cli/command-reference/project-creation/create-headless.md):

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

   If prompted to install the `@wix/create-new` package, confirm it.

   You don't need to do any prior setup in the Wix dashboard. The CLI provisions a business and site for your project automatically. The CLI then prompts you for the details it needs to set up your project.

   > **Note:** You can run the command non-interactively, which is especially useful for automated scripts and AI agents. To do so, pass the `--folder-name`, `--business-name`, and `--site-template` flags. You can pass `--site-template` with a value to choose a specific template, or pass bare `--site-template` to use the blank starter. Omitting any of these flags causes the CLI to error out or fall back to interactive prompts. For the full list of flags, see [`npm create @wix/new headless`](https://dev.wix.com/docs/wix-cli/command-reference/project-creation/create-headless.md).

3. Enter the **name of your business**. This is the name of your headless project on Wix. The CLI creates a Wix Headless project for you with this name. This project is added to your Wix sites list.

4. Select an **initial template** for your project. For a list of available templates, see [Astro Templates](https://dev.wix.com/docs/go-headless/wix-managed-headless/full-integration-astro/get-started/astro-templates.md).

5. Enter a **folder name** for your project. The CLI generates the [local code files](https://dev.wix.com/docs/wix-cli/guides/project-structure/project-structure.md) for your project in a folder with that name.

6. Wait while the CLI generates your project. It installs dependencies, initializes a Git repository, and configures your files, then builds and publishes your site and displays your live site URL.

## Step 2 | Test the project

1. Navigate to your project folder.

2. Run the [`dev`](https://dev.wix.com/docs/wix-cli/command-reference/project-commands/dev.md) command to start the local development environment:

   ```bash
   wix dev
   ```

   The CLI builds a local environment for your project and provides links to view your site and dashboard. The development environment supports hot reloading, so any changes you make to your code are immediately reflected in the browser.

3. Click the **Site** link to confirm your project is running locally. You can also click the **Dashboard** link to open your project's Wix dashboard.

4. Close the local development environment when you're done.

## Step 3 (Optional) | Call a Wix API

> **Note:** In this step we're calling the [`listMembers()`](https://dev.wix.com/docs/api-reference/crm/members-contacts/members/member-management/members/list-members?apiView=SDK.md) method in the Wix Members API, but you can use any method in any [Wix JavaScript SDK](https://dev.wix.com/docs/api-reference?apiView=SDK.md) API.

1. Install the `@wix/members` package:

   ```bash
   npm install @wix/members
   ```

2. Add the following to the [component script](https://docs.astro.build/en/basics/astro-components/#the-component-script) of your `src/pages/index.astro` file:

   ```ts
   import { members } from "@wix/members";

   const memberList = await members.listMembers();
   console.log("Site members:", memberList);
   ```

   Your component script should look something like this:

   ```ts
   ---
   import Welcome from '../components/Welcome.astro';
   import Layout from '../layouts/Layout.astro';

   import { members } from "@wix/members";

   const memberList = await members.listMembers();
   console.log("Site members:", memberList);
   ---
   ```

3. Run the [`dev`](https://dev.wix.com/docs/wix-cli/command-reference/project-commands/dev.md) command to start the local development environment:

   ```bash
   wix dev
   ```

4. Click the **Site** link to open your site.
5. Return to the terminal. You should see the following log showing that your site currently has 0 members:

   ```bash
   Site members: {
       members: [],
       metadata: { count: 0, offset: 0, total: 0, tooManyToCount: false }
   }
   ```

   > **Note**: If you added members, you may not see their data in this list due to their status being set to `PRIVATE` by default. For more information, see [List Members](https://dev.wix.com/docs/api-reference/crm/members-contacts/members/member-management/members/list-members?apiView=SDK.md).

## Next steps

After completing the above steps, you have a simple headless project that you can experiment with and test locally.

You can now:

- [Install the Wix plugin](https://dev.wix.com/docs/api-reference/articles/ai-tools/about-the-wix-plugin.md)
- [Add extensions to your project](https://dev.wix.com/docs/go-headless/wix-managed-headless/full-integration-astro/extensions/about-extensions.md)
- [Add multilingual support](https://dev.wix.com/docs/go-headless/wix-managed-headless/full-integration-astro/feature-guides/add-multilingual-support.md)
- [Track analytics events](https://dev.wix.com/docs/go-headless/wix-managed-headless/full-integration-astro/feature-guides/track-analytics-events.md)

For more ways to build on your project, see [Develop Your Project](https://dev.wix.com/docs/go-headless/wix-managed-headless/develop-your-project.md).