edit_file
Edit files by exact string find-and-replace without rewriting the whole file. Specify a unique old string and replacement text, or enable replace_all to update every match.
Instructions
Edit a file via exact string find-and-replace, without rewriting the whole file. old_str must match exactly and be unique unless replace_all is set.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| new_str | Yes | Text to replace it with | |
| old_str | Yes | Exact text to find | |
| replace_all | No | Replace every occurrence instead of requiring uniqueness |