Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Outline

Codegen Examples

Documentation

This is a collection of examples using Codegen. You can use these examples to learn how to use Codegen and build custom code transformations.

Setup

We recommend using uv with Python 3.13 for the best experience.

To install Codegen, please follow the official installation guide. Once Codegen is installed, use these steps to run the examples in this repository:

Install the Codegen CLI globally

uv tool install codegen

Initialize Codegen in your project

codegen init

Activate the virtual environment

source .codegen/.venv/bin/activate

Your environment is now ready to run example codemods.

IDE Configuration (Optional)

To configure your IDE for optimal use with Codegen, follow our IDE setup guide.

Examples

Within the examples folder, each subdirectory contains a self-contained example with:

  • An explanation of the transformation (README.md)
  • A Codegen script that performs the transformation (run.py)
  • Sample code to transform, if not using a repository (input_repo/)

To see a transformation, simply run the run.py script within the desired directory.

Learn More

Contributing

Have a useful example to share? We'd love to include it! Please see our Contributing Guide for instructions.

License

The Apache 2.0 license.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.