Wix CLI Development Overview

The Wix CLI is in Developer Preview and is subject to change.

CLI Documentation Notice

You're viewing documentation for the new Wix CLI, which we recommend for all new projects.

This article gives an overview of the processes for developing a project using the Wix CLI. The Wix CLI supports both Wix apps and Wix Headless projects with a unified development experience. For more information on how to create a project, see Quick Start an App or Quick Start a Headless Project.

Understand your project

After setting up a Wix CLI project, your files follow a standardized project structure based on the Astro web framework. The CLI generates an Astro project with Wix integration which serves as the foundation of your project's development, regardless of whether you're building an app or a headless project.

To understand and modify your project's code, you should be familiar with the following:

Astro foundation

The CLI generates an Astro project with Wix integration that serves as the foundation for all CLI projects. Astro is a web framework designed for building fast, content-focused websites, and it supports backend development through features like Astro endpoints.

Headless project frontends are defined by Astro pages, components, layouts, and other standard Astro development files.

When deployed, CLI projects are hosted on Wix's servers by default.

Vite toolchain

The Wix CLI Framework uses Vite as the toolchain for building your project's code. Vite is a fast and opinionated web development build tool that focuses on providing a great developer experience.

With the CLI, you can use all of Vite's features, including:

Work with Wix APIs

As you build your project, you'll want to interact with Wix APIs to access Wix business solutions or get information about your users.

To call Wix APIs you can use:

The SDK is the preferred method of consuming Wix APIs because Wix handles authentication for you.

Add extensions

Extensions allow you to add functionality to your project. For example, you can add custom dashboard pages or implement backend logic to handle events.

You can add various extensions to your project using the generate command.

Note: You must run release before your extensions are visible in the app dashboard.

You can use any JavaScript framework you want for developing your project's extensions, but if you want to use the Wix Design System to give your extensions the look and feel of Wix, you must use React.

Develop and test projects

Build, preview, and release projects

After developing and testing your Wix CLI project locally, you can build it, create shareable previews, and take it to production. For more information, see Build and Deploy a Project with the Wix CLI.

CI/CD workflows

The Wix CLI can be integrated into any CI/CD pipeline, allowing you to automate tasks such as testing your CLI projects.

For example, you can create a GitHub Actions workflow that runs on every pull request and performs unit tests for your CLI project. For more information about unit testing, see Write Unit Tests for a Wix CLI Application.

Keep the CLI up to date

We're actively working on improving the CLI and adding features, which means we will be releasing new versions. It's important to keep your CLI up to date to benefit from the latest improvements and features. You can check the changelog for updates to the CLI.

You can check which version of the CLI you have using the following command:

Copy

You can upgrade to the latest version of the CLI using the following command:

Copy

Note: If the latest version of the CLI includes a new command, you'll need to add the new command to your package.json file.

See also

Did this help?