ssh_patch_file
Replace a unique string in a remote file by reading, replacing locally, and writing back. Ensures the old string appears exactly once to avoid ambiguous edits.
Instructions
Replace a string in a file on the remote server.
Reads the file, performs the replacement locally, and writes it back. The old string must appear exactly once (to avoid ambiguous edits).
Args: path: Path to the file on the remote. old: The exact text to find and replace. Must be unique in the file. new: The replacement text. host: SSH host alias from config. Uses default if omitted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| old | Yes | ||
| new | Yes | ||
| host | No |