# olef layout

Source: https://olef.dev/docs/reference/cli/layout

Generated from **Olef 3.0.2**. [All commands](https://olef.dev/docs/reference/commands) · [Capabilities and requirements](https://olef.dev/docs/reference/capabilities)

These entries describe available commands, not a sequence to run. Check prerequisites before changing app, device, or cloud state. Global options are listed in the [command catalog](https://olef.dev/docs/reference/commands#global-options).

## olef layout

Agent-first layout snapshots and diffs

```bash
olef layout --help
```

Output: **json**.

### olef layout snapshot

Capture a layout snapshot from the current UI tree

```bash
olef layout snapshot --help
```

Output: **json**.

| Argument | Description |
| --- | --- |
| `--out <OUT>` / `-o` | Write JSON to a file instead of stdout |
| `--compose` | Add Compose nodes (runtime Compose inspector) |
| `--semantics` | Add Compose semantics and text (slower: reads every parameter) |
| `--source-map` | Map nodes and elements to project source files |
| `--screenshot` | Include a screenshot artifact next to the snapshot |
| `--app <APP>` | App package to inspect instead of the foreground app |
| `--pid <PID>` | Process id to inspect instead of the foreground app's |
| `--timeout-ms <TIMEOUT_MS>` | Budget for Compose parameters and semantics, in milliseconds Default: `8000`. |
| `--json` | Accepted for compatibility; output is always JSON. |

### olef layout diff

Diff two layout snapshot JSON files

```bash
olef layout diff --help
```

Output: **json**.

| Argument | Description |
| --- | --- |
| `<before>` | **Required.** |
| `<after>` | **Required.** |
| `--json` | Accepted for compatibility; output is always JSON. |

### olef layout recompositions

Compose recomposition counters from the runtime's Compose inspector

```bash
olef layout recompositions --help
```

Output: **json**.

| Argument | Description |
| --- | --- |
| `--reset` | Reset the counters after reading them |
| `--app <APP>` | App package to inspect instead of the foreground app |
| `--pid <PID>` | Process id to inspect instead of the foreground app's |
| `--timeout-ms <TIMEOUT_MS>` | Budget for Compose parameters and semantics, in milliseconds Default: `8000`. |
| `--min-count <MIN_COUNT>` | Only return nodes recomposed at least this many times (the full tree of a real screen is hundreds of nodes; `--min-count 1` keeps what changed) Default: `0`. |
| `--limit <LIMIT>` | Return at most this many nodes, most recomposed first |
| `--json` | Accepted for compatibility; output is always JSON. |

### olef layout source

Resolve a current UI node and map it to source when source mapping is available

```bash
olef layout source --help
```

Output: **json**.

| Argument | Description |
| --- | --- |
| `--id <ID>` | Element id from `screen` or `layout snapshot` |
| `--draw-id <DRAW_ID>` | Layout node draw id from `layout snapshot` |
| `--text <TEXT>` | Match text by case-insensitive substring. Single-target actions prefer a unique full-text match; multiple remaining matches are ambiguous |
| `--rid <RID>` | Match by resource-id substring; actions prefer a unique exact match |
| `--desc <DESC>` | Match by content-description substring; actions prefer a unique exact match |
| `--app <APP>` | App package to inspect instead of the foreground app |
| `--pid <PID>` | Process id to inspect instead of the foreground app's |
| `--timeout-ms <TIMEOUT_MS>` | Budget for Compose parameters and semantics, in milliseconds Default: `8000`. |
| `--json` | Accepted for compatibility; output is always JSON. |
