# CLI commands (https://docs.salla.dev/twilight/react/local-development/cli-commands)



Look here when you need a flag. Every command starts with `salla theme`; `salla theme --help` prints the live list.

| Command   | Alias         | Needs login                                        | Purpose                                |
| --------- | ------------- | -------------------------------------------------- | -------------------------------------- |
| `create`  | `c`, `import` | Only for your own store or the GitHub step         | Create a theme and start it.           |
| `dev`     |               | Only for your own store (`--store`) and `--editor` | Run the theme locally.                 |
| `doctor`  |               | No                                                 | Check Node, pnpm and git.              |
| `preview` | `p`, `watch`  | Yes                                                | Run locally and open the theme editor. |
| `publish` | `pub`         | Yes                                                | Push and submit for review.            |
| `list`    | `l`           | Yes                                                | List your themes.                      |
| `delete`  | `d`           | Yes                                                | Delete one of your themes.             |

## create [#create]

```bash
salla theme create [-t react] [-n <name>] [-s <store>] [-y]
```

See [Create a theme](https://docs.salla.dev/twilight/react/local-development/create-a-theme).

## dev [#dev]

```bash
salla theme dev [-p <port>] [-s [store]] [--no-open] [-e]
```

| Option                | Default             | Meaning                                               |
| --------------------- | ------------------- | ----------------------------------------------------- |
| `-p, --port`          | `5173`              | First port to try. The next free one is used if busy. |
| `-s, --store [store]` | the store in `.env` | Bind a store. No value: ask.                          |
| `--no-open`           | opens               | Do not open the browser.                              |
| `-e, --editor`        | off                 | Same as `preview`.                                    |

See [Run it locally](https://docs.salla.dev/twilight/react/local-development/run-locally).

## doctor [#doctor]

```bash
salla theme doctor
```

See [Prerequisites](https://docs.salla.dev/twilight/react/local-development/prerequisites).

## preview [#preview]

```bash
salla theme preview [-s <store>] [-E] [-o] [-b <browser>]
```

See [Theme editor](https://docs.salla.dev/twilight/react/local-development/theme-editor).

## publish [#publish]

```bash
salla theme publish
```

See [Publish](https://docs.salla.dev/twilight/react/local-development/publish).

## list and delete [#list-and-delete]

`salla theme list` prints your themes (id, name, status). `salla theme delete` asks which one to delete. Deleting cannot be undone.

## Twig-only commands [#twig-only-commands]

`salla theme serve` and `salla theme sync` belong to the legacy Twig workflow. In a React theme they stop and point you to `salla theme dev`, because a React theme serves and reloads itself.

## Files the CLI writes [#files-the-cli-writes]

| File                                                        | By                   | Content                                                         |
| ----------------------------------------------------------- | -------------------- | --------------------------------------------------------------- |
| `.env`                                                      | create, dev, preview | `VITE_STORE_DOMAIN`. Git-ignored.                               |
| `package.json`, `twilight.json`, server config, `README.md` | create               | The theme's new name.                                           |
| `.git/`                                                     | create               | Initial commit, plus an `origin` remote if the GitHub step ran. |

## Environment variables [#environment-variables]

| Variable               | Meaning                                                                   |
| ---------------------- | ------------------------------------------------------------------------- |
| `SALLA_THEME_TEMPLATE` | A local `.tgz` or folder to create from instead of the published starter. |

Next: [The Vite plugin](https://docs.salla.dev/twilight/react/local-development/vite-plugin)
