gen-erd-cli
v2.0.0
Published
A CLI tool that generates beautiful ERD diagrams using database connection configs. Supports PostgreSQL, MySQL, SQL Server, SQLite, and Oracle.
Maintainers
Readme
gen-erd-cli
A CLI tool that generates beautiful ERD diagrams using database connection configurations.
Features
- Interactive Terminal User Interface (TUI)
- Web-based ERD visualization with automatic browser opening
- Support for connection string input
- Support for individual database field configuration
- Support for multiple database types:
- PostgreSQL
- MySQL
- SQL Server
- SQLite
- Oracle
Installation
npm install -g gen-erd-cli
gen-erd-cli initOr use with npx:
npx gen-erd-cli initUsage
Run the CLI tool:
gen-erd-cli initThis will open a beautiful interactive interface with ASCII art banners and styled boxes. After connecting to your database, the tool will automatically open a web browser to display the generated ERD diagram.
1. Connection String Option
Choose "1. Connection String" to provide a database connection string directly.
Supported formats:
- PostgreSQL:
postgresql://username:password@localhost:5432/database_name - MySQL:
mysql://username:password@localhost:3306/database_name - SQL Server:
mssql://username:password@localhost:1433/database_name - SQLite:
sqlite://path/to/database.sqlite - Oracle:
oracle://username:password@localhost:1521/service_name
2. Individual Fields Option
Choose "2. Individual Fields" to configure database connection step by step:
- Host: Database host (defaults to localhost)
- Port: Database port (auto-suggests based on database type)
- Username: Database username
- Password: Database password (hidden input)
- Database: Database name
Dependencies
inquirer: Interactive command line interfacechalk: Terminal string stylingcommander: CLI arg parsingexpress: Web server for ERD visualizationopen: Automatic browser opening- Database drivers:
pg: PostgreSQL clientmysql2: MySQL clientmssql: SQL Server clientsqlite3: SQLite clientoracledb: Oracle client
How it Works
- Run
gen-erd-cli initto start the interactive CLI - Choose your preferred connection method (connection string or individual fields)
- Select your database type from the supported options
- Provide connection details
- The tool automatically opens a web browser displaying your ERD diagram
- The ERD visualization shows tables, fields, relationships, and data types
Recent Updates
- v2.0.0: Added support for MySQL, SQL Server, SQLite, and Oracle
- v2.0.0: Introduced web-based ERD visualization with automatic browser opening
- v2.0.0: Enhanced interactive CLI with better error handling and user experience
License
MIT
