erdflow
v0.1.0
Published
Local-first database schema IDE — detect Prisma, DBML, or SQL schemas and open an interactive ERD in the browser
Maintainers
Readme
erdflow
Local-first database schema IDE — detect your project's schema, parse it, and open an interactive ERD in the browser.
npx erdflowWhat it does
- Detects your schema file (Prisma → DBML → SQL)
- Parses it into a universal schema model
- Starts a local server at
http://127.0.0.1:4317 - Opens the browser with an interactive entity-relationship diagram
Example output:
✓ Detected Prisma
✓ prisma/schema.prisma
✓ 12 entities · 2 enums · 11 relations · 3 indexes
→ http://127.0.0.1:4317/
Watching schema files for changes...Quick start
From any project with a Prisma, DBML, or SQL schema:
npx erdflowOr install globally:
npm install -g erdflow
erdflowUsage
Auto-detect (default)
Detection order: prisma/schema.prisma → *.dbml → *.sql
Explicit schema path
npx erdflow --prisma ./prisma/schema.prisma
npx erdflow --dbml ./database/schema.dbmlOptions
| Flag | Description |
| --- | --- |
| --port <number> | Server port (default 4317) |
| --no-open | Skip auto-opening the browser |
| --no-watch | Disable file watching |
| --prisma <path> | Use a specific Prisma schema file |
| --dbml <path> | Use a specific DBML file |
Examples:
npx erdflow --port 5000
npx erdflow --no-open --dbml ./docs/schema.dbml
npx erdflow --no-watch --prisma ./custom/schema.prismaSupported formats
| Format | Location | Notes |
| --- | --- | --- |
| Prisma | prisma/schema.prisma | Models, relations, enums, indexes |
| DBML | *.dbml | Tables, relationships, enums |
| SQL | *.sql | PostgreSQL, MySQL, SQLite |
Live updates
With watch enabled (default), editing your schema file re-parses and pushes updates to the browser over WebSocket — no manual refresh needed.
When a parse error occurs during watch, the CLI prints the error and the browser shows an alert while keeping the last valid schema.
Requirements
- Node.js ≥ 20
Related packages
| Package | Description |
| --- | --- |
| @erdflow/core | Universal schema types and validation |
| @erdflow/web | React visualizer (embed in your app) |
| @erdflow/layout | ELK.js graph layout engine |
Links
License
MIT © erdFlow
