Prerequisites
We recommend using uv for installation. If you haven’t installeduv yet:
Installing Codegen
Install the Codegen CLI globally:This makes the
codegen command available globally in your terminal, while keeping its dependencies isolated.Quick Start
Let’s walk through a simple example of using Codegen in a project:-
Navigate to your repository:
-
Initialize Codegen in your project:
This creates a
.codegen/directory with: -
Create your first codemod with codegen create:
The
-dflag incodegen creategenerates an AI-powered implementation. This requires a Github account registered on codegen.sh -
Run your codemod with codegen run:
-
Reset any filesystem changes (excluding
.codegen/*) with codegen reset:
Next Steps
IDE Integration
Learn how to use Codegen effectively in VSCode, Cursor, and other IDEs.
Tutorials
Follow step-by-step tutorials for common code transformation tasks.
Work with AI
Leverage AI assistants like Copilot, Cursor and Devin
Guides
Learn more about building with Codegen
For more help, join our community Slack or check the FAQ.