> 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 Commands ## Article: Wix CLI Commands ## Article Link: https://dev.wix.com/docs/develop-websites-sdk/code-your-site/developer-environments/ides/git-integration/wix-cli-commands.md ## Article Content: # 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](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/developer-environments/ides/git-integration/set-up-git-integration-with-wix-cli.md). ## Command overview | Command | Description | | ------------------------------- | -------------------------------------------------------- | | [wix dev](#wix-dev) | Opens a local development environment for a Wix site. | | [wix install](#wix-install) | Installs a package to a site. | | [wix update](#wix-update) | Updates a package installed on a site. | | [wix uninstall](#wix-uninstall) | Uninstalls a package from a site. | | [wix publish](#wix-publish) | Publishes a site to production. | | [wix preview](#wix-preview) | Creates a shareable version of a site before going live. | | [wix login](#wix-login) | Logs in to a Wix account. | | [wix whoami](#wix-whoami) | Displays the username of the logged-in Wix user. | | [wix logout](#wix-logout) | Logs out of a 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 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: ```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 a site's repository. ## wix uninstall ```bash wix uninstall [options] ``` Uninstalls a code package from a site's repository. ## wix publish ```bash wix publish ``` 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. ```bash ? What would you like to publish? › - Use arrow-keys. Return to submit. ❯ Latest commit from origin/main Local code ```
**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](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/developer-environments/ides/git-integration/publish-a-site-with-git-integration-and-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 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. ```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://dev.wix.com/docs/develop-websites-sdk/test-your-site/work-with-test-sites/about-test-sites.md) 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 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](https://dev.wix.com/docs/develop-websites-sdk/test-your-site/test-backend-functions/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 out of a Wix account. ## See also - [About Automated Workflows and the Wix CLI](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/developer-environments/ides/git-integration/about-automated-workflows-and-the-wix-cli.md) - [Testing your code with the Local Editor](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/developer-environments/ides/git-integration/test-code-in-the-local-editor.md)