ssh_replace_lines
Replace or delete a range of lines in a file on a remote server directly via sed, with no full-file transfer needed.
Instructions
Replace a range of lines in a file on the remote server.
Operates directly via sed on the remote — no full-file transfer needed. If content is empty, the lines are deleted. Both start_line and end_line are 1-based and inclusive.
Args: path: Path to the file on the remote. start_line: First line to replace (1-based, inclusive). end_line: Last line to replace (1-based, inclusive). content: Replacement text. Empty string deletes the line range. host: SSH host alias from config. Uses default if omitted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| start_line | Yes | ||
| end_line | Yes | ||
| content | No | ||
| host | No |