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

# WordPress and browser connection

> Choose a WordPress environment, connect the Miles workspace, and convert a site into a theme.

## `miles wordpress-detect`

```bash theme={"dark"}
miles wordpress-detect [--path <directory>] [--wp-cli <path>] [--json]
```

Passively checks whether the current folder or `--path` looks like a local WordPress installation. It does not run WordPress, WP-CLI, plugins, themes, or database checks.

The result contains `localWordPress`, including `found`, `root`, detected WP-CLI details, site information when available, plugin information, and `next` guidance. A detected local site is not permission to use it: ask the user whether to use a Miles design sandbox, that local installation, or another remote site.

## `miles wordpress-setup`

```bash theme={"dark"}
miles wordpress-setup --use local [--path <directory>] [--site-url <url>] [--open] [--wp-cli <path>] [--admin-user <login>] [--json]
miles wordpress-setup --use cloud [--json]
```

`--use local` is the explicit local-site setup command. It may install or activate the Miles plugin, connect the local site, and return WordPress and Miles workspace URLs. It does this only after the user chooses local WordPress and the connected Miles service supports local setup.

When WordPress needs a manual step, the result includes `manualActivationRequired`, `adminPluginsUrl`, `milesAdminUrl`, `actions`, and `next`. Ask the user to complete the WordPress step; do not write plugin credentials or secrets yourself.

`--use cloud` leaves local mode and returns the CLI to design-sandbox mode. It clears the active local selection but keeps the saved pairing so the local site can be used again later. It does not create a design sandbox by itself. The option name is part of the command interface; the user-facing environment is a design sandbox.

Remote WordPress sites are not configured through this command. Install and pair the Miles plugin through WordPress.

## `miles connect-browser`

```bash theme={"dark"}
miles connect-browser [--open] [--wait [seconds]] [--json]
```

Returns an authenticated workspace `url`, the normal `dashboardUrl`, `authenticated`, `connected`, `connection`, and the `activeSite`.

Open the authenticated `url`, not the plain dashboard URL. Then check until `connected` is true, or use `--wait`. `--open` asks the operating system to open the link. Browser connections can drop when the tab closes or sits idle.

## `miles convert-theme`

```bash theme={"dark"}
miles convert-theme [--no-wait] [--json]
```

Converts a built HTML site into a WordPress block theme in the connected Miles workspace. It needs a browser connection and may take several minutes. Keep the workspace open until it settles.

Use it after the HTML site is approved. HTML edits are usually cheaper before conversion; edits to a converted WordPress site can need the browser connection too.

Next: [Files and export](/reference/miles-cli/files-and-export).
