orm2erd
You already built the app — your ORM models are the schema. orm2erd reads them and generates an ERD (Entity-Relationship Diagram) for you, instead of you drawing and maintaining one by hand.
Status: early development — see the tables below for what's supported today vs. planned.
Table of Contents
- What it does
- Supported ORMs
- Output formats
- Requirements
- Installation
- Usage
- Keeping the ERD in sync (CI)
- Flags
- Why
- Contributing
- License
What it does
orm2erd scans your project, figures out which ORM you're using, and turns your existing models/schema into diagram code — Mermaid, DBML, PlantUML, D2, and more. No manual diagramming, no drift between your code and your docs.
detect ORM → resolve entry point(s) → parse/introspect → normalize to IR → emit diagram code(s) → write file(s)Supported ORMs
| | ORM | Status | | --- | --- | --- | | <img src="./.github/assets/prisma.svg" width="16" height="16" alt="Prisma Icon" style="vertical-align:middle;" | Prisma | ✅ Supported | | <img src="./.github/assets/sequelize.svg" width="16" height="16" alt="Sequelize Icon" style="vertical-align:middle;" | Sequelize | ✅ Supported | | <img src="./.github/assets/mongoose.svg" width="16" height="16" alt="Mongoose Icon" style="vertical-align:middle;" | Mongoose | ✅ Supported | | <img src="./.github/assets/typeorm.svg" width="16" height="16" alt="TypeORM Icon" style="vertical-align:middle;" | TypeORM | ✅ Supported | | <img src="./.github/assets/drizzle.svg" width="16" height="16" alt="Drizzle Icon" style="vertical-align:middle;" | Drizzle | ✅ Supported | | | MikroORM | 🚧 Planned | <!-- | | BookShelf.js | 🚧 Planned | -- <!-- | | Waterline | 🚧 Planned | -- <!-- | | Objection.js | 🚧 Planned | --
Output formats
| | Format | Status | | --- | --- | --- | | <img src="./.github/assets/mermaid.svg" width="16" height="16" alt="Mermaid Icon" style="vertical-align:middle;" | Mermaid | ✅ Supported | | <img src="./.github/assets/dbml.svg" width="16" height="16" alt="DBML Icon" style="vertical-align:middle;" | DBML | ✅ Supported | | <img src="./.github/assets/plantuml.svg" width="16" height="16" alt="PlantUML Icon" style="vertical-align:middle;" | PlantUML | ✅ Supported | | <img src="./.github/assets/d2.svg" width="16" height="16" alt="D2 Icon" style="vertical-align:middle;" | D2 | ✅ Supported | | <img src="./.github/assets/nomnoml.svg" width="16" height="16" alt="nomnoml Icon" style="vertical-align:middle;" | nomnoml | ✅ Supported | | <img src="./.github/assets/quickdbd.svg" width="16" height="16" alt="QuickDBD Icon" style="vertical-align:middle;" | QuickDBD | ✅ Supported | | <img src="./.github/assets/graphvizdot.svg" width="16" height="16" alt="Graphviz DOT Icon" style="vertical-align:middle;" | Graphviz DOT | ✅ Supported | | | Structurizr DSL | 🚧 Planned | | | Pikchr | 🚧 Planned |
Requirements
Node.js = 24.
Installation
Run without installing (recommended — always gets the latest version):
npx orm2erd
# or npx orm2erd@latest to bypass a locally cached version
pnpm dlx orm2erd
# or pnpm dlx orm2erd@latest
bunx orm2erd
# or bunx orm2erd@latest