edit
Replace a unique substring in a file with new text, requiring a prior read and returning a unified diff.
Instructions
Replace old_string with new_string in file_path.
Requirements (matches opencode):
You must call
readon this file in the same session first.old_stringmust appear exactly once in the current file content. Provide more surrounding context if it isn't unique.The file must not have changed since the last
read.
Returns a unified diff of the change.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | ||
| newString | Yes | ||
| oldString | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |