Wix CLI Commands

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

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

Command overview

CommandDescription
wix devOpens a local development environment for a Wix site.
wix installInstalls a package to a site.
wix updateUpdates a package installed on a site.
wix uninstallUninstalls a package from a site.
wix publishPublishes a site to production.
wix previewCreates a shareable version of a site before going live.
wix loginLogs in to a Wix account.
wix whoamiDisplays the username of the logged-in Wix user.
wix logoutLogs out of a 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 the 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 a site's repository.

wix uninstall

Copy

Uninstalls a code package from a site's repository.

wix publish

Copy

Publishes a 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 local code leaves the live site and the site's GitHub repo out of sync. If you publish from the repo later without pushing the local code, the local code is overwritten and may be lost.

For more information, see Publish a Site with 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 the 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 the site. This means you can't use the preview to test changes to HTTP functions. To test HTTP functions, commit and push them to the 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 out of a Wix account.

See also

Did this help?