A tool that replaces exact text in an existing file. Unless replace_all is
TRUE, old_text must appear exactly once. Line endings and the rest of
the file are left as they were.
Format
A tool definition created with ellmer::tool().
Examples
path <- tempfile(fileext = ".txt")
writeLines("alpha", path)
tool_edit_file(path, "alpha", "beta")
#> [1] "Successfully edited /tmp/RtmpZDl9Ug/file19f079671711.txt (1 replacement)"
unlink(path)