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

# Commands

> Reference for every webstorio CLI command and option.

```bash theme={"dark"}
npx webstorio <command> [options]
```

## Common options

| Option          | Description                                                 |
| --------------- | ----------------------------------------------------------- |
| `--cwd <dir>`   | Run as if started from `<dir>` (resolve the project there). |
| `-h, --help`    | Show help.                                                  |
| `-v, --version` | Show version.                                               |

## `webstorio init`

```bash theme={"dark"}
npx webstorio init <directory> [options]
```

Scaffold a new project into `<directory>`: `webstorio.config.ts`,
`package.json`, `tsconfig.json`, a `pages/home.tsx`, `components/_header.tsx` +
`components/_footer.tsx`, plus a `README.md` and `.gitignore`. The directory is
created if missing, and existing files are never overwritten.

The directory name seeds the default project name and subdomain.

| Argument      | Description                                   |
| ------------- | --------------------------------------------- |
| `<directory>` | Target directory to scaffold into (required). |

| Option                 | Description        |
| ---------------------- | ------------------ |
| `--name <string>`      | Project name.      |
| `--subdomain <string>` | Project subdomain. |

## `webstorio update`

```bash theme={"dark"}
npx webstorio update [options]
```

Scan every page and component, resolve each imported library to the version the
server compiles against (the
[compatibility manifest](/api-reference/supported-libraries)), write them
into `package.json` `devDependencies`, and install. Existing versions are
realigned to the compatible ones, and imports outside the Webstorio allowlist are
reported and skipped.

| Option           | Description                             |
| ---------------- | --------------------------------------- |
| `--skip-install` | Update `package.json` but skip install. |

The package manager is detected from `packageManager` in `package.json` or a
lockfile (`pnpm-lock.yaml`, `yarn.lock`, `bun.lockb`, `package-lock.json`),
defaulting to `npm`.

## `webstorio dev`

Start the local preview server with file watching and live reload. Fully offline
in `empty`/`dummy` modes.

| Option                           | Description                          |
| -------------------------------- | ------------------------------------ |
| `--mode <empty\|dummy\|preview>` | Override `dev.dataMode` from config. |
| `--port <number>`                | Override `dev.port` from config.     |

See [Local development](/developer/local-development) for details on data modes.

## `webstorio schema`

```bash theme={"dark"}
npx webstorio schema <push|pull|diff> [options]
```

Manage feature schemas under `schemasDir` (requires `schemasDir` in config).

| Subcommand | Description                                      |
| ---------- | ------------------------------------------------ |
| `push`     | Upsert local schema files to the remote project. |
| `pull`     | Download remote schemas into `schemasDir`.       |
| `diff`     | Show local vs remote schema changes (read-only). |

| Option    | Description                                                  |
| --------- | ------------------------------------------------------------ |
| `--prune` | With `push`: delete remote schemas missing from local files. |

Enable the matching website features (`content`, `form_and_survey`, `app_data`)
before syncing definitions for that kind.

How-to: [Feature schemas](/developer/schemas).

## `webstorio generate`

```bash theme={"dark"}
npx webstorio generate <kind> [key] [options]
```

Scaffold **local** feature pages that mirror the dashboard create-page flows
(CMS, forms, store, auth). Writes `.tsx` modules under `pages/`, enables the
matching feature flag, and registers routes in `webstorio.config.ts`. This does
**not** call remote create-page APIs — preview with `webstorio dev` and sync with
`webstorio push`.

| Kind             | Example                                           | Pages created                                                      |
| ---------------- | ------------------------------------------------- | ------------------------------------------------------------------ |
| `content <key>`  | `generate content blog_post`                      | `content/{key}`, `content/{key}/{content_entry_id}`                |
| `category <key>` | `generate category news --content-type blog_post` | `content/category/{key}`                                           |
| `form <key>`     | `generate form contact`                           | `form/{key}`                                                       |
| `store`          | `generate store --mode checkout`                  | `store/products`, `store/product/{product_slug}`, `store/checkout` |
| `auth`           | `generate auth`                                   | `auth/sign-in`, `auth/account`                                     |

| Option                         | Description                                                                                               |
| ------------------------------ | --------------------------------------------------------------------------------------------------------- |
| `--scope <list\|detail\|both>` | With `content`: which pages to create (default `both`).                                                   |
| `--content-type <key>`         | With `category`: content type key used to filter entries.                                                 |
| `--mode <checkout\|whatsapp>`  | With `store`: checkout includes cart/checkout; whatsapp is list + detail only (default `checkout`).       |
| `--with-orders`                | With `store`: also scaffold `store/orders` and `store/orders/{order_id}` (enables `user_authentication`). |

Existing slugs / files are skipped. Define matching schemas under `schemas/` (or
the dashboard) for CMS and forms before or after generating pages.

## `webstorio login`

Authenticate the CLI through your browser. The CLI opens a Webstorio URL, you
approve, and a token is stored securely (OS keychain when available, otherwise a
`0600` file under `~/.webstorio/`).

## `webstorio logout`

Revoke the current CLI token on the server and remove the stored token from
this machine.

## `webstorio status`

```bash theme={"dark"}
npx webstorio status
```

Show your environment, login state, local project summary, and a read-only diff
against the remote project (pages, components, assets, and schemas when
configured). See [Deploying](/developer/deploying#2-check-status).

## `webstorio push`

Compose every page and component and sync them to your Webstorio project. The
project is resolved by the `subdomain` in your config and created automatically
if it doesn't exist yet.

| Option            | Description                                                           |
| ----------------- | --------------------------------------------------------------------- |
| `--publish`       | Publish synced pages and make the site live.                          |
| `--prune-schemas` | Delete remote schemas whose keys are missing from local `schemasDir`. |

Output reports each page as `created`, `updated`, or `error` (with the reason).
