Introducing jssg: precise, scalable codemod runtime
3 min read
What jssg provides
- Expressive search with
ast-grep
: Author rule configs, compose patterns withmatches
,constraints
, andstopBy
, and target exactly what you intend across large repos. - Predictable transforms: A typed transform function that returns explicit edits, with first-class support for JS/TS/JSX/TSX.
- Structured match data: Access captured bindings to drive precise edits.
- Dynamic parsing: analyze embedded languages such as TSX inside MDX.
- Runtime configuration: Read parameters at runtime for safe, configurable migrations.
- Sharding at scale: Use matrix strategy and values to split work by directory, team, or any key.
- Persistent state: Track progress across long-running or multi-repo transformations.
- Testing and CI: Structure codemod tests and run them in CI for repeatability.
- From CLI to enterprise: Start locally, then adopt centralized state, orchestration, and insights when needed.
Ecosystem integration
- Codemod CLI: richer utilities than jscodeshift CLI (scaffold
init
,jssg test
, workflow runner, caching). - Codemod Registry: discover, publish, and version public, private, and pro codemods.
- Codemod Workflow: chain multi-step migrations (including AI-assisted steps) across repos.
- Codemod MCP: run jssg codemods directly from your coding agent or IDE assistant.
Getting started
- Scaffold a codemod using Codemod CLI
1npx codemod init my-codemod2cd my-codemod
- Build your first transform
If you’re just getting started with jssg, we recommend using Codemod Studio or MCP
1// src/transform.ts2import { Transform, TSX } from 'codemod:ast-grep';34const transform: Transform<TSX> = async (root, options) => {5 // Use ast-grep rules to find targets, compute edits, and return them6 return [];7};89export default transform;
- Test locally
1npx codemod jssg test
- Run via a workflow
1npx codemod workflow run -w ./workflow.yaml
When to use jssg
- Precise code transformations and refactors
- Codebase hygiene and architectural pattern enforcement
- Cross-repo consistency work with sharded execution
- Parameterized transformations for team workflows
Nest steps
Start migrating in seconds
Save days of manual work by running automation recipes to automate framework upgrades, right from your CLI, IDE or web app.