< We're launched Liam ERD!

Learn More

Liam ERD CLI

Quick Start

The fastest way to get started with Liam ERD is using the interactive setup command:

npx @liam-hq/cli init

Manual 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.

Once the ERD is generated, you can view it by serving the files using a local HTTP server:

npx http-server dist

The server will start and provide you with a local URL (typically http://localhost:8080) 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

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 postgresql
npx @liam-hq/cli erd build --input https://raw.githubusercontent.com/user/repo/main/examples/schema.sql --format postgresql

Output

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.

To view the generated ERD, serve the dist directory using any HTTP server:

npx http-server dist

Sample Projects

For sample projects and setup examples, check out our liam-erd-samples repository.

On this page