Skip to content

Introduction

omnimod is a modular, plugin-based codemod tool for TypeScript / JavaScript / React codebases. A small core provides the codemod machinery; plugins encapsulate specific transformations.

Why omnimod

Packages

PackageResponsibility
@omnimod/coreParse, walk, the Plugin contract, run() orchestration, diffs, formatting.
@omnimod/plugin-utilsHelpers for plugin authors (shared ESTree node types + cast, CSS-in-JS parsing, a vanilla-extract object model, import management).
@omnimod/cliThe omnimod command.
@omnimod/plugin-*Plugins.

How it works

run(plugin, options) does the orchestration:

  1. Discover — glob the project (respecting .gitignore) for files matching the plugin's include.
  2. Parse each file once into an AST + a magic-string edit buffer.
  3. analyze — an optional first pass over every file that collects cross-file facts into a shared ProjectContext.state.
  4. transform — the main pass: each file is rewritten via its edit buffer, and new files can be emitted.
  5. finalize — an optional last pass that emits shared files (e.g. a theme contract, or a migration report).
  6. Write / dry-run — with write: true, changed and emitted files are written and formatted; otherwise a colored diff is returned.

Next: Getting started.

Released under the MIT License.