Codemod is the AI-powered, community-led platform for automating code migrations, framework upgrades, and large-scale changes.
This repo houses the Codemod CLI and its underlying workflow engine β everything you need to scaffold, test, and run codemods locally or in CI. The CLI can also connect to Codemodβs hosted Registry and Platform when you want to publish or orchestrate migrations across many repositories.
- Codemod CLI β Run, test, and publish codemods from your terminal or CI.
- Workflows β Orchestrate multi-step migrations with YAML configuration, matrix strategies, and manual approval gates.
- JSSG β JavaScript ast-grep: write powerful AST transformations in TypeScript with pattern matching and semantic analysis.
- Codemod Registry β Share or discover community codemods via
npx codemod publishornpx codemod search. - Codemod MCP β AI tools for code analysis, AST manipulation, and codemod creation in AI-powered IDEs.
# 1) Scaffold a new codemod project
npx codemod init my-codemod
# 2) Test it locally
npx codemod workflow run -w my-codemod/workflow.yaml
# 3) Publish it when you're ready
npx codemod publish my-codemod
# 4) Run it from the Registry
npx codemod @codemod/my-codemodSee the full CLI reference for every command and option.
The CLI is the engine that powers campaigns inside Codemod Platform. Need to coordinate changes across multiple repositories, track progress, or collaborate with your team? The Platform adds insights, orchestration, dashboards, and authoring tools that help teams successfully land large-scale code migrations.
Explore our documentation to learn more, and join the conversation or share your feedback in our Slack community.
There are two ways to contribute to the Codemod ecosystem:
Help improve the CLI, workflow engine, and JSSG runtime. See the contributing guide to get started with development setup, testing, and pull requests.
Create codemods for framework upgrades, security patches, or common refactoring patterns. Published codemods help the entire community migrate faster.
- Workflows quickstart β Scaffold your first codemod package
- JSSG guide β Write AST transformations in JS/TS
- Publishing β Share your contributions to Codemod Registry
Looking for ideas? Spark a discussion in our Slack community or browse Codemod Registry for codemods that could use improvements.
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
