- security vulnerabilities go unpatched
- bug reports duplicate issues already fixed upstream
- community support fragments across versions
What Codemod enables
- Eliminate repetitive migration work - Codemods handle mechanical changes like renaming APIs, updating imports, and refactoring patterns. Your users focus on the parts that require human judgment.
- Handle real-world complexity - Migrations aren’t always simple. Workflows supports multiple step types, manual approval gates for human intervention, and AI-assisted steps for non-deterministic tasks.
- Distribute through a central registry - Publish codemods to the Codemod Registry where users discover and run them via CLI or Codemod platform.
How it works
- Write codemods that automate breaking changes using jssg, YAML rules, or multi-step workflows
- Publish to the registry under your framework’s namespace using the CLI or CI/CD
- Users run them with a single CLI command or through Codemod platform
Examples
See how other frameworks use Codemod to help their communities upgrade:Node.js
Node.js API deprecation and upgrade codemods.
React
Automated migrations for React version upgrades.
Nuxt
Codemods for Nuxt framework migrations.
pnpm
Tooling migrations for pnpm package manager.
MSW
Mock Service Worker v1 to v2 migration.
Fastify
Fastify framework upgrade automation.
Want to add your framework? Ping us on Slack or start building below.
Getting started
Codemods can be built using:- CLI - Scaffold and build locally with
npx codemod init - MCP - AI-assisted creation in your IDE
- Studio - Web-based prototyping with Codemod AI
Build your first codemod
1
Scaffold a new package
- Codemod type - jssg (simple transforms) or multi-step workflow (complex migrations)
- Target language - TypeScript, JavaScript, Python, etc.
- Package name - Use
@your-framework/codemod-namefor scoped packages
2
Write your transformation
Open See the jssg quickstart for patterns and API details.
scripts/codemod.ts and write your transformation. Here’s a minimal example that replaces console.log with logger.log:scripts/codemod.ts
3
Test locally
Run your codemod against a target directory:For automated testing, create input/expected fixtures:Then run:See testing documentation for more options.
Publish to the registry
Once your codemod works locally, publish it so your users can run it.1
Login
2
Publish
CI/CD and automation
For ongoing codemod development, use the migrations template to get a ready-to-use repository with GitHub Actions for validation and publishing.1
Create your codemods repository
Fork or use the migrations template in your GitHub organization.
2
Link your organization
- Sign in to Codemod
- Create an organization matching your GitHub org name
- Install the Codemod GitHub App
3
Configure your workflow
For trusted publishing, ensure your workflow has OIDC permissions:
4
Push and publish
Add codemods to your repository. The GitHub Action validates on PR and publishes on release.
Getting help
Join the community
Ask questions, get help, and connect with other framework maintainers on Slack.
Book a call
Schedule a demo or get hands-on help from the Codemod team.