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

# momentic apply

> Apply patch changes to local Momentic tests.

<Warning>
  Deprecated and retained only for legacy test fragment patches. It is hidden
  from `momentic --help` and may be removed in a future release.
</Warning>

Applies a generated patch to the local copy of a test. Use it to roll changes
suggested by the Momentic dashboard back into version control.

```bash theme={null}
npx momentic apply patch --from <patchId> --to <testName>
```

## `patch`

Apply a saved patch to a test.

### Common flags

<ParamField path="-c, --config <config>" type="string">
  Path to the Momentic configuration file. Defaults to `momentic.config.yaml` in
  the current directory.
</ParamField>

<ParamField path="-f, --filter <filter>" type="string">
  When using [workspaces](/configuration/workspace), load the project whose name
  matches the filter.
</ParamField>

### Patch selection

<ParamField path="--from <from>" type="string">
  Patch identifier, formatted as three dash-separated words like
  `potato-apple-cherry`.
</ParamField>

<ParamField path="--to <to>" type="string">
  Name of the test the patch should be applied to.
</ParamField>

## Examples

Apply a patch named `potato-apple-cherry` to `checkout-happy-path`:

```bash theme={null}
npx momentic apply patch --from potato-apple-cherry --to checkout-happy-path
```
