hviz
v1.3.8
Published
CLI tool for visualizing your database schema
Maintainers
Readme
hviz
CLI tool for visualizing your database schema
Transform your database schema into beautiful, interactive ERDs in seconds.
Website · Documentation · Report Bug
🚀 Quick Start
# Run with interactive prompts
bunx hviz
# Or with npx
npx hvizThat's it! hviz will guide you through the rest with interactive prompts.
📦 Installation
Add hviz to your project as a dev dependency:
# npm
npm install -D hviz
# yarn
yarn add -D hviz
# pnpm
pnpm install -D hviz
# bun
bun install -D hviz🎯 Usage
Interactive Mode (Recommended)
Simply run hviz and follow the prompts:
bunx hvizThe CLI will ask you:
- Which ORM you're using (Prisma, Drizzle, or TypeORM)
- Path to your schema file (with smart suggestions)
Then it will:
- Parse your schema
- Generate an interactive ERD
- Start a local server
- Open the visualization in your browser
Non-Interactive Mode
Specify all options directly:
# Prisma
bunx hviz --type prisma --schema prisma/schema.prisma
# Drizzle
bunx hviz --type drizzle --schema drizzle/schema.ts
# TypeORM
bunx hviz --type typeorm --schema typeorm/schema.ts
# Custom port
bunx hviz --type prisma --schema prisma/schema.prisma --port 4000
# PostgreSQL
bunx hviz --type postgres --schema schema.sql
# MySQL
bunx hviz --type mysql --schema schema.sql
# SQLite
bunx hviz --type sqlite --schema schema.sqlAdd to package.json Scripts
For quick access, add hviz to your package.json scripts:
{
"scripts": {
// Prisma
"visualize": "hviz --type prisma --schema prisma/schema.prisma --port 4000",
// Drizzle
"visualize": "hviz --type drizzle --schema drizzle/schema.ts --port 4000",
// TypeORM
"visualize": "hviz --type typeorm --schema typeorm/schema.ts --port 4000"
}
}Then run:
bun run visualize🛠️ CLI Options
| Option | Alias | Description | Default |
| ----------- | ----- | ----------------------------------- | ------------------ |
| --type | -t | ORM type (prisma, drizzle, typeorm) | Interactive prompt |
| --schema | -s | Path to schema file | Interactive prompt |
| --port | -p | Port to run server on | 3000 |
| --version | -v | Show version | - |
🗄️ Supported ORMs & Databases
ORMs
- ✅ Prisma
- ✅ Drizzle (PostgreSQL, MySQL, SQLite)
- ✅ TypeORM
Raw SQL Files
- ✅ PostgreSQL (.sql files)
- ✅ MySQL (.sql files)
- ✅ SQLite (.sql files)
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📄 License
MIT ©
Built with ❤️ for developers who love great tools
