> 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: Test Your Code in the Local Editor ## Article: Test Your Code in the Local Editor ## Article Link: https://dev.wix.com/docs/develop-websites/articles/workspace-tools/developer-tools/git-integration-wix-cli-for-sites/test-your-code-in-the-local-editor.md ## Article Content: # Test Your Code in the Local Editor > **Note** > This article refers to 2 different versions of the editor: > > * **Regular Editor**: The editor that's generally used to build Wix sites. > * **Local Editor**: A specialized version of the Regular Editor that's used when developing your site in your local IDE. The [Local Editor](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/developer-tools/git-integration-wix-cli-for-sites/about-the-local-editor.md) is a tool for testing code added to your site in your local IDE using [Git Integration & Wix CLI for Sites](https://support.wix.com/en/article/velo-about-velo-pro). You can use the Local Editor to test your code in real time and make changes to your site's design that you can sync with your IDE. This article explains how to test your code in the Local Editor and sync any design changes you make. ## Step 1 | Open the Local Editor Open the Local Editor from your computer using the [Wix CLI for Sites](https://support.wix.com/en/article/velo-working-with-the-wix-cli-beta). 1. Open your computer's terminal and navigate to the clone of your site's GitHub repository. 2. Run this command: `wix dev`. A new tab with the Local Editor opens in your default browser. Notice the **Local Editor** in the top bar on the left. ![Local Editor](https://wixmp-833713b177cebf373f611808.wixmp.com/images/cd9d208a8e66c978cc169e7562f5a520.png) > **Note:** If you're running the CLI on a cloud provider's IDE, such GitHub Code Spaces, add the `--tunnel` flag to the `wix dev` command. This makes the full command `wix dev --tunnel`. ### Reopen a closed Local Editor The Local Editor needs both the terminal and a browser tab open to run. If you close the browser tab, your terminal displays a URL you can use to reopen the editor in your browser. You can also do this by pressing `e` in the terminal.
If you close your terminal, the browser displays this screen:
In this case, you need to [open the Local Editor](https://support.wix.com/en/article/velo-working-with-the-local-editor-beta#open-the-local-editor) again. ## Step 2 | Test your code Once the Local Editor is open, you can use it to test your code in real time. 1. Edit your site's code in your IDE and save it. ```js $w.onReady(function () { console.log("Hello World!"); }); ``` Your code is automatically synced with Local Editor. You can see it in the editor's code panel. ![](https://user-images.githubusercontent.com/89579857/184881543-76c28381-97c3-40f7-bd58-517b15212b11.png) 2. In the Local Editor, click **Preview**. Your site code runs. >**Note:** > Even though you can see your code changes in the Local Editor, they don't appear in the Regular Editor until you [push them to GitHub](https://support.wix.com/en/article/velo-publishing-a-site-with-velo-pro#push-your-code-to-github). Changes don't appear on your live site until you [publish](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#publish-your-site). ### Sync design changes to your IDE If your testing reveals the need for design changes, you can make the changes directly in the Local Editor. The Local Editor and Regular Editor are synced, so any changes made in one are immediately reflected in the other. However, they aren't reflected in the code in your IDE. To sync the changes with your IDE, do the following: 1. Click **Save**. ![](https://user-images.githubusercontent.com/89579857/188309927-346c82b0-7696-45f5-be51-bb45419f9bd7.png) Clicking this button creates a new [UI version](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/developer-tools/git-integration-wix-cli-for-sites/about-the-local-editor.md). 2. If you see this modal, click **Continue**. ![](https://user-images.githubusercontent.com/89579857/188310497-a2e0d744-5539-4dd2-8cd8-ada8954b788a.png) ## Next steps When you're happy with the way your code runs, [push it to GitHub and publish your site](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).