ast-grep Verified for current stable LTS

Ast Grep Command: Interactively Search And Rewrite Code

An engineer would use the 'ast-grep run' command with the specified options in a situation where they need to interactively search and modify specific code patterns across multiple files in a project directory, such as during a refactoring session to ensure code consistency. Exact CLI syntax to interactively search and rewrite code using Ast Grep.

When to use this: An engineer would use the 'ast-grep run' command with the specified options in a situation where they need to interactively search and modify specific code patterns across multiple files in a project directory, such as during a refactoring session to ensure code consistency.

Command Syntax

ast-grep run {-p|--pattern} '<pattern>' {-i|--interactive} {path/to/directory}

Command Breakdown

ast-grep is the base executable for this command.

FAQ

Purpose: Exact syntax to interactively search and rewrite code using Ast Grep.

Test path: Replace placeholders and run destructive commands in a disposable workspace first.

Flag behavior: Tool version, platform, and shell can change behavior.

Improve This Command

Suggest a correction, safer default, or version-specific note for this entry.

Related Operations

Back to Ast Grep directory