Note: This feature is not yet available to all Wix Editor users.
The Wix CLI is a tool that allows you to work with your Wix site from your computer's terminal.
The CLI is an npm or yarn package that you install on your computer. Before setting up the CLI, make sure your site is and your site's repository is cloned on your computer.
Open your computer's terminal.
npm install -g @wix/clior
yarn global add @wix/cli.
Once you've installed the CLI globally, you can use it with any Wix site repos on your computer.
The CLI supports the following commands:
Displays a list of supported CLI commands in the terminal.
wix -hUsage:wix [options] [command]Commands:dev [options] Open the Local Editor that runs your local codeinstall [options] <package> Install a supported Velo packageupdate [options] <package> Update a Velo packageuninstall [options] <package> Uninstall a Velo packagepublish [options] Publish your site to productionpreview [options] Create a shareable version of your site before going livelogin [options] Log in to your Wix accountwhoami [options] Display the username of the logged in Wix userlogout [options] Log out of your Wix accountOptions:-v, --version Output the version number-h, --help Display help for command
You can also run
wix [command] -h to get detailed help for a command.
Opens a site's Local Editor.
For more information, see .
Installs a code package to a site's repo. For security reasons, you can only install on Wix sites.
wix install [options] <package-name>
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
--yarn options flag.
Example install command:
wix install --yarn marked
Once the package is installed, a message is displayed in the terminal.
email@example.com successfully installed.
Updates a code package that's installed on a site's repo.
wix update [options] <package-name>
Uninstalls a code package from a site's repo.
wix uninstall [options] <package-name>
Publishes a site.
You can choose to use either the code in the default branch of a site's repo or the local code on your computer as the publishing source.
? What would you like to publish? › - Use arrow-keys. Return to submit.❯ Latest commit from origin/mainLocal code
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 .
Builds a preview version of a site. You must first publish your site before running this command.
You can build the preview from the code in the default branch of a site's repo or from the local code on your computer.
? What would you like to preview? › - Use arrow-keys. Return to submit.❯ Latest commit from origin/mainLocal code
Once the preview site is ready, a URL to the site is displayed in the terminal.
Creating preview deployment...Your preview deployment is now available at http://wix.to/JOaBagO
- This preview isn't aand doesn't appear in the Release Manager.
- The preview uses the live versions of anyexposed 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 in the Wix Editor.
Logs in to a Wix account. This allows the CLI to perform actions on that account's sites.
When you run the command, the Wix login page opens in your default browser.
Displays the username of the currently logged in Wix user.
Logs out of a Wix account.