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

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.