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 | Description |
---|---|
wix dev | Opens a local development environment for your Wix site. |
wix install | Installs a package to your site. |
wix update | Updates a package installed on your site. |
wix uninstall | Uninstalls a package from your site. |
wix publish | Publishes your site to production. |
wix preview | Creates a shareable version of your site before going live. |
wix login | Logs in to your Wix account. |
wix whoami | Displays the username of the logged-in Wix user. |
wix logout | Logs out of your Wix account. |
Displays a list of supported CLI commands in the terminal.
You can also run wix [command] -h
to get detailed help for a command.
Opens a site's Local Editor.
Flag | Description |
---|---|
--tunnel | Use this flag to allow the editor to connect to the CLI when running it on a cloud IDE. |
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:
Once the package is installed, a message is displayed in the terminal.
Flag | Description |
---|---|
--npm | Forces the installer to use npm as the package manager. |
--yarn | Forces the installer to use yarn as the package manager. |
Updates a code package installed on your site's repository.
Uninstalls a code package from your site's repository.
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.
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.
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.
Once the preview site is ready, a URL to the site is displayed in the terminal.
Note:
Logs in to a Wix account. This allows the CLI to perform actions on that account's sites.
Displays the username of the currently logged-in Wix user.
Logs you out of your Wix account.