Alternatives to ast-grep
Search and rewrite source code using its structure instead of text alone. The listings below can replace it for an important use case. Each note says what changes if you switch.
The original
ast-grep
Search and rewrite source code using its structure instead of text alone.
Replacements
Listings that take over the same core job as ast-grep.
fastmod
A fast command-line tool for interactive regex search and replace across a large codebase.
fastmod does interactive regex search and replace across large codebases with per-change review, but it is text based and does not understand code syntax like ast-grep.
Also worth comparing
These listings name ast-grep as their own alternative, so the relationship runs both ways.
scooter
Review and apply text replacements through a terminal interface.
ast-grep searches and rewrites code by syntax structure with reusable lint rules, instead of reviewing plain text replacements interactively in a terminal interface.
Similar software
Related functionality, not a direct replacement.
Difftastic
Compare source files by syntax to highlight meaningful changes.
Ruff
Lint and format Python code with one fast command-line tool.
ShellCheck
Catch common shell-script mistakes before running them.
ugrep
A grep-compatible file searcher with a text interface, Boolean queries, fuzzy matching and archive search.
ack
A grep-like source code search tool built for programmers working in large code trees.