Edit File (Lines)
fc_edit_fileEdit files line-by-line: replace, insert, or delete lines using 1-based indexing. Specify start and end lines for targeted modifications, with optional content for replace/insert operations.
Instructions
Edits a file line-based: replace, insert, or delete.
Args:
path (string): Path to the file
operation (string): "replace" | "insert" | "delete"
start_line (number): Start line (1-based)
end_line (number, optional): End line for replace/delete
content (string, optional): New content for replace/insert
Examples:
Replace lines 5-10: operation="replace", start_line=5, end_line=10, content="new text"
Insert after line 3: operation="insert", start_line=3, content="new line"
Delete lines 7-9: operation="delete", start_line=7, end_line=9
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the file | |
| operation | Yes | Operation | |
| start_line | Yes | Start line (1-based) | |
| end_line | No | End line | |
| content | No | New content |