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 | Description |
|---|---|
| wix dev | Opens a local development environment for a Wix site. |
| wix install | Installs a package to a site. |
| wix update | Updates a package installed on a site. |
| wix uninstall | Uninstalls a package from a site. |
| wix publish | Publishes a site to production. |
| wix preview | Creates a shareable version of a site before going live. |
| wix login | Logs in to a Wix account. |
| wix whoami | Displays the username of the logged-in Wix user. |
| wix logout | Logs out of a 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 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:
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 a site's repository.
Uninstalls a code package from a site's repository.
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.
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.
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.
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 out of a Wix account.