> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: Wix CLI for Sites Commands ## Article: Working with the Wix CLI ## Article Link: https://dev.wix.com/docs/develop-websites/articles/workspace-tools/developer-tools/git-integration-wix-cli-for-sites/wix-cli-for-sites-commands.md ## Article Content: # Wix CLI for Sites 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 for Sites, see [Set Up the Wix CLI for Sites](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/developer-tools/git-integration-wix-cli/setting-up-git-integration-wix-cli.md#step-3--set-up-the-wix-cli). ## Command Overview | Command | Description | |--------------------|--------------------------------------------------------------| | [wix dev](#wix-dev) | Opens a local development environment for your Wix site. | | [wix install](#wix-install)| Installs a package to your site. | | [wix update](#wix-update) | Updates a package installed on your site. | | [wix uninstall](#wix-uninstall) | Uninstalls a package from your site. | | [wix publish](#wix-publish)| Publishes your site to production. | | [wix preview](#wix-preview)| Creates a shareable version of your site before going live. | | [wix login](#wix-login) | Logs in to your Wix account. | | [wix whoami](#wix-whoami) | Displays the username of the logged-in Wix user. | | [wix logout](#wix-logout) | Logs out of your Wix account. | ## wix -h ``` bash wix -h ``` 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 ```bash wix dev ``` Opens a site's Local Editor. ### wix dev flags | Flag | Description | |-----------------|--------------------------------------------------------------| | `--tunnel` | Use this flag to allow the editor to connect to the CLI when running it on a cloud IDE. | ## wix install ```bash wix install [options] ``` 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: ```bash wix install --yarn marked ``` Once the package is installed, a message is displayed in the terminal. ```bash marked@4.0.16 successfully installed. ``` ### wix install flags | Flag | Description | |-----------------|--------------------------------------------------------------| | `--npm` | Forces the installer to use npm as the package manager. | | `--yarn` | Forces the installer to use yarn as the package manager. | ## wix update ```bash wix update [options] ``` Updates a code package installed on your site's repository. ## wix uninstall ```bash wix uninstall [options] ``` Uninstalls a code package from your site's repository. ## wix publish ```bash wix publish ``` 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. ```bash ? What would you like to publish? › - Use arrow-keys. Return to submit. ❯ Latest commit from origin/main Local 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 [Publish a Site with the Git Integration & Wix CLI for Sites](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/developer-tools/git-integration-wix-cli/publishing-a-site-with-git-integration-wix-cli.md). ## wix preview ```bash wix preview ``` 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. ```bash ? What would you like to preview? › - Use arrow-keys. Return to submit. ❯ Latest commit from origin/main Local code ``` Once the preview site is ready, a URL to the site is displayed in the terminal. ```bash Creating preview deployment... Your preview deployment is now available at http://wix.to/JOaBagO ``` > **Note:** > * This preview isn't a [test site](https://support.wix.com/en/article/about-test-sites) and doesn't appear in the Release Manager. > * The preview uses the live versions of any [HTTP functions](https://www.wix.com/velo/reference/wix-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](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/testing-monitoring/functional-testing/test-backend-functions-with-functional-testing.md) in the editor. ## wix login ```bash wix login ``` Logs in to a Wix account. This allows the CLI to perform actions on that account's sites. ## wix whoami ```bash wix whoami ``` Displays the username of the currently logged-in Wix user. ## wix logout ```bash wix logout ``` Logs you out of your Wix account. ## See also * [About Automated Workflows and the Wix CLI for Sites](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/developer-tools/git-integration-wix-cli/about-automated-workflows-and-the-wix-cli.md) * [Testing your code with the Local Editor](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/developer-tools/git-integration-wix-cli/test-your-code-in-the-local-editor.md)