file_edit
Edit a file by replacing a specific substring with a new string, with control over single or all occurrences.
Instructions
Replace a substring in an existing file. The substring must occur exactly once unless replaceAll is true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Project-relative path of the file to edit | |
| newString | Yes | Replacement string | |
| oldString | Yes | Exact substring to replace (must occur exactly once unless replaceAll is true) | |
| replaceAll | No | Replace every occurrence (default: false) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| error | Yes | ||
| _hints | Yes | ||
| requiresHarnessSession | Yes |