content_replace
Search and replace text patterns in multiple files within specified directories. Preview changes with dry-run mode before applying them directly to files.
Instructions
Replace a pattern in file contents across multiple files.
Searches for text patterns across all files in the specified directory that match the file pattern and replaces them with the specified text. Can be run in dry-run mode to preview changes without applying them. Only works within allowed directories.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
dry_run | No | If True, only preview changes without modifying files | |
file_pattern | No | File name pattern to match (default: all files) | * |
path | Yes | Path to file or directory to search in | |
pattern | Yes | Text pattern to search for in files | |
replacement | Yes | Text to replace the pattern with (can be empty string) |