Installation
Install and set up Codegen in your development environment.
We currently support:
- Running Codegen in Python 3.12 - 3.13 (recommended: Python 3.13+)
- macOS and Linux
- macOS is supported
- Linux is supported on x86_64 and aarch64 with glibc 2.34+
- Windows is supported via WSL. See here for more details.
- Python, Typescript, Javascript and React codebases
Prerequisites
We recommend using uv for installation. If you haven’t installed uv
yet:
Installing Codegen
This makes the codegen
command available globally in your terminal, while keeping its dependencies isolated.
Quick Start
Let’s walk through a minimal example of using Codegen in a project:
-
Navigate to your repository:
-
Initialize Codegen in your project with codegen init:
This creates a
.codegen/
directory with: -
Create your first codemod with codegen create:
The
-d
flag incodegen create
generates 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:
Troubleshooting
Having issues? Here are some common problems and their solutions:
- I’m hitting an UV error related to
[[ packages ]]
: This means you’re likely using an outdated version of UV. Try updating to the latest version with:uv self update
. - I’m hitting an error about
No module named 'codegen.sdk.extensions.utils'
: The compiled cython extensions are out of sync. Update them withuv sync --reinstall-package codegen
. - I’m hitting a
RecursionError: maximum recursion depth exceeded
error while parsing my codebase: If you are using python 3.12, try upgrading to 3.13. If you are already on 3.13, try upping the recursion limit withsys.setrecursionlimit(10000)
.
For more help, join our community Slack or check the FAQ.
Next Steps
Was this page helpful?