> 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: Export Your Site to Code

## Article: Export Your Site to Code

## Article Link: https://dev.wix.com/docs/studio-two/code-your-site/export-your-site/export-your-site-to-code.md

## Article Content:

# Export Your Site to Code

<blockquote class="caution">

__Alpha:__
[Exporting your site to code](https://dev.wix.com/docs/studio-two/code-your-site/export-your-site/about-exporting-your-site-to-code.md) is currently in alpha. This feature is subject to change and may have bugs, issues, and limitations. We're actively improving it based on your feedback.

</blockquote>

Export a Studio Two site to a local folder as an [exported site](https://dev.wix.com/docs/studio-two/code-your-site/export-your-site/about-exporting-your-site-to-code.md), then preview it on your computer. You export with the Wix CLI, which adds site export as an extra set of commands.

## Before you begin

Make sure you have:

- Node.js 24.18 or later.
- The Wix CLI, [installed](https://dev.wix.com/docs/wix-cli/command-reference/introduction.md#global-commands) and [logged in](https://dev.wix.com/docs/wix-cli/command-reference/global-commands/login.md) to your Wix account.
- The site export commands, [added](https://dev.wix.com/docs/wix-cli/command-reference/global-commands/flows.md) to the Wix CLI with the `origami` flow.
- A Studio Two site that you can edit, unless you're [creating a new one](#create-and-export-a-new-site).

## Export your site

The export writes every page, the shared sections, the menus, the theme, and the site's code project, if it has one, to a new folder. The folder is a new git repository.

If the site doesn't have an OAuth app for web, the export creates one named "export site". The exported site uses it to call Wix APIs.

To export your site:

1. Run the following command and follow the prompts:

   ```bash
   wix origami export-site
   ```

   The CLI prompts you to pick the site from a list of your sites, then prompts you for a folder and suggests one named after the site's ID. Press Enter to use the suggested folder, or enter a different path.

   <blockquote class="tip">

   **Tip:** To run the export non-interactively, for example in a script, pass the site and the folder with `wix origami export-site --site <site-id> -d <folder>`. For all the flags, see [`wix origami export-site`](https://dev.wix.com/docs/wix-cli/command-reference/origami-commands/origami-export-site.md).

   </blockquote>

2. Install the exported site's packages:

   ```bash
   cd <folder>
   yarn install
   ```

3. Preview the site:

   ```bash
   yarn dev
   ```

   Open `http://localhost:3000` in your browser. The preview reloads as you change files.

<blockquote class="tip">

**Tip:** To update an exported site with changes made in Studio Two, run `wix origami export-site` in its root. The CLI asks first, and commits your local changes to git before it replaces them.

</blockquote>

## Create and export a new site

To start from scratch, create a blank Studio Two site and export it in one step. The site is created unpublished.

To create and export a new site:

1. Run the following command and follow the prompts:

   ```bash
   wix origami create-site
   ```

   The CLI prompts you for a name for the new site, then for a folder for the exported site.

2. Install the exported site's packages:

   ```bash
   cd <folder>
   yarn install
   ```

3. Preview the site:

   ```bash
   yarn dev
   ```

   Open `http://localhost:3000` in your browser. The preview reloads as you change files.

## See also

- [About Exporting Your Site to Code](https://dev.wix.com/docs/studio-two/code-your-site/export-your-site/about-exporting-your-site-to-code.md)
- [Edit an Exported Site](https://dev.wix.com/docs/studio-two/code-your-site/export-your-site/edit-an-exported-site.md)
- [Import Changes to Your Site](https://dev.wix.com/docs/studio-two/code-your-site/export-your-site/import-changes-to-your-site.md)
- [Host an Exported Site Outside Wix](https://dev.wix.com/docs/studio-two/code-your-site/export-your-site/host-an-exported-site-outside-wix.md)
- [`wix origami export-site`](https://dev.wix.com/docs/wix-cli/command-reference/origami-commands/origami-export-site.md)
- [`wix origami create-site`](https://dev.wix.com/docs/wix-cli/command-reference/origami-commands/origami-create-site.md)