Description
OpenRewrite is an open-source automated refactoring ecosystem for source code. It runs prepackaged recipes for common framework migrations, security fixes and style consistency, so changes that would take hours or days by hand can be applied across a repository in minutes. Recipes work by editing Lossless Semantic Trees, a model of the source code, and printing the changed tree back out. Because the original formatting is kept, the resulting diff stays small and easy to review. The project began with Java and its community is expanding language and framework coverage. You run recipes on one repository at a time through the OpenRewrite Gradle and Maven plugins, or through the CLI, and the docs include a free, self-paced introductory course and a quickstart that runs recipes on sample code. Developers who want their own transformations can write recipes in a recipe development environment. The documentation is maintained by Moderne, which also offers refactoring at scale across many repositories. The docs note that some recipes are moving from Maven Central to the Code Genome Project, so users should configure access to keep releases resolving.…
Highlights
- Prebuilt recipes for framework migrations and security fixes
- Keeps original formatting in every change
- Gradle and Maven plugins for running recipes
- Write your own recipes with the recipe development environment
Ratings & Reviews
No ratings yet
Be the first to rate Rewrite.
People also visit

refactor-plan
Detailed multi-file refactor planning with safety checks and rollback guidance
Rewrite FAQ
What is OpenRewrite?
An open-source ecosystem for automated, large-scale refactoring of source code. It runs recipes that migrate frameworks, fix security issues and keep style consistent.
Is OpenRewrite free?
Yes. The ecosystem is open source, and the documentation offers a free, self-paced Intro to OpenRewrite course.
Which languages does it support?
It started with Java, and the community is expanding its coverage of languages and frameworks.
How do I run a recipe?
Use the OpenRewrite Gradle or Maven plugin on one repository, or use the CLI. The quickstart guide runs recipes on sample code.
Can I write my own recipe?
Yes. The docs include a recipe development environment and a guide to authoring recipes.
What is Moderne?
Moderne maintains the OpenRewrite docs and offers refactoring at scale across many repositories.
What are the best Rewrite alternatives?
Popular alternatives to Rewrite include Eureka and Diffblue. See all Rewrite alternatives















