> ## Documentation Index
> Fetch the complete documentation index at: https://help.experro.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Theme deployment

Now that you understand Experro's base theme and its functioning, once you've made the necessary changes to align with your requirements, you might consider deploying it to the specific Experro workspace you're working on.

Deploying is as simple as running a couple of commands in your terminal.

<Warning>
  #### Watch Out!

  Before deploying the theme, ensure that your `.env` file contains valid information about your Experro workspace and a valid [Experro CLI](./about-cli) token with theme upload or full access permission.
  <br /> Here's the representation of how your **.env** file should be formatted:

  ```sh theme={null}
  CLI_TOKEN=<your-CLI-token>
  STORE_URL=<store-hase>.experro.app
  TENANT_ID=<tenant-id>
  WORKSPACE_ID=<workspace-id>
  API_HOST=apis.experro.app
  CHANNEL_IDS=<channel_id's>
  ```

  The second requirement is to have [Expero CLI](./about-cli) installed on your system.

  <br />
</Warning>

After making changes and customizations, the theme developer simply needs to open the terminal and navigate to the theme's directory.

### Step 1: Get Environment List

First, retrieve the environment ID for the intended deployment by utilizing the following command:

```sh theme={null}
experro-cli environment list
```

This command will provide an output similar to this:

<img src="https://mintcdn.com/experro/lVg0RLEImR_hiWaX/images/environment-list.png?fit=max&auto=format&n=lVg0RLEImR_hiWaX&q=85&s=af86693dda78a9d87d6a42ead1514564" alt="environment-list.png" width="1491" height="204" data-path="images/environment-list.png" />

You will need to note down the `ID` of the environment you wish to deploy.

### Step 2: Version Create and Theme Upload

To create a version and deploy the theme, use the following command:

```sh theme={null}
experro-cli version create --name=<version_name> --environment-id=<environment_id>
```

If your CLI token has **full access** permission and you also want to publish the version, add the `--publish-version` option after the above `version create` command.

```sh theme={null}
experro-cli version create --name=<version_name> --environment-id=<environment_id> --publish-version
```

And that's all, just hit enter to run this command, and your theme deployment will begin.

***

### When you have only Theme Upload Permission

If you have a CLI token with only **upload** permission, then you just need to use the first command mentioned in the previous [Step 2](#step-2-version-create-and-theme-upload). However, after a successful build upload, you will see an object printed in the terminal with `Data` and `id` keys. Make sure to note down the `id` value, as it represents the version id needed for publishing the build with that version.

This `id` value will be essential for publishing the theme using the appropriate CLI token access through the command.

```sh theme={null}
experro-cli version publish
```

For further details about CLI options, you can refer to the [About CLI](./about-cli#version) document.
