edit_file
Replace exact text in one file atomically, supporting batch edits, replaceAll, and post-edit compiler/linter diagnostics with a checkpoint ID.
Instructions
Replace exact text in one file. Either oldText/newText, or edits: [{oldText,newText,replaceAll}] applied atomically in order. oldText must match exactly once unless replaceAll. Reports diagnostics and a checkpoint id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path | |
| check | No | Run compilers/linters on the changed files afterwards (default true) | |
| edits | No | ||
| newText | No | ||
| oldText | No | ||
| replaceAll | No | ||
| expectedSha256 | No | Optional optimistic precondition from file_info; refuse the edit if the file changed |