ERD Designer CLI
SkillDatabases & dataCreate and edit ERD Designer .erd files (database entity-relationship diagrams). Use when the user asks to design database tables, add or modify tables, columns, relations, indexes or memos in a .erd file, to export DDL from a .erd file, or to check whether a .erd design matches another revision or a live database.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the ERD Designer CLI skill
What this skill tells your AI
The instructions your AI receives, as published by kajitiluna/erd-designer in agent-plugin/skills/erd-designer/SKILL.md and read by ahel’s review.
Edit .erd files directly with the bundled CLI. No MCP server, VSCode or running app is required.
Requires Node.js 22+.
The CLI ships with this skill at scripts/erd-agent.cjs, relative to the directory containing
this SKILL.md. This skill is self-contained (Agent Skills format), so it works from any agent
that supports skills — e.g. Claude Code and GitHub Copilot CLI. In the examples below, $CLI
stands for the resolved path:
CLI=<directory of this SKILL.md>/scripts/erd-agent.cjs
Workflow
- Discover tools (names and one-line summaries):
node $CLI list-tools - Inspect a tool before first use (full description + JSON schema of its arguments):
node $CLI describe <tool-name> - Run a tool against a
.erdfile:
The result is printed as JSON on stdout. Mutating tools save the file in place.node $CLI run <tool-name> --file <path/to/file.erd> --args '<json>' - Validate a
.erdfile (e.g. after external changes):node $CLI validate --file <path/to/file.erd> - Check the design against reality (optional, no MCP tools involved — see below):
node $CLI erd-diff --file <path/to/file.erd> --from <path/to/other-revision.erd> node $CLI db-diff --file <path/to/file.erd> # needs ERD_DB_URL or --dsn, and pg/mysql2 installed
Rules
- Do NOT edit
.erdJSON by hand; always go through the CLI so referential integrity (column/share/relation IDs) and the canvas layout stay consistent. - Omit
documentIdandfilePathin--args; the CLI injects them from--fileautomatically. - Only load the schemas you need via
describe; do not dump all schemas at once. - Files are saved as 4-space-indented JSON, the same format the ERD Designer app writes.
- The VSCode extension reflects CLI edits automatically while the file is open; no reload is needed. The browser app (IndexedDB) does not — re-import the file after CLI edits. The Google Drive app reflects CLI edits automatically too, but only when the user has enabled its "Sync Google Drive" toggle (see below).
- Create a brand-new
.erdfile withrun create-document, pointing--fileat a path that does not exist yet.databaseTypeis required and cannot be changed afterwards, so confirm the target database with the user first. The tool never overwrites an existing file.
Typical recipes
- Start a new diagram:
run create-document --file <path/to/new.erd> --args '{"databaseType":"postgres"}'(postgres,mysql,mariadb,ms_sqlserver,sqlite,bigqueryorsnowflake).documentNamedefaults to the file name without.erd. The response carries thedocumentIdfor the tools that follow. - Add a table with columns:
run add-table, thenrun add-columns-to-tablewith the returnedtableId. - Relate two tables: look up ids via
run list-tables, thenrun create-relation. - Review a design:
run list-tables(summaries) orrun find-table(full detail). - Generate SQL:
run export-ddl. - Review what changed since a base revision:
erd-diff --file <current.erd> --from <base.erd> --format markdown(see below; not anrun <tool-name>call, and not a source of truth fordocumentId— uselist-documents/find-document-by-filepathfor that). - Check drift against a live database:
db-diff --file <file.erd>(ERD_DB_URLor--dsnrequired;pg/mysql2must be installed in the working directory — not bundled).
Schema verification (erd-diff / db-diff / migrate-ddl)
These are separate top-level commands, not agent tools — they don't go through run, don't take
--args, and don't touch documentId. They compare .erd schemas against another revision or a
live database rather than editing a diagram.
node $CLI erd-diff --file <path.erd> --from <path.erd> [--format text|json|markdown]— schema-level diff between two.erdrevisions. No database connection needed.node $CLI db-diff --file <path.erd>— checks the design against a live PostgreSQL/MySQL/MariaDB database. Read-only. RequiresERD_DB_URL(preferred) or--dsn <url>, and thepgormysql2driver installed in the current working directory (not bundled with this skill).node $CLI migrate-ddl --file <path.erd> [--from <path.erd> | --dsn <url>] [--out <path.sql>]— draftsALTERstatements to close the gap. Never applies them; review the output before running it.
Use erd-diff/db-diff when the user asks "what changed" or "is this in sync with the database" —
don't try to answer that by reading the raw JSON.
.erd format (background only)
A .erd file is a single JSON document containing tableViewModels (tables + canvas
positions), columnModels / columnShareModels (columns; shares hold the type definition
and can be reused by multiple columns), relationViewModels, memos and database settings.
IDs cross-reference between these arrays, which is why manual edits are unsafe.
Google Drive / browser users
- Files stored in Google Drive can be edited locally through Google Drive for Desktop:
point
--fileat the synced local path. Tell the user to enable "Sync Google Drive" in the gear menu: with it on, they can keep the ERD Designer tab open while you edit, and your changes appear on the canvas within about 10 seconds. If the toggle is left off, fall back to the old workflow — tell the user to close the tab before you edit, and to reopen the file afterwards. - The browser app (IndexedDB) is not reachable from the CLI; export the
.erdfile first, edit it, then import it back.
Signals
- GitHub stars
- 21
- Forks
- 6
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Gateway key
erd-designer- Source
- github.com/kajitiluna/erd-designer