# sql2er

> Turns SQL CREATE TABLE statements or DBML into a clean Chen-model ER diagram, then lays it out and exports SVG, PNG, draw.io or HTML.

sql2er is the Agent Skill for ystemsrx's free, open-source SQL-to-ER diagram tool. It gives your agent a bundled command-line engine that draws Chen-model ER diagrams (entities, attributes and relationship diamonds) from your schema, checks the layout and exports a finished picture.

What it does
- Generates a Chen-model ER diagram from SQL CREATE TABLE statements or DBML, with attributes shown, or as a skeleton overview with attributes hidden
- Uses table, column and reference comments as readable labels, and lets your agent rename relationships ("placed by")
- Reports diagnostics (line crossings, overlaps, disconnected parts, parser warnings) and fixes them with an optimal layout, compact or evenly spread attributes, swaps, moves and rotation
- Exports SVG, PNG, draw.io, JSON or a portable HTML editor (in Chinese or English) for hand-tuning, and reviews the image before finishing
- Splits unrelated clusters into separate files when you want

How it works
- Add it with npx skills add ystemsrx/sql-to-ER. The skill runs its bundled Node.js CLI and keeps each diagram's state in one JSON file.
- Automatic overlap avoidance moves attributes and relationship diamonds, never your entity boxes, unless you turn it off.
- The same engine powers the free online tool at ystemsrx.github.io/sql-to-ER, which needs no sign-in.

Good to know
- It draws Chen (conceptual) diagrams. For logical diagrams the maker points to dbdiagram.io.
- Everything runs locally; your schema isn't uploaded.
- A community project by ystemsrx, licensed AGPL-3.0.

- Type: Skill
- Made by: ystemsrx
- Category: Databases
- Formats: Skills
- Version: 2f81c1c
- Website: https://ystemsrx.github.io/sql-to-ER/
- Source: https://github.com/ystemsrx/sql-to-er/tree/HEAD/skills/sql2er
- Page: https://pluginboard.ai/skills/sql2er

## Works with

- ChatGPT
- Claude
- Gemini
- GitHub Copilot
- Cursor
- Claude Code
- Codex
- Antigravity
- Gemini CLI
- Replit
- OpenClaw
- OpenCode
- Hermes Agent

## Install

### ChatGPT

In ChatGPT: Download the sql2er folder and zip it, then Plugins → Skills → Create → Upload from your computer. Business and Enterprise plans.

View the folder on GitHub: https://github.com/ystemsrx/sql-to-ER/tree/HEAD/skills/sql2er

### Claude

In Claude (web or desktop): Download the sql2er folder and zip the folder itself, then upload it in Customize → Skills.

View the folder on GitHub: https://github.com/ystemsrx/sql-to-ER/tree/HEAD/skills/sql2er

### Gemini

In Gemini: Download the sql2er folder, then at gemini.google.com click Customize → Skills → Create → Upload and pick the folder (or a .zip of it).

View the folder on GitHub: https://github.com/ystemsrx/sql-to-ER/tree/HEAD/skills/sql2er

### GitHub Copilot

Run in your terminal:

```shell
npx -y degit ystemsrx/sql-to-ER/skills/sql2er ~/.copilot/skills/sql2er
```

View the folder on GitHub: https://github.com/ystemsrx/sql-to-ER/tree/HEAD/skills/sql2er

### Cursor

Run in your terminal:

```shell
npx -y degit ystemsrx/sql-to-ER/skills/sql2er ~/.cursor/skills/sql2er
```

View the folder on GitHub: https://github.com/ystemsrx/sql-to-ER/tree/HEAD/skills/sql2er

### Claude Code

Run in your terminal:

```shell
npx -y degit ystemsrx/sql-to-ER/skills/sql2er ~/.claude/skills/sql2er
```

View the folder on GitHub: https://github.com/ystemsrx/sql-to-ER/tree/HEAD/skills/sql2er

### Codex

Run in your terminal:

```shell
npx -y degit ystemsrx/sql-to-ER/skills/sql2er ~/.agents/skills/sql2er
```

View the folder on GitHub: https://github.com/ystemsrx/sql-to-ER/tree/HEAD/skills/sql2er

### Antigravity

In Antigravity: Copy the sql2er folder into ~/.gemini/config/skills (Antigravity app and IDE) or ~/.gemini/antigravity-cli/skills (Antigravity CLI).

View the folder on GitHub: https://github.com/ystemsrx/sql-to-ER/tree/HEAD/skills/sql2er

### Gemini CLI

Run in your terminal:

```shell
npx -y degit ystemsrx/sql-to-ER/skills/sql2er ~/.gemini/skills/sql2er
```

View the folder on GitHub: https://github.com/ystemsrx/sql-to-ER/tree/HEAD/skills/sql2er

### Replit

Run in your terminal:

```shell
npx -y degit ystemsrx/sql-to-ER/skills/sql2er .agents/skills/sql2er
```

View the folder on GitHub: https://github.com/ystemsrx/sql-to-ER/tree/HEAD/skills/sql2er

### OpenClaw

Run in your terminal:

```shell
npx -y degit ystemsrx/sql-to-ER/skills/sql2er ~/.openclaw/skills/sql2er
```

View the folder on GitHub: https://github.com/ystemsrx/sql-to-ER/tree/HEAD/skills/sql2er

### OpenCode

Run in your terminal:

```shell
npx -y degit ystemsrx/sql-to-ER/skills/sql2er ~/.config/opencode/skills/sql2er
```

View the folder on GitHub: https://github.com/ystemsrx/sql-to-ER/tree/HEAD/skills/sql2er

### Hermes Agent

Run in your terminal:

```shell
npx -y degit ystemsrx/sql-to-ER/skills/sql2er ~/.hermes/skills/sql2er
```

View the folder on GitHub: https://github.com/ystemsrx/sql-to-ER/tree/HEAD/skills/sql2er

---
From Pluginboard (https://pluginboard.ai).
