← All Projects
Featured CLI Tool 2024

ExtMig

Open-source CLI tool to automate and streamline database migration workflows for TypeScript projects.

An open-source developer tool designed to improve migration workflows and productivity for modern development teams.

#open-source#developer-tools#automation#cli#typescript

ExtMig is an open-source CLI tool built to simplify and automate migration workflows in TypeScript-based Node.js projects. Born from the friction of managing database migrations manually across environments, ExtMig gives developers a structured, reproducible way to run, track, and roll back migrations from a single command.

The project was built with a strong focus on developer experience: TypeScript-first configuration, clear CLI output, and an extensible architecture that fits into existing toolchains without forcing a specific setup.

Published openly on GitHub, ExtMig reflects a commitment to building tools that solve real problems in real development workflows, and contributing back to the open-source community.

Key Features

⚡

Automated Migration Execution

Run, rollback, and dry-run migrations from a single CLI command with clear output and error reporting.

🔧

TypeScript-first Config

Configuration and migration files are written in TypeScript, giving you full type safety and IDE support out of the box.

🔌

Extensible Plugin System

Add custom hooks before and after each migration step to integrate with your existing toolchain.

↩️

Safe Rollback Support

Every migration defines an up and down function, enabling clean and predictable rollbacks in both development and production.

Tech Stack

TypeScriptNode.js

Architecture

ExtMig is structured as a Node.js CLI with a plugin-based architecture. Each migration step is represented as an atomic unit, enabling rollback and dry-run support. The tool reads configuration from a local extmig.config.ts file and resolves migration files in order. The execution engine wraps all steps in a transaction boundary and maintains an internal state machine that tracks executed vs. pending steps.

Challenges & Solutions

The hard problems, and how I solved them.

01

Ensuring atomic rollback across multiple steps

The hardest part was designing the execution engine so that if any step fails mid-run, the entire batch rolls back cleanly without leaving the database in a partial state. I solved this by wrapping all steps in a transaction boundary and building an internal state machine that tracks executed vs. pending steps.
02

TypeScript config resolution at runtime

Loading a extmig.config.ts file at runtime required dynamic compilation using ts-node/esm. Handling both CJS and ESM module formats without forcing the user to reconfigure their project was a non-trivial compatibility challenge that required careful module detection logic.

Interested in working together?

I'm always open to discussing new projects and opportunities.