Auto-generate MongoDB migration scripts by detecting changes in your Mongoose schemas.
Mongeese CLI is a CLI tool that tracks your Mongoose models, detects schema changes, and generates versioned MongoDB migration files — just like TypeORM or Prisma, but built for MongoDB’s schemaless world.
Install globally with npm:
npm install -g mongeese-cliOr with yarn:
yarn global add mongeese-cliOr use npx (no install required):
npx mongeese-cli <command>npx mongeese-cli init # Sets up migration tracking
npx mongeese-cli diff # Detects schema changes
npx mongeese-cli generate # Generates a migration file
npx mongeese-cli apply # Runs the migrationAfter installation, use the CLI:
mongeese-cli init
mongeese-cli generate --name add_users_collection
mongeese-cli migrate up
mongeese-cli migrate down --target 20240501_120000_add_users_collection
mongeese-cli migrate status✅ Eliminate manual migration scripts
🛡 Prevent silent schema drift in production
🚀 Speed up development in NestJS / Mongoose projects
🔁 Track changes and roll them back if needed
🧩 CI/CD and GitOps friendly
-
📸 Snapshot Mongoose schemas on every change
-
🧬 Detect added/removed/modified fields
-
🛠 Generate $set, $unset, and rollback scripts
-
🗂 Organize migrations by timestamp
Node.js >= 18
Mongoose >= 7
Works great with NestJS, but framework-agnostic
We welcome issues, feedback, and PRs.
See CONTRIBUTING.md for how to get started.