edit_file
Apply multiple text replacements to specified files using a list of edits, generate a unified diff to preview changes, and atomically update the file. Ensures compliance with directory restrictions and UTF-8 encoding.
Instructions
Apply multiple text replacements to a file and return a unified diff.
Args: path (str): File path to edit (absolute or relative to allowed directories) edits (List[Dict[str, str]]): List of edit operations, each with 'oldText' and 'newText' keys
Returns: str: Unified diff showing changes made, or error message if failed
Note:
Input Schema
Name | Required | Description | Default |
---|---|---|---|
edits | Yes | ||
path | Yes |