Wix CLI Commands

This article documents the CLI commands for working with your Wix site.

For a detailed explanation of the process and how to initially set up the Wix CLI, see Set Up the Wix CLI.

Command Overview

CommandDescription
wix devOpens a local development environment for your Wix site.
wix installInstalls a package to your site.
wix updateUpdates a package installed on your site.
wix uninstallUninstalls a package from your site.
wix publishPublishes your site to production.
wix previewCreates a shareable version of your site before going live.
wix loginLogs in to your Wix account.
wix whoamiDisplays the username of the logged-in Wix user.
wix logoutLogs out of your Wix account.

wix -h

Copy

Displays a list of supported CLI commands in the terminal.

You can also run wix [command] -h to get detailed help for a command.

wix dev

Copy

Opens a site's Local Editor.

wix dev flags

FlagDescription
--tunnelUse this flag to allow the editor to connect to the CLI when running it on a cloud IDE.

wix install

Copy

Installs a code package to a site's repo. If your site's repo has a yarn.lock file, the installer uses yarn to install packages by default. Otherwise, the installer uses npm by default. To specify which package manager to use, include an --npm or --yarn options flag.

Example install command:

Copy

Once the package is installed, a message is displayed in the terminal.

Copy

wix install flags

FlagDescription
--npmForces the installer to use npm as the package manager.
--yarnForces the installer to use yarn as the package manager.

wix update

Copy

Updates a code package installed on your site's repository.

wix uninstall

Copy

Uninstalls a code package from your site's repository.

wix publish

Copy

Publishes your site. You can choose to use either the code in the default branch of a site's repo or the local code in your IDE as the publishing source.

Copy

Important: Publishing your local code leaves your live site and your site's GitHub repo out of sync. If you publish from the repo later without pushing your local code, your local code is overwritten and may be lost.

For more information, see Publish a Site with the Git Integration & Wix CLI.

wix preview

Copy

Builds a preview version of a site. You can only use this command if you have previously published your site.

You can build the preview from the code in the default branch of a site's repo or from the local code in your IDE.

Copy

Once the preview site is ready, a URL to the site is displayed in the terminal.

Copy

Note:

  • This preview isn't a test site and doesn't appear in the Release Manager.
  • The preview uses the live versions of any HTTP functions exposed on your site. This means you can't use the preview to test changes to HTTP functions. To test HTTP functions, commit and push them to your site's repo and use functional testing in the editor.

wix login

Copy

Logs in to a Wix account. This allows the CLI to perform actions on that account's sites.

wix whoami

Copy

Displays the username of the currently logged-in Wix user.

wix logout

Copy

Logs you out of your Wix account.

See also

Did this help?