Codegen handles complex refactors while maintaining correctness, enabling a broad set of advanced code manipulation programs.
Codegen works with both Python and Typescript/JSX codebases. Learn more about language support here.
Quick Started
Codegen requires Python 3.12 - 3.13 (recommended: Python 3.13+).
Using UV (Recommended)
Using Pipx
Pipx is not officially supported by Codegen, but it should still work.
For further & more in depth installation instructions, see the installation guide.
What can I do with Codegen?
Codegen’s simple yet powerful APIs enable a range of applications, including:Build a Code Agent
Create an intelligent agent that can analyze and manipulate your codebase using natural language.
Visualize Your Codebase
Generate interactive visualizations of your codebase’s structure, dependencies, and relationships.
Mine Codebase Data
Create high-quality training data for fine-tuning LLMs on your codebase.
Build Codemods
Create powerful code transformations to automate large-scale changes.
Call graph visualization for modal/modal-client/_Client
View source code on modal/modal-client. View codemod on codegen.sh
Get Started
Get Started
Follow our step-by-step tutorial to start manipulating code with Codegen.
Tutorials
Learn how to use Codegen for common code transformation tasks.
View on GitHub
Star us on GitHub and contribute to the project.
Join our Slack
Get help and connect with the Codegen community.
Why Codegen?
Many software engineering tasks - refactors, enforcing patterns, analyzing control flow, etc. - are fundamentally programmatic operations. Yet the tools we use to express these transformations often feel disconnected from how we think about code. Codegen was engineered backwards from real-world refactors we performed for enterprises at Codegen, Inc.. Instead of starting with theoretical abstractions, we built the set of APIs that map directly to how humans and AI think about code changes:- Natural Mental Model: Express transformations through high-level operations that match how you reason about code changes, not low-level text or AST manipulation.
- Clean Business Logic: Let the engine handle the complexities of imports, references, and cross-file dependencies.
- Scale with Confidence: Make sweeping changes across large codebases consistently across Python, TypeScript, JavaScript, and React.
- Express transformations as composable programs
- Build higher-level tools by combining primitive operations
- Create and maintain their own abstractions for common patterns