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

# apply_patch-tool

# apply\_patch-tool

Pas bestandswijzigingen toe met een gestructureerd patchformaat. Dit is ideaal voor bewerkingen over meerdere bestanden
of met meerdere hunks, waarbij één enkele `edit`-aanroep kwetsbaar zou zijn.

De tool accepteert één enkele `input`-string die één of meer bestandsoperaties omvat:

```
*** Begin Patch
*** Add File: path/to/file.txt
+line 1
+line 2
*** Update File: src/app.ts
@@
-old line
+new line
*** Delete File: obsolete.txt
*** End Patch
```

## Parameters

* `input` (vereist): Volledige patchinhoud inclusief `*** Begin Patch` en `*** End Patch`.

## Notities

* Patch-paden ondersteunen relatieve paden (vanaf de workspace-directory) en absolute paden.
* `tools.exec.applyPatch.workspaceOnly` staat standaard op `true` (beperkt tot de workspace). Zet dit alleen op `false` als je er bewust voor kiest dat `apply_patch` buiten de workspace-directory mag schrijven/verwijderen.
* Gebruik `*** Move to:` binnen een `*** Update File:`-hunk om bestanden te hernoemen.
* `*** End of File` markeert indien nodig een invoeging alleen bij EOF.
* Experimenteel en standaard uitgeschakeld. Schakel in met `tools.exec.applyPatch.enabled`.
* Alleen voor OpenAI (inclusief OpenAI Codex). Optioneel te beperken per model via
  `tools.exec.applyPatch.allowModels`.
* Configuratie staat alleen onder `tools.exec`.

## Voorbeeld

```json theme={"theme":{"light":"min-light","dark":"min-dark"}}
{
  "tool": "apply_patch",
  "input": "*** Begin Patch\n*** Update File: src/index.ts\n@@\n-const foo = 1\n+const foo = 2\n*** End Patch"
}
```
