Liam ERD CLI
Quick Start
The fastest way to get started with Liam ERD is using the interactive setup command:
npx @liam-hq/cli initManual Setup
For more control over the ERD generation process, you can use the erd command directly:
Basic Usage
Generate an ERD from your schema file using the following command:
npx @liam-hq/cli erd build --input <path|url>This command processes your schema file and generates interactive ERD visualization files in the dist directory. The schema format is automatically detected (see Format Auto-Detection), but you can override it using the --format option if needed. Also, output directory can be specified by --output-dir option.
Once the ERD is generated, you can view it by serving the files using a local HTTP server:
npx serve dist/ # or your custom output directoryThe server will start and provide you with a local URL (typically http://localhost:3000) where you can view your ERD in a web browser.
You can use any hosting service of your choice to serve the generated files.
Options
--input <path|url>: Path to your schema file or URL--format <format>: (Optional) Override the auto-detected schema format--output-dir <path>: (Optional) Specify the output directory for generated files (default: "dist")
From GitHub Public Repository
You can directly specify URLs to schema files stored in public GitHub repositories. Using raw URLs allows you to generate ERDs directly from remote schema files.
npx @liam-hq/cli erd build --input https://github.com/user/repo/blob/main/examples/schema.sql --format postgresnpx @liam-hq/cli erd build --input https://raw.githubusercontent.com/user/repo/main/examples/schema.sql --format postgresOutput
The command generates a simple web application using Vite, which includes JavaScript, CSS, and HTML files, in the dist directory of your current working directory (or the directory specified by --output-dir option).
To view the generated ERD, serve the output directory using any HTTP server:
npx serve dist/ # or your custom output directorySample Projects
For sample projects and setup examples, check out our liam-erd-samples repository.