---
title: "The SXA CLI watch, build, re-build, and upload tasks"
slug: "the-sxa-cli-watch-build-re-build-and-upload-tasks"
abstract: "Use global tasks for SXA CLI."
---
# The SXA CLI watch, build, re-build, and upload tasks

SXA lets developers build assets and upload them either locally using SXA CLI or with CI servers. This topic describes the tasks to watch, build, rebuild, and upload files.

<details>
<summary><h2>Build tasks</h2></summary>

To build and upload theme assets, use the following task:

```text
sxa build [taskName]

```

alias:

```text
sxa b

```

Possible addition:

- `d, --debug` - to provide additional debugging information.

The following table describes the global build tasks:

| Global task | Description |
| --- | --- |
| `build All` | Compiles Sass into CSS from the root of the `sass` folder. |
| `build SassStyles` | Compiles the following files to `styles/styles.css`:<br><br><ul><li>`sass/styles/common`</li><li>`sass/styles/content-alignment`</li><li>`sass/styles/layout`</li></ul> |
| `build Css` | Bundles and minifies the files in the `styles` folder. |
| `build Eslint` | Runs `eslint` for all JavaScript in the `scripts` folder. |
| `build Js` | Bundles and minifies JavaScript files in the `scripts` folder. |
| `build Styles` | Compiles sass components into CSS and bundles and minifies CSS files. |
| `build SpriteFlag` | Creates sprite for flags. |

</details>

<details>
<summary><h2>Rebuild tasks</h2></summary>

To rebuild and upload theme assets, use the following task:

```text
sxa rebuild [taskName]

```

alias:

```text
sxa r

```

Possible additions:

- `-p, --password` - to enter a password for uploading.
- `-l, --login` - to log in for uploading.
- `-d, --debug` - to provide additional debugging information.
- `-u, --url` - instance URL for uploading

    > [!note]
    > If you provide a URL this way, this URL is used even if you have configured something else for a local or global server URL strategy.

The following table describes the global rebuild tasks:

| Task | Description |
| --- | --- |
| rebuild All | Compiles Sass components into CSS, minifies JavaScript and CSS, uploads JavaScript, CSS, and images. |
| rebuild Main | Compiles Sass components into CSS, minifies JavaScript and CSS, uploads JavaScript, and CSS. |

</details>

<details>
<summary><h2>Upload tasks</h2></summary>

To upload the theme assets based on the theme configuration, use the following task:

```text
sxa upload [taskName]

```

alias:

```text
sxa u

```

Possible additions:

- `-p, --password` - to enter a password for uploading.
- `-l, --login` - to log in for uploading.
- `-d, --debug` - to provide additional debugging information.
- `-u, --url` - instance URL for uploading.

    > [!note]
    > If you provide a URL this way, this URL is used even if you have configured something else for local a local or global server URL strategy.

The following table describes the global upload tasks:

| Task | Description |
| --- | --- |
| `upload All` | Uploads JavaScript, CSS, and images to the Sitecore instance. |
| `upload Css` | Uploads CSS files from the *styles* folder based on the theme configuration. |
| `upload Js` | Uploads JavaScript files from the *scripts* folder based on the theme configuration. |
| `upload Img` | Uploads files from the *images* folder to the Sitecore instance. For Sass and CSS. |
| `upload GulpConfig` | Uploads `config` folder and uploads `gulpfile.js`. |
| `upload Fonts` | Uploads files from the *fonts* folder to the Sitecore instance. |

</details>

<details>
<summary><h2>Watch tasks</h2></summary>

To watch theme asset changes and upload the modified files automatically, use the following task:

```text
sxa watch [taskName]

```

alias:

```text
sxa w

```

Possible additions:

- `-p, --password` - to enter a password for uploading.
- `-l, --login` - to log in for uploading.
- `-d, --debug` - to provide additional debugging information.
- `-u, --url` - instance URL for uploading

    > [!note]
    > If you provide a URL this way, this URL is used even if you have configured something else for local a local or global server URL strategy.

The following table describes the global watch tasks:

| Task | Description |
| --- | --- |
| `sxa watch All` | Aggregates the functionality of the following tasks: `watch Sass`, `watch JS`, `watch Es`, `watch Css`, `watch Img`, `watch SassSource`, `watch Scriban`, `watch Html`. |
| `watch Sass` | Runs a list of tasks: `watch SassComponents`, `watch SassBase`, `watch SassStyles`, `watch SassDependency`. |
| `sxa watch SassStyles` | Monitors changes and compiles all changes to `styles/styles.css` in the following folders:<br><br><ul><li>`sass/styles/common`</li><li>`sass/styles/content-alignment`</li><li>`sass/styles/layout`</li></ul> |
| `watch SassBase` | Monitors changes and compiles components and styles in the following folders:<br><br><ul><li>`sass/abstracts/`</li><li>`sass/base/`</li><li>`sass/components`</li></ul> |
| `watch SassComponents` | Monitors changes in component styles in the *sass* folder and compiles them to the *styles* folder. |
| `watch SassDependency` | Monitors changes in `sass/styles/` (except for `sass/styles/common`, `sass/styles/content-alignment` , `sass/styles/layout`) and compiles appropriate components. |
| `watch SassSource` | Monitors changes in the `sass` folder and uploads changed files to the server. |
| `watch Css` | Monitors changes of CSS files in the `styles` folder and uploads them to the server. |
| `watch Js` | Monitors changes of JavaScript files in the `scripts` folder and uploads them to the server. |
| `watch Es` | Monitors changes of JavaScript files in the `sources` folder and uploads them to the server. |
| `watch Html` | Monitors changes of HTML files and uploads them to the server to be parsed by Creative Exchange. |
| `watch Scriban` | Monitors changes of Scriban files and uploads them to the server. |
| `watch Img` | Monitors changes in the `images` folder and uploads the files to the server. |

</details>