Wix CLI Commands for Apps

This article documents the CLI commands for building Wix Apps.

For a detailed explanation of the process and how to initially create an app, see our Quick Start article.

Command overview

CategoryCommandDescription
CLI for AppsdevStarts a local development environment that serves your app.
generateGenerates an extension for your app.
buildBuilds your app.
serveServes your built app.
previewCreates an online preview of your built app.
create-versionStarts a process that guides you through creating a new app version in the app dashboard.
logsShows backend logs from your app.
Global CLIloginLogs in to your Wix account.
logoutLogs out of your Wix account.
telemetryOpts in or out of sending anonymous usage information (telemetry) to Wix.
whoamiDisplays the email address of the logged-in Wix user.

dev

Copy

Starts a local development environment that serves your app. Follow the prompts to open the different parts of your app on your development site in your browser.

The development environment is set up for hot reloading, so any changes you make to your code are immediately reflected in the browser.

dev flags

FlagAliasDescription
--https-sStarts your local development server on HTTPS. Use this flag if your browser does not allow iframes that contain HTTP pages within HTTPS pages.

generate

Copy

Starts a process that guides you through adding an extension to your app.

After selecting an extension you will be prompted for relevant configuration details, then your extension will be generated in your app's local files.

build

Copy

Builds your app.

You must build your app before:

  • Creating a version
  • Previewing your app
  • Serving your app

serve

Copy

Serves your app.

Serving creates a local preview of your built app. This preview is accessible only locally and can’t be shared with others.

preview

Copy

Creates an online preview of your built app and provides an inline link to an app preview URL in the console.

An app preview URL is a URL you can share with team members who are collaborators on your development site. It directs to a dashboard page where they can preview and test your app.

By default, the code for your app preview is hosted on Wix's servers.

preview flags

FlagAliasDescription
--site <site-id>-s <site-id>Allows you to set the site used for application preview URLs. If this flag is not provided, the site-id defaults to the currently-selected development site.

You can get the ID of a site from the site URL in your browser. For example, the site ID appears after the /dashboard/ part of this URL:

--base-url <url>Sets the base URL for uploading your static files to an external CDN. If this flag is not provided, the code for your preview will be hosted on Wix's servers.

create-version

Copy

Starts a process that guides you through creating a new app version. You can view your app versions in the app dashboard.

Once the app version is created, you can submit it for review and publish it to the Wix App Market.

To learn more about app versions, see App Versions and Deployment.

create-version flags

FlagAliasDescription
--version-type <type>-t <type>Specifies the type of version to create.

Accepted values for <type>: major, minor
--approve-preview-yAutomatically approves continuing with the publishing process after the preview is provided. Without this flag, you will be asked for approval.
--base-url <url>Sets the base URL for uploading your static files to an external CDN. If this flag is not provided, the code for your app will be hosted on Wix's servers.

logs

Copy

Shows backend logs of a selected version of your app.

logs flags

FlagAliasDescription
--version <version>Required. The version of the app to show logs for. For example, --version 1.0.0

login

Copy

Logs in to your Wix account.

logout

Copy

Logs out of your Wix account.

Note: To switch to another Wix account:

  1. Run wix logout.
  2. Run wix login, then click the link provided.
  3. Click Log in with another account.

telemetry

Copy

Opts in or out of sending anonymous usage information (telemetry) to Wix.

Accepted values for <state>: on, off

whoami

Copy

Displays the email address of the logged-in Wix user.

Did this help?