Skip to content
SPECIFICTION
Get listed

ast-grep vs OpenRewrite

ast-grep

ast-grep.github.io

OpenRewrite

openrewrite.org

Side by side

Figureast-grepOpenRewrite
Price fromFreeFree
Free planYesYes
Free trial——
Open source——
WebYes—
WindowsYes—
macOSYes—
LinuxYesYes
APIYes—
Self-hosted—Yes
Plans published11
Spec score · Code Refactoring Tools9.1 (#1)8.2 (#6)
IntegrationsThe documentation describes editor integrations, including a VS Code extension and language server support for editors such as Vim and Neovim.The Moderne platform page describes native GitHub, GitLab, and Bitbucket integrations for coordinated pull requests.
LanguagesThe project says it supports 20+ languages and allows custom languages to be loaded.The OpenRewrite project describes Java as its original focus and says language and framework coverage is expanding.
Purposeast-grep is a fast, polyglot tool for structural code search, linting, and rewriting at scale.OpenRewrite is an open-source automated refactoring ecosystem for eliminating technical debt in code repositories.
SupportThe project directs users with questions or issues to GitHub or Discord and also points to Stack Overflow and Reddit.The OpenRewrite documentation invites users to ask questions in Slack or Discord and lists [email protected].

Plans

ast-grep

  • ast-grepFree

ast-grep pricing →

OpenRewrite

  • OpenRewrite coreFree

OpenRewrite pricing →

In their own words

ast-grep

ast-grep is a free, open-source tool for structural code search, linting, and rewriting. It matches patterns against syntax-tree nodes, helping developers locate and change code across a codebase rather than searching plain text. Its CLI can preview and apply rewrites interactively, and scan configurable YAML rules with error, warning, info, or hint severity. Rules can combine pattern, kind, regex, relational, and composite conditions, and CLI commands help create and snapshot-test them. The project says it supports more than 20 languages and can load custom languages. JavaScript and WebAssembly APIs allow programmatic syntax-tree work; a browser playground offers a way to try patterns without local installation. Editor options include a VS Code extension and language-server setups, including for Vim and Neovim. The tool is free, has a web interface, and is distributed through package managers or built from source. Its FAQ notes that some advanced static-analysis information is unsupported, and one rule cannot target multiple languages at once.

Visit ast-grep.github.io

OpenRewrite

OpenRewrite is an open-source ecosystem for automated code refactoring, aimed at updating code and reducing technical debt. It represents code as Lossless Semantic Trees, applies transformations, and prints the result back into source code for review. Its recipes cover framework migrations, security fixes, and style consistency, and can be written in YAML, Refaster templates, or Java. Maven and Gradle plugins run recipes locally as part of builds, one repository at a time. The Maven plugin offers a dry run that reports potential changes and writes diff files; recipes run only when explicitly activated by name. Documented support includes Java, Kotlin, and Groovy, plus formats such as HCL, JSON, Properties, Protobuf, TOML, XML, and YAML. Framework coverage includes Spring, Quarkus, and Micronaut. The recipe index lists 4,183 recipes across modules. Core and language libraries use Apache License 2.0, but some recipes have other licensing terms. Core is free; some artifacts require authenticated repository access, and some recipes require a Moderne subscription.

Visit openrewrite.org