A CLI tool for setting up popular SQL and NoSQL ORMs/ODMs in Node.js projects, with support for both JavaScript and TypeScript.
Part of the excli ecosystem.
Stop wiring ORM boilerplate manually. @excli/orm-init gets your database layer production-ready in seconds, whether you're starting fresh or dropping into an existing project.
Built for modern development:
- ποΈ SQL β MySQL, MariaDB, PostgreSQL, SQLite
- π NoSQL β MongoDB
- π ORMs/ODMs β Prisma, Sequelize, TypeORM, Drizzle, Mongoose
- π TypeScript & JavaScript support
- π¦ Works with npm, yarn, pnpm, and bun
- β‘ Interactive and flag-based modes
No installation needed! Just run:
npx @excli/orm-initOr install globally:
npm install -g @excli/orm-init
excli-orm-init [flags]- Node.js 20 or higher
- A running database (local or via
@excli/docker)
Run the CLI and follow the prompts:
npx @excli/orm-initYou'll be asked about:
- Language β TypeScript or JavaScript
- Database β MySQL, MariaDB, PostgreSQL, SQLite, or MongoDB
- ORM/ODM β Your preferred ORM for the chosen database
- Package Manager β npm, yarn, pnpm, or bun
Skip the prompts and pass everything directly:
# TypeScript + PostgreSQL + Prisma + pnpm
npx @excli/orm-init --ts --pnpm --postgres --prisma
# JavaScript + MongoDB + Mongoose + npm
npx @excli/orm-init --js --npm --mongodb --mongoose
# TypeScript + MySQL + TypeORM + yarn
npx @excli/orm-init --ts --yarn --mysql --typeorm
# TypeScript + PostgreSQL + Drizzle + bun
npx @excli/orm-init --ts --bun --postgres --drizzle
# JavaScript + MySQL + Sequelize + pnpm
npx @excli/orm-init --js --pnpm --mysql --sequelize
# TypeScript + SQLite + Drizzle + pnpm
npx @excli/orm-init --ts --pnpm --sqlite --drizzle| Category | Flag | Description |
|---|---|---|
| Language | --ts / --js |
TypeScript or JavaScript |
| Database | --mysql --mariadb --postgres --mongodb --sqlite |
Target database |
| ORM/ODM | --prisma --sequelize --typeorm --drizzle --mongoose |
ORM/ODM to configure |
| Package Manager | --npm --yarn --pnpm --bun |
Package manager to use |
After running the CLI, you get:
- ORM config file β pre-configured database connection
- Schema / Model file β starter schema or model for your chosen ORM
Note:
.env,.env.example, and.gitignoreare not generated. This is intentional so the tool integrates safely into both new and existing projects. Use@excli/dockerto auto-generate a complete.env, or create one manually.
| ORM / ODM | MySQL | MariaDB | PostgreSQL | SQLite | MongoDB |
|---|---|---|---|---|---|
| Prisma | β | β | β | β | β |
| Sequelize | β | β | β | β | β |
| TypeORM | β | β | β | β | β |
| Drizzle | β | β | β | β | β |
| Mongoose | β | β | β | β | β |
Incompatible combinations are caught at runtime β the CLI will prompt you to correct them.
The DATABASE_URL must use the mariadb:// prefix, not mysql://. Using the wrong prefix causes Sequelize to load the wrong driver.
# β Wrong
DATABASE_URL="mysql://root:password@localhost:3306/mydb"
# β
Correct
DATABASE_URL="mariadb://root:password@localhost:3306/mydb"During prisma migrate dev, Prisma requires a shadow database and needs CREATE DATABASE privileges. Use root credentials for local development.
# β
Use root credentials for migrations
DATABASE_URL="mysql://root:rootpassword@localhost:3306/mydb"This only applies to
prisma migrate dev. Production deployments useprisma migrate deploy, which does not require shadow database creation.
Never enable synchronize: true in production β it can drop or alter columns on startup. Always use migrations instead.
// β Development only
synchronize: true;
// β
Production
synchronize: false;Drizzle outputs SQL migrations to a drizzle/ folder. Commit this folder to version control β it serves as your migration history.
MongoDB is schemaless; existing documents are not updated when your Mongoose schema changes. Handle data migrations manually.
| Problem | Solution |
|---|---|
| Prisma shadow database error | Use root credentials in DATABASE_URL |
| Incompatible ORM + database | Check the compatibility matrix |
.env not generated |
Expected β create manually or use @excli/docker |
| TypeORM decorators failing in JS | Use TypeScript; JS decorator support is limited |
| Prisma Client not found | Run npx prisma generate after setup |
| Connection refused | Ensure your database is running before testing |
| Package | Description |
|---|---|
@excli/express |
Express app generator for JS/TS |
@excli/docker |
Docker Compose + .env generator |
@excli/orm-init |
ORM/ODM setup (this package) |
Full project setup in one command:
npx @excli/expressScaffolds a complete Express app with Docker, a running database, and a configured ORM.
Bug reports, feature requests, and pull requests are welcome. Please read the Contributing Guide before opening a PR.
ISC License β see LICENSE for details.
Noman
π§ pxycknomdictator@gmail.com
π @pxycknomdictator
Happy coding! Built with β€οΈ for developers who value productivity.