# Wix CLI Commands

## Core Commands

### `wix login`

Log in to your Wix account

**Options:**

- `--api-key <token>`: Authenticate using an API key for automations and CI environments

### `wix logout`

Log out of your Wix account

### `wix telemetry <on|off>`

Opt in/out of sending anonymous usage information (telemetry) to Wix

### `wix whoami`

Display the email of the logged in Wix user

## Development Commands

### `wix dev`

Start the local development server.

**Options:**

- `--port <port>`: Specify which port to run on. Defaults to 4321.
- `--allowed-hosts <allowedHosts>`: Specify a comma-separated list of allowed hosts or allow any hostname.

### `wix build`

Invoke the astro build process, forwarding all command-line arguments.

### `wix preview`

Create a preview deployment of your application.

### `wix release`

Release a new version of your application.

**Options:**

- `-c, --comment <comment>`: The comment for your release version, not visible by users
- `-t, --version-type <type>`: The type of version you would like to create (major or minor)

### `wix generate`

Generate a new extension for your project.

**Options:**

- `--type <type>`: Extension type to generate. Available types:
  - `DASHBOARD_PAGE`: A page in the Wix dashboard
  - `DASHBOARD_MODAL`: A modal dialog in the Wix dashboard
  - `DASHBOARD_PLUGIN`: A plugin for the Wix dashboard
  - `DASHBOARD_MENU_PLUGIN`: A menu plugin for the Wix dashboard
  - `EMBEDDED_SCRIPT`: An embedded script extension
  - `CUSTOM_ELEMENT`: A custom HTML element
  - `SITE_PLUGIN`: A plugin for Wix sites
  - `EVENT`: An event handler
  - `SERVICE_PLUGIN`: A service plugin (SPI implementation)

## Environment Variables

### `wix env`

Work with environment variables.

**Subcommands:**

#### `wix env pull`

Pulls environment variables and merge them into .env.local file.

#### `wix env set`

Sets an environment variable.

**Options:**

- `--key <key>`: Name of the variable (required)
- `--value <value>`: Value of the variable (required)

#### `wix env remove`

Removes an environment variable.

**Options:**

- `--key <key>`: Name of the variable (required)
