content_replace
Search and replace text patterns across multiple files in a specified directory. Preview changes using dry-run mode without modifying files. Limited to allowed directories for secure operations.
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) |