---
schema_version: "1"
id: 66a94969e62822c9a793844819a719e4287c9b3cf5de0e04c8abde23bcc6de4b
title: lightning dev site
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/sfclireference/guides/lightning/cli_reference_lightning_dev_site.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_lightning_dev_site.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 74a8a6c608ffdc5c70fc38e19f0c02c1479cde45172aa6f7e939bda54b3a9beb
products:
  - Salesforce CLI Command Reference
  - salesforcedx
---
<!-- prettier-ignore-start -->

# lightning dev site

Preview an Experience Builder site locally and in real-time, without deploying it.

## Description for lightning dev site

Enable Local Dev to see local changes to your site in a real-time preview that you don't have to deploy or manually refresh. To let you quickly iterate on your Lightning web components (LWCs) and pages, your site preview automatically refreshes when Local Dev detects source code changes.

When you edit these local files with Local Dev enabled, your org automatically reflects these changes.

<ul><li>Basic HTML and CSS edits to LWCs</li><li>JavaScript changes to LWCs that don't affect the component's public API</li><li>Importing new custom LWCs</li><li>Importing another instance of an existing LWC</li></ul>

To apply any other local changes not listed above, you must deploy them to your org using the `sf project deploy start` command. Then republish your site and restart the server for the Local Dev experience.

If you run the command without flags, it displays a list of Experience Builder sites that it found in your local DX project for you to choose from. Use the --name flag to bypass the question. The command also asks if you want to enable Local Dev in your org if it isn't already.

For more considerations and limitations, see the Lightning Web Components Developer Guide.

## Flags

| Flag Name (Long) | Flag Name (Short) | Description |
|------------------|-------------------|-------------|
| <code>&#8209;&#8209;api&#8209;version</code> | N/A | **Type:** Value<br><br>Override the api version used for api requests made by this command |
| <code>&#8209;&#8209;flags&#8209;dir</code> | N/A | **Type:** Value<br><br>Import flag values from a directory. |
| <code>&#8209;&#8209;name</code> | <code>&#8209;n</code> | **Type:** Value<br><br>Name of the Experience Builder site to preview. It must match a site name from the current org. |
| <code>&#8209;&#8209;target&#8209;org</code> | <code>&#8209;o</code> | **Type:** Value<br>**Required**<br><br>Username or alias of the target org. Not required if the `target-org` configuration variable is already set. |

## Examples for lightning dev site

Select a site to preview from the org with alias "myOrg":

```shell
sf lightning dev site --target-org myOrg
```

Preview the site "Partner Central" from your default org:

```shell
sf lightning dev site --name "Partner Central"
```
<!-- prettier-ignore-end -->
