Introducing jssg: a next-gen, multi-language codemod toolkit
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
1. Scaffold a codemod using Codemod CLI
1npx codemod init my-codemod2cd my-codemod
2. 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;
3. Test locally
1npx codemod jssg test
4. 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
Put software maintenance on autopilot.
De-risk, automate, and orchestrate large-scale code changes with secure, reliable, and lightning-fast micro-agents—built by your engineers or Codemod experts.