About the Wix CLI

The Wix CLI is the command-line tool for creating, developing, and deploying both Wix apps and Wix-managed headless projects.

Note: For Wix site development, see Git Integration & Wix CLI for Sites instead.

To get started:

The CLI generates a complete project structure and handles initial setup and configuration. It also provides commands to generate extensions and manage your project throughout development. New CLI projects include Wix skills, so AI tools can perform CLI tasks for you. This lets you focus on building the unique features of your project.

Note: Headless projects created with the CLI are Wix-managed headless projects. This is the recommended path for new headless projects. For background on the headless development paths, see About Headless Development Paths.

Legacy CLIs

The unified Wix CLI replaces 2 deprecated tools:

Both legacy CLIs no longer receive updates or feature additions. Use the legacy references only if you're maintaining an existing project.

Project structure and Astro

The CLI uses a standardized project structure based on the Astro web framework. Astro is a JavaScript-based web framework designed for building fast, content-focused websites. The CLI also supports backend development with HTTP endpoints.

Why Astro?

The Wix CLI is built on Astro because it offers several key advantages for modern web development:

  • Performance-focused architecture: Astro focuses on making websites that load quickly and perform well, which is especially important for content-heavy sites. It uses server-side rendering by default, making it easier to build high-performing websites without the added complexity of client-side rendering.
  • Flexibility and simplicity: Astro gives you flexibility in how you build. You can use plain HTML, CSS, and vanilla JavaScript for most of your project, and only add framework components (React, Vue, Svelte) where you need them. This means you import only what you need rather than loading a full framework for the entire site.
  • Partial hydration: Astro uses partial hydration, which means it strips out unused JavaScript and sends only what the client actually needs. This results in smaller bundle sizes and faster page loads.
  • Framework agnostic: Unlike frameworks that lock you into a specific technology, Astro lets you mix and match. You can use React components in one part of your site, Vue in another, or stick with plain HTML throughout. This flexibility makes it easier to adopt new technologies or work with existing codebases.
  • Simplified development model: Astro eliminates framework-specific complexities like hooks, stale closures, and observables. This makes development more approachable, especially for developers who prefer working with standard web technologies.
  • No new language to learn: Everything in Astro is still written in HTML, CSS, and JavaScript (or TypeScript if you prefer). There's no proprietary templating language or significant learning curve.

Development capabilities

The CLI allows you to:

  • Generate extensions to quickly add functionality to your project, such as custom dashboard pages and event handlers.
  • Call Wix JavaScript SDK methods directly, as the CLI handles token management and authentication for you, eliminating the need to set up a Wix Client.
  • Test projects locally with hot reloading.
  • Create shareable preview versions of your project for collaboration.

The CLI also provides full TypeScript support with IntelliSense, offering autocomplete suggestions and validation as you code.

Wix skills

New CLI projects include Wix skills by default. Wix skills enhance your AI workflow by providing instructions and context that supported AI tools use to develop, deploy, and validate a CLI project.

Wix app support

The CLI generates the complete project structure needed for Wix app development. You can add extensions built with TypeScript, React components, and the Wix Design System, providing a native Wix look and feel.

Development sites

When developing apps, you can test your functionality using development sites. These are premium Wix sites that you can use for app testing. You can maintain up to 5 development sites simultaneously for testing different aspects of your app.

Headless project support

The CLI streamlines Wix Headless project development, so you can work directly with Wix's business solutions and dashboard, and build a custom frontend using any technology supported by Astro.

When you create a headless project, the CLI generates the code for an Astro site so you can begin developing immediately. You can also open and develop projects you started with Wix Vibe, the AI-driven UI for Wix-managed Headless, locally with the CLI.

Project's private app

When you create a headless project, the CLI sets up a private app that allows you to add features to your project through extensions. The app also acts as the OAuth app that handles authentication for your project's frontend. This private app can't be shared with others, it's only for use in your headless project.

Custom domain support

You can use a custom domain for headless frontends to provide a branded experience for users.

Flexible file system

The CLI uses a standardized project structure based on Astro, while giving you the flexibility to organize your extensions into custom folders within the src/ directory. This allows you to structure your code in a way that works best for your project.

Environment variables

The CLI provides built-in support for environment variables, allowing you to store configuration values and secrets outside of your code. You can define type-safe environment variables with different security levels, which makes your applications more secure and portable.

Hosting and infrastructure

The CLI provides a serverless hosting solution where scaling, resource allocation, and maintenance are fully managed, so you don't have to worry about infrastructure.

The main features include:

  • Static sites hosting: The hosting environment is powered by a global CDN that ensures fast and reliable content delivery to users.
  • Serverless architecture: Run full-stack apps without managing servers. Scaling and resource management are handled automatically by Wix.
  • Automatic SSL certificates: SSL certificates are automatically provisioned and renewed, ensuring secure connections.
  • Session management middleware: A middleware manages session tokens and cookies for the current site visitor, allowing you to use stateful session APIs like e-commerce carts, site visitor authentication, and more.

Use these docs with AI tools

Wix developer documentation is available in machine-readable formats for use with AI coding assistants and LLMs:

  • llms.txt index: Browse a structured index of all documentation at dev.wix.com/docs/llms.txt.
  • Markdown format: Append .md to any documentation page URL to retrieve a Markdown version of that page.
  • Page menu: Use the "Ask Assistant" dropdown on any documentation page to copy the page as Markdown or get a direct link to the Markdown version.

Get started

Did this help?