> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt
> - To build a Wix site agentically, follow https://www.wix.com/headless/skill.md

## Resource: About the Wix CLI for Headless

## Article: About the Wix CLI for Headless

## Article Link: https://dev.wix.com/docs/wix-cli/cli-for-headless/about-the-wix-cli-for-headless.md

## Article Content:

# About the Wix CLI for Headless

With the Wix CLI, you can create, develop, and release [Wix-managed headless projects](https://dev.wix.com/docs/go-headless/wix-managed-headless/about-wix-managed-headless.md). This section documents what's specific to headless projects: their project structure and the commands that work in them.

> **Note:** Commands that you use with headless projects but aren't specific to them, such as logging in, are [global commands](https://dev.wix.com/docs/wix-cli/cli/about-the-cli.md).

To let AI tools perform CLI tasks for you, add [Wix skills](https://dev.wix.com/docs/api-reference/articles/ai-tools/about-wix-skills.md) to your project.

To create your first project, see [Create a Headless Project with the Wix CLI for Headless](https://dev.wix.com/docs/go-headless/wix-managed-headless/full-integration-astro/get-started/create-a-project-with-the-wix-cli.md).

## Astro and other frameworks

When you create a headless project, the CLI generates the code for an Astro site, using the [Wix Astro integration](https://dev.wix.com/docs/go-headless/wix-managed-headless/full-integration-astro/about-the-astro-integration.md). Astro is a web framework for content-focused sites, and it lets you add components from frameworks such as React, Vue, or Svelte where you need them. If you already have an Astro project, you can [link it to Wix](https://dev.wix.com/docs/wix-cli/cli-for-headless/command-reference/project-creation-commands/create-headless-link.md) instead.

In Astro projects, you can add [extensions](https://dev.wix.com/docs/go-headless/wix-managed-headless/full-integration-astro/extensions/about-extensions.md) and backend [HTTP endpoints](https://dev.wix.com/docs/go-headless/wix-managed-headless/full-integration-astro/extensions/backend/http-endpoints/about-http-endpoints.md). You can also call Wix APIs directly from your code. The CLI handles token management and authentication, so you don't need to set up a [Wix client](https://dev.wix.com/docs/sdk/articles/set-up-a-client/about-the-wix-client.md).

You can also use the CLI to deploy a frontend built with [another web framework](https://dev.wix.com/docs/go-headless/wix-managed-headless/other-frameworks/your-own-frontend/deploy-your-own-frontend-with-the-cli.md). In that case, you set up authentication yourself. A project you connect with [`npm create @wix/new init`](https://dev.wix.com/docs/wix-cli/cli-for-headless/command-reference/project-creation-commands/create-init.md) supports only the `preview`, `release`, and `env` project commands.

## Project structure

A headless project you create with the CLI follows a standard [project structure](https://dev.wix.com/docs/wix-cli/cli-for-headless/project-structure/about-the-headless-project-structure.md), based on Astro. You can organize your extensions in your own folders in the `src/` folder.

## Commands

The [Wix CLI for Headless Command Reference](https://dev.wix.com/docs/wix-cli/cli-for-headless/command-reference/introduction.md) documents the commands for headless projects:

- Project creation commands run through `npm create @wix/new`, to create a Wix-managed headless project from a template or from code you already have.
- Project commands run in the folder of a project that uses the [headless project structure](https://dev.wix.com/docs/wix-cli/cli-for-headless/project-structure/about-the-headless-project-structure.md).
- Standalone commands, such as `wix account`, don't need you to be in a project folder.

## Develop, test, and release

- **Develop and test:** Run [`wix dev`](https://dev.wix.com/docs/wix-cli/cli-for-headless/command-reference/project-commands/dev.md) to start a local development environment. It prints links to your project's site and dashboard, and reloads as you change your code.
- **Environment variables:** Manage configuration values and secrets with [`wix env`](https://dev.wix.com/docs/wix-cli/cli-for-headless/command-reference/project-commands/env.md). See [About Environment Variables in the CLI](https://dev.wix.com/docs/go-headless/wix-managed-headless/full-integration-astro/development/environment-variables/about-environment-variables-in-the-cli.md).
- **Build, preview, and release:** Use [`wix build`](https://dev.wix.com/docs/wix-cli/cli-for-headless/command-reference/project-commands/build.md), [`wix preview`](https://dev.wix.com/docs/wix-cli/cli-for-headless/command-reference/project-commands/preview.md), and [`wix release`](https://dev.wix.com/docs/wix-cli/cli-for-headless/command-reference/project-commands/release.md). Releasing also publishes the project's site. See [Build and Deploy with the CLI](https://dev.wix.com/docs/go-headless/wix-managed-headless/full-integration-astro/development/build-and-deploy-with-the-cli.md).
- **CI/CD:** Run the CLI in a pipeline, such as a GitHub Actions workflow, to test and release your project automatically. See [Integrate the CLI into CI/CD Workflows](https://dev.wix.com/docs/go-headless/wix-managed-headless/full-integration-astro/development/integrate-the-cli-into-ci-cd-workflows.md).

## The project's private app

When you create a headless project, the CLI sets up a private app for it. The app lets you add features to your project through extensions, and it acts as the [OAuth app](https://dev.wix.com/docs/go-headless/authentication/about-authentication.md) that handles authentication for your project's frontend. You can use the app only in your headless project.

## Custom domains

You can connect a [custom domain](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fadd-domain) to your project's site. To find a domain and get a link to buy it from the terminal, use [`wix account`](https://dev.wix.com/docs/wix-cli/cli-for-headless/command-reference/standalone-commands/account.md).

## Hosting and infrastructure

Wix hosts your project on serverless infrastructure, and handles scaling, resource allocation, and maintenance for you:

- **Static site hosting:** A global CDN delivers your site's content fast and reliably.
- **Serverless architecture:** Your full-stack project runs without servers to manage. Wix scales it and manages its resources automatically.
- **Automatic SSL certificates:** Wix provisions and renews SSL certificates, so connections to your site are secure.
- **Session management middleware:** A middleware manages session tokens and cookies for the current site visitor, so you can use stateful session APIs, such as eCommerce carts and site visitor authentication.