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

# forest layout:patch

> Send JSON Patch operations to a layout directly, without a layout file

# forest layout:patch

Patch the layout of an environment and team directly, from a set of JSON Patch operations. Unlike [`forest layout:pull`](https://docs.forest.app/reference/cli/layout-pull) and [`forest layout:apply`](https://docs.forest.app/reference/cli/layout-apply), there is no file to pull first: the CLI sends the operations as they are, one atomic `PATCH` per section, the same way the Forest UI saves a layout change.

## Usage

```bash theme={null}
forest layout:patch [FILE] [options]
```

## Arguments

| Argument | Description |
| - | - |
| `FILE` | JSON file holding the operations. Use `-` or omit it to read from standard input |

## Options

| Option | Description |
| - | - |
| `-e, --env` | Environment, by name or ID. Prompted when omitted |
| `-t, --team` | Team, by name or ID. Prompted when omitted |
| `-p, --projectId` | The ID of the project |
| `-f, --force` | Patch without asking for confirmation. Required when reading from standard input |
| `--dry-run` | Validate the operations and print them, without sending anything |

## Input format

The input is a JSON object keyed by section. Each value is an array of [RFC 6902](https://datatracker.ietf.org/doc/html/rfc6902) operations (`add`, `remove`, `replace`, `test`):

```json theme={null}
{
  "layout": [
    { "op": "replace", "path": "/collections/orders/displayName", "value": "Orders" }
  ],
  "folders": []
}
```

| Section | Content |
| - | - |
| `layout` | Collections: display names, columns, fields, segments, actions, summary views, charts |
| `folders` | The sidebar folders and their content |

Workflows are not accepted: use [`forest workflow:apply`](https://docs.forest.app/reference/cli/workflow-apply) to create or change a workflow.

The CLI checks every operation against the paths the Forest server accepts before sending anything. If one operation in a section is rejected, the whole section is rejected. If a later section fails after an earlier one succeeded, the CLI says which sections were applied: remove them from the input before retrying.

## Examples

```bash theme={null}
# Preview the operations of a file
forest layout:patch ops.json --env Development --team Operations --dry-run

# Apply them
forest layout:patch ops.json --env Development --team Operations

# Pipe the operations from another program
cat ops.json | forest layout:patch - -e Development -t Operations --force
```


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