Tool: Replace exact strings in a text file
btw_tool_files_replace(
path,
old_string,
new_string,
replace_all = FALSE,
`_intent` = ""
)Returns a message confirming the replacement was applied.
Path to the file to edit. The path must be in the current
working directory.
The exact string to find in the file. Must be unique unless
replace_all is TRUE.
The replacement string. Must differ from old_string.
If TRUE, replace all occurrences of old_string.
Defaults to FALSE, which requires exactly one occurrence.
An optional string describing the intent of the tool use. When the tool is used by an LLM, the model will use this argument to explain why it called the tool.
Other files tools:
btw_tool_files_edit(),
btw_tool_files_list(),
btw_tool_files_read(),
btw_tool_files_search(),
btw_tool_files_write()