> ## 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.

# Sites and context

> Create, resume, inspect, name, and recover Miles sites.

## `miles site-create`

```bash theme={"dark"}
miles site-create "<description>" [--name "<name>"] [--brief <file>] [--attach <file>] [--no-wait] [--json]
```

In design-sandbox mode, this creates a new design sandbox and makes it active locally. If the CLI is paired with a local WordPress site, it starts the new design on that exact site instead. It never creates a fallback design sandbox while local mode is active.

`--brief` reads a Markdown brief, skips the discovery interview, and starts direction generation. Repeat `--attach` for logos, imagery, or source documents. `--no-wait` returns the running-job handle described in [Jobs and safety](/reference/miles-cli/jobs-and-safety).

In design-sandbox mode, use `site-create` for a separate deliverable. Do not send “build a new site” through `say` on an existing site.

## Find, resume, and switch sites

| Command                                                                    | Use                                                                                                              |
| -------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `miles sites [--json]`                                                     | List the sites owned by the signed-in account. In local mode, it returns only the paired WordPress site.         |
| `miles site-attach <siteId> [--duplicate] [--name "<copy name>"] [--json]` | Make any owned design-sandbox site active on this machine. This is unavailable in local mode.                    |
| `miles use <siteId> [--json]`                                              | Switch between design-sandbox sites already known to this local installation. This is unavailable in local mode. |
| `miles rename "<name>" [--json]`                                           | Rename the active site's conversation.                                                                           |

`site-attach` returns `ok`, `siteId`, `conversationId`, `phase`, `duplicated`, and `next`. Add `--duplicate` before a broad or risky redesign. The copy becomes active and leaves the original alone.

Local mode is an exclusive target lock: build, edit, conversion, export, and browser commands continue to use the paired WordPress site. To leave it, the user must explicitly choose design-sandbox mode with `miles wordpress-setup --use cloud --json`.

## `miles site-state`

```bash theme={"dark"}
miles site-state [--full] [--json]
```

The main recovery and orientation command. The standard result includes `siteId`, `conversationId`, `phase`, `status`, `conversationStatus`, `siteReady`, directions, connection state, a `siteCompletionPlan`, credits, `undoAvailable`, `approvalRequired`, and suggested `next` commands.

`--full` adds the strategic brief, full direction details, session memory, and conversion fields. Use it after attaching a site or when an agent needs to understand where work stopped.

## `miles site-plan`

```bash theme={"dark"}
miles site-plan [--history] [--json]
```

Returns the complete current Site Plan. Use it when the user asks what is complete, what remains, or what should happen next. The result preserves every plan item, including its title, description, status, failure reason, and result reference.

Add `--history` to include deduplicated plan revisions and the items added, removed, or changed between them. Treat the item status as authoritative; a result reference alone does not prove that an item is complete.

## `miles history`

```bash theme={"dark"}
miles history [--limit <n>] [--offset <n>] [--json]
```

Returns the visible conversation transcript. The JSON result contains `total`, `offset`, `limit`, and `messages`; each message has an `id`, `role`, and `parts`. Omit `offset` for the newest messages. Limits cap at 100.

## Supporting commands

`miles status [--json]` is a smaller current-state check. `miles messages` is a legacy text-only conversation reader; use `history` for new integrations.

Next: [Design and build](/reference/miles-cli/design-and-build).
