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

# Widget

> Generate embed code and preview your Zeplo chat widget

Manage your Zeplo chat widget from the CLI. Generate embeddable script tags for your website and preview widget configuration without opening the dashboard.

## zeplo widget generate

Generate the HTML embed code for a Zeplo chat widget. Provide your site ID and the command outputs a ready-to-paste `<script>` tag that you can add to your website's HTML.

```bash theme={null}
zeplo widget generate <siteId>
```

### Arguments

| Argument | Description |
| - | - |
| `<siteId>` | The ID of the site to generate the widget for. Find your site ID in the Zeplo dashboard under Site Settings. |

### Options

| Flag | Description |
| - | - |
| `--position <position>` | Set the widget position on the page. Accepts `bottom-right`, `bottom-left`, or `inline`. Defaults to `bottom-right`. |
| `--color <hex>` | Override the widget accent color with a hex value (e.g., `#FF5733`). |
| `--locale <code>` | Set the default language for the widget UI. Accepts an ISO 639-1 code (e.g., `en`, `fr`, `de`). |
| `--copy` | Automatically copy the generated embed code to your clipboard. |

### Examples

```bash theme={null}
# Generate widget embed code for a site
zeplo widget generate site_4m8k2p

# Generate with a custom position and color
zeplo widget generate site_4m8k2p --position bottom-left --color "#3B82F6"

# Generate for a French-language widget and copy to clipboard
zeplo widget generate site_4m8k2p --locale fr --copy
```

## zeplo widget preview

Preview your widget configuration locally. This command starts a lightweight development server and opens a sample page in your browser with the widget embedded, so you can test appearance and behavior before deploying.

```bash theme={null}
zeplo widget preview
```

### Options

| Flag | Description |
| - | - |
| `--port <port>` | Specify the port for the preview server. Defaults to `3456`. |
| `--site <siteId>` | Preview the widget for a specific site. Defaults to the first site in your account. |
| `--no-open` | Start the preview server without opening the browser. |

### Examples

```bash theme={null}
# Preview the widget with default settings
zeplo widget preview

# Preview a specific site's widget
zeplo widget preview --site site_4m8k2p

# Preview on a custom port without opening the browser
zeplo widget preview --port 8080 --no-open
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.