- Package discovery – Search and browse codemods by language, framework, category, and keywords
- Version management – Semantic versioning with support for version pinning
- Scoped packages – Organize packages by organization or user scope (e.g.,
@nodejs/create-require-from-path) - Access control – Configure codemod access types:
publicorprivate - Direct execution – Run packages directly from the registry using
npx codemod@next <package-name>
Package Access Types
Package visibility controls discovery in search and listings. Package access controls retrieval and execution. Choose both before publishing; hiding a listing is not an access restriction.Public Access
Packages withpublic access can be retrieved and run by anyone who knows the package identifier. They appear in public search results only when visibility is also public.
Use cases:
- Community-shared codemods for open-source projects
- Framework migration tools for public use
- Educational or example codemods
Private Access
Packages withprivate access require authorization, such as ownership, organization membership, or an API key authorized for the package. Confirm your organization’s publishing and execution options with the Codemod team.
Use cases:
- Maintain proprietary codemods for company-specific patterns
- Share internal codemods across teams
- Keep sensitive transformations private
- Enforce organization standards
- Requires organization membership (for organization-scoped packages)
- Packages can be scoped to your organization (e.g.,
@your-org/internal-codemod) - Configured through organization settings in the Codemod app
Reserving an Organization Scope
To publish under your organization’s scope (for example,@your-org/my-codemod), verify control of that organization. In Add Organization, choose either:
- Connect GitHub for repository integration as well as an organization scope. See Linking Your GitHub Organization.
- Repository verification for registry-only use without installing the GitHub App. Follow the displayed repository and verification-file instructions, then verify the challenge. Use a public, non-forked, non-archived repository owned by the GitHub organization whose name matches the requested scope.
Discovering Packages
Browse the Registry: Visit the Codemod Registry web interface to browse packages. On a package page, the Needs codemod ≥ 2.0 badge means that the displayed version requires Codemod 2.0 or newer. Open the Source tab to review the package files, including its workflow, before you run it. Search from CLI: Use thecodemod search command to find packages:
Running Packages from the Registry
Run packages directly from the registry without downloading them first:When you run a package from the registry, Codemod CLI automatically downloads and caches it locally. Subsequent runs use the cached version for faster execution.
latest and preview point to versions and can move. Use a tag when you want that release channel; use an exact version when you need a reproducible run. Publishers can publish to a named tag with npx codemod@next publish --tag preview.
Some Pro packages support a dry-run-only preview in compatible clients. A preview is not permission for full execution. Check the package’s available actions and contact the Codemod team about access; client support and account permissions can differ.
Publishing Packages
Publish your codemods to the registry to share them with others or use them across projects.Publishing Guide
Learn about all publishing methods: interactive login, API keys, and trusted publishers for CI/CD.
Configuring Access and Visibility
For a restricted organization package, include these settings in yourcodemod.yaml and publish under your verified organization scope:
codemod.yaml
public– Anyone can run the codemodprivate– Retrieval and execution require package authorization, including supported organization and API-key access
Packages may also use
pro access. For publishing options and execution access, contact the Codemod team.public– Everyone can see the package in search and listingsprivate– Omit the package from public discoveryorg– List for the package’s organization in organization contextuser– List for the owner rather than publicly
Learn more about configuring packages.
Using Packages in Workflows
A workflow runs a registry package as one of its steps withcodemod(source, { params }). Pin a version with @<version> so the workflow keeps running the package you tested:
workflow.ts
{ output }, what the package’s workflow returned. With nobody to ask (--no-interactive, CI), the nested package’s shell, http, agent and pull request steps need --approve, as when you run the package on its own (see Approvals).
In a workflow.yaml, the same step is a codemod step:
workflow.yaml
Best Practices
Package Naming
- Use descriptive names that indicate the codemod’s purpose
- Follow publish validation:
^(@[A-Za-z0-9\-_.]+/)?[A-Za-z0-9\-_]+$(optional@scope/, then letters, numbers, hyphens, underscores — no dots in the name) - For version migrations, hyphenate versions in the id (
lib-1-2-to-1-3), never1.2-to-1.3 - Include framework/library names when relevant
@your-org/package-name) when:
- Framework or library maintainers publishing official codemods for your project
- Organizations or teams publishing multiple related codemods that should be grouped together
- You want to ensure only your organization can publish codemods with that scope
- You need better discoverability for codemods from a specific organization or framework
Versioning
- Follow semantic versioning (MAJOR.MINOR.PATCH)
- Increment major version for breaking changes
- Increment minor version for new features
- Increment patch version for bug fixes
- Keep
versionin sync in bothcodemod.yamlandpackage.json - Before republishing after any material change (transforms, fixtures, workflow, README, name, or other package metadata), bump the version — do not reuse a published version with different contents
Documentation
- Write clear descriptions in
codemod.yaml - Add relevant keywords for discoverability
- Include examples in your README
- Document any workflow parameters
Testing
- Test your codemod thoroughly before publishing
- Use jssg testing for automated test cases
- Validate your workflow with
npx codemod@next workflow validate - Test with real codebases before publishing
Next steps
CLI Reference
Complete command reference for registry operations.
Package Structure
Learn how to create and configure Codemod packages.
Codemod Registry
Browse and discover packages in the web interface.