astgrep_replace
Transform code by matching and replacing AST patterns in specified files. Supports multiple languages, preview mode, and interactive confirmation for secure and precise modifications.
Instructions
Code transformation using ast-grep rewrite patterns
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dryRun | No | Preview changes without applying them | |
| interactive | No | Interactive mode for confirmation | |
| language | No | Programming language | |
| paths | No | Specific paths to transform | |
| pattern | Yes | AST pattern to match | |
| replacement | Yes | Replacement pattern | |
| workingDirectory | No | Optional working directory for the operation (defaults to server working directory) |