ast-grep
Search, lint, and rewrite code using AST patterns. tldr-pages
On several platforms
Several platforms
Search for a pattern in files
ast-grep run --pattern 'pattern' path/to/fileIdentifySearch for a pattern in a specific language
ast-grep run --pattern 'pattern' --lang python path/to/directoryIdentifyRewrite code matching a pattern
ast-grep run --pattern 'pattern' --rewrite 'replacement' path/to/fileIdentifyRun rules from a configuration file
ast-grep scan --rule path/to/rule.yml path/to/directoryIdentifyInteractively search and rewrite code
ast-grep run --pattern 'pattern' --interactive path/to/directoryIdentifyDisplay help for a subcommand
ast-grep run --helpIdentify