Command line
How to export, import, compare, merge, check and work with databases without a window, using the same executable (relio). It fits well in build scripts and CI.
The workflow with Git is in Work together and merge with Git in Quick start.
Getting started
- To run it as plain
relio, turn on "Use relio from the command line" on the last page of the installer (off by default). It adds the install folder to your own user PATH (no administrator rights needed), and uninstalling removes just that entry. It takes effect in newly opened terminals. - If you left it off, or use the portable version, use Copy command-line path in Help › About Relio or in the Tools › Command line & AI connection… window to copy the full path of the executable you are running, already in quotes, and paste it in place of
relio. - To see whether it is on your PATH now, check "Use relio from the command line" (On or Off) in the Tools › Command line & AI connection… window. If it is off, run the installer again and select the third box on its last page, "Use relio from the command line". Terminals that were already open must be reopened.
- See the options with
relio --help,relio export <kind> --help,relio import --help,relio diff --help,relio merge --help,relio lint --help,relio db <command> --helpandrelio mcp --help. - Output follows the app language; change it with the
RELIO_LANGenvironment variable (ko·en·ja·zh).
What differs by operating system:
| Item | Windows |
|---|---|
| Installed executable (default location) | %LOCALAPPDATA%\Relio\relio.exe |
| Portable version | relio.exe in the folder you unzipped |
| "Use relio from the command line" | Adds the install folder to your user PATH (uninstalling removes just that entry) |
| Putting the portable version on PATH | The portable (zip) version does not change PATH; add its folder to PATH yourself |
relio export ddl --input model.erm --output model.sql --db-version 17
relio export excel --input model.erm --output model.xlsx --template default_en
relio export dbml --input model.erm --output model.dbml
relio export mermaid --input model.erm --output - --category Sales
relio export json --input model.erm --output model.json --include images,history
relio export java --input model.erm --output-dir src --style jpa
relio import auto --input schema.sql --output schema.erm
relio diff old.erm new.erm --format markdown --output diff.md --exit-code
relio merge base.erm mine.erm theirs.erm -o merged.erm --report -
relio lint model.erm --format markdown --fail-on error
relio db test --db PostgreSQL --server localhost --database app --user dev --password-env PGPASSWORD
relio db import --db MySQL --database shop --user dev --output shop.ermrelio export
relio export <kind> --input <model.erm> --output <output>
- Kinds —
ddl·image·html·excel·testdata·dictionary·translation·java·dbml·mermaid·markdown·json. - Without options, the last export settings saved in the
.ermare used. - The options for each kind are in the "Options by kind" table below.
--encoding— UTF-8 (default) · UTF-8 BOM · UTF-16LE · UTF-16BE · EUC-KR · CP949 (MS949) · Shift_JIS · GBK. An unknown name is an error (it is never silently replaced with UTF-8).- Standard output —
--output -writes to standard output for the text kinds (ddl·dictionary·translation·dbml·mermaid·markdown·json). relio export ddlprints one line to standard error when there are design check errors (problems that make the DDL fail when run).
Options by kind
Every kind takes --input <model.erm>. When you do not pass an on/off option (--no-…), the last setting saved in the .erm is used.
| Kind | Output | Other options |
|---|---|---|
ddl | --output | --db-product · --db-version · --environment (tablespace environment) · --category · --encoding · --line-feed · --comment on|off (database comments) · --inline-table-comment on|off · --inline-column-comment on|off · --comment-value description|logical|logical-description · --comment-replace-line-feed <text> · --no-comment-replace-line-feed · --set <item>=true|false (each drop or create statement, can repeat) · --if-not-exists · --omit-schema · --native-types (boolean on Oracle 23 or later) · --no-sqlblanklines · --drop-tablespaces |
image | --output (png, jpg, bmp or svg by extension) | --with-category · --no-with-category (an image per category) · --category-dir |
html | --output-dir | --no-image · --no-category-image |
excel | --output (.xlsx) | --template default_ko|default_en|default_ja|default_zh or --template-file · --no-image · --logical-sheet-name · --physical-sheet-name · --category |
dictionary | --output (CSV) | --no-bom |
translation | --output | |
testdata | --output-dir | --name <test data name> (required, can repeat) · --format sql|dbunit-xml|dbunit-flat-xml|dbunit-excel · --encoding |
java | --output-dir | --package · --suffix · --hibernate · --no-hibernate · --style plain|jpa · --jpa-namespace jakarta|javax · --jpa-legacy-date · --jpa-collections · --jpa-fk-as-value · --encoding |
dbml | --output | --no-partials (writes column groups out in full) · --no-notes (leaves out notes) |
mermaid | --output | --no-alias (no logical-name aliases) · --fence (mermaid code block) · --split-categories (one <name>-<category>.mmd per category) |
markdown | --output | --no-diagram · --no-views · --tables-only · --by-category |
json | --output | --include images,history · --exclude layout · --timestamp · --schema-version · --print-schema (prints the JSON Schema to standard output) |
dbml · mermaid · markdown · json also take --category <name> (only that category) · --encoding · --line-feed lf|crlf (default lf).
Output path rules
- An existing output file is overwritten without asking, and a missing output folder is created.
- If the output path is the same as the input
.erm, nothing is written and the command fails. - Without
--output, the path saved in the.ermis used — but only when it points inside the folder of the.erm. An absolute path outside it, another drive, a network path or..fails with a request to use--output(so an.ermfrom someone else cannot overwrite other files). - If the extension does not match the kind, a warning is shown and the file is written anyway.
relio import
relio import <format> --input <file|-> --output <new.erm>
| Option | Description |
|---|---|
| format | auto · ddl · dbml · mermaid · markdown |
--input | A file, or - (standard input) |
--output | A new .erm. An existing one is overwritten only with --force. |
--dialect | SQL dialect |
--db | Database of the new document |
--comment auto|description|logical | Whether comments go into the logical name or the description |
--name-case asis|db | Keep unquoted names as they are, or convert them following the database's rules |
--encoding | Input encoding |
--strict | Nothing is created if there are warnings. |
Warnings go to standard error as <input>:<line>:<column>: warning: <message>. Import and other formats
relio diff
relio diff A.erm B.erm
relio diff --rev REV file.erm # that version in the Git repository ↔ the disk
relio diff --rev REV1 --rev REV2 file.erm| Option | Description |
|---|---|
--format markdown|json|csv|sql | sql is migration SQL that changes a database from A's structure to B's (same as Generate migration SQL in the comparison view) |
--group-by table|kind | Groups Markdown by table or by type (default table). |
--output | Output file; - for standard output |
--include structure,docs,layout,settings | What to compare |
--lang | Output language |
--exit-code | Exit code 4 when there are differences |
Nothing is written to the repository and no network is used. It also works as a Git diff tool: git difftool -x "relio diff" -- model.erm. Git and merging › Comparison view
relio merge
relio merge base.erm current.erm incoming.erm -o result.erm
- The result never contains conflict markers (it is always a valid
.erm). When conflicts remain, the value from the--on-conflict ours|theirsside (defaultours) is used and the command ends with exit code 5. --keep-numbers ours|theirs— The side whose numbers are kept.--report <path|->·--report-format markdown|json— Report of conflicts and automatic items.--label-base·--label-ours·--label-theirs— Labels in the report.--no-sort— Turns off sorted saving.--lang— Output language.-omay be the same path as the current input. Nothing is written to the repository.
Git merge driver
Add one line to the repository's .gitattributes and register the driver in the Git configuration, and git merge and git rebase merge .erm files at the model level. When conflicts remain (exit code 5), Git leaves the file conflicted; open it in Relio and finish with File › Compare and merge › Resolve Git merge conflict….
# .gitattributes
*.erm text eol=lf merge=relio
git config merge.relio.name "Relio model merge"
# Windows (Git Bash) — full path of the installed relio.exe
git config merge.relio.driver '"C:/Users/<user>/AppData/Local/Relio/relio.exe" merge %O %A %B -o %A --label-base %S --label-ours %X --label-theirs %Y'
# when relio is on the PATH
git config merge.relio.driver "relio merge %O %A %B -o %A --label-base %S --label-ours %X --label-theirs %Y"- If you did not turn on "Use relio from the command line" when installing,
reliois not on your PATH, so on Windows write the full path ofrelio.exewith/and wrap it in quotes (the first example above). Copy it, quotes included, with Copy command-line path in Help › About Relio, then change\to/. text eol=lfin.gitattributeskeeps line endings inside commits as LF. In teams that mix ERMaster (CRLF) and Relio (LF), this stops the whole file from showing as changed because of line endings.--label-base %Slabels the base in the report with the common ancestor's name instead of Git's temporary file name.- The driver is Git configuration and does not travel with the repository. Everyone who merges, including teammates who use ERMaster, must register it on their own PC. Without it,
git mergemerges by line and leaves conflict markers.
Warning
If the driver is registered but Git cannot find it (wrong path — a line such as relio: command not found in the output), Git marks the file conflicted but leaves only your side, with no conflict markers. Running git add as is would drop the incoming changes. After registering, make sure that running the path from git config --get merge.relio.driver as "…/relio.exe" --version prints a version number, and that git check-attr merge -- model.erm shows merge: relio.
relio lint
relio lint model.erm
| Option | Description |
|---|---|
--format text|markdown|json | Output format |
--output | Output file (default -, standard output) |
--fail-on error|warning|info|none | Exit code 6 when there are findings at or above this severity (default warning) |
--disable · --only | Comma-separated rule IDs (for example pk-missing, fk-no-index, reserved-word). Every rule ID is in the table in Design check and suggestions › Rules. |
--db-version | Database version to check against |
--lang | Output language |
Ignores made in the app are not applied, so the result is the same on every PC; turn rules off with --disable. Design check and suggestions
relio db
| Command | What it does |
|---|---|
relio db test | Connection test |
relio db export | Export to a database |
relio db import | Import from a database |
relio db roundtrip | Round-trip test (exit code 4 when there are differences) |
Pass the password with --password-env <environment variable>. Never write the password on the command line itself. Databases
relio mcp
A local MCP server that your AI tool (Claude Code, Claude Desktop, Cursor and others) starts and uses. You do not run it yourself; you register it with your AI tool once.
claude mcp add --scope user relio -- relio mcp
claude mcp list
claude mcp remove relio --scope user--scopedecides in which folders Relio is connected when you start your AI tool —user(every folder, recommended),local(only this project folder) orproject(with your team, by committing.mcp.json). It does not change which files the AI can see.- Its options are
--root <folder>(repeatable),--anonymizeand--read-only; runrelio mcp --helpfor registration examples. Whenreliois not on your PATH, it also shows the registration line for that executable. - In the Tools › Command line & AI connection… window you can choose a scope and copy the lines to register and remove Relio.
Registration scopes, Claude Desktop and Cursor settings, which files the AI can see and how to use it safely are in Working with AI.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success (including warnings) — with diff --exit-code, no differences |
| 1 | Input or option error (import: no tables found, or warnings with --strict) |
| 2 | Output write failure (import: an existing .erm without --force) |
| 3 | Cannot convert to this database |
| 4 | Differences found (db roundtrip, diff --exit-code) |
| 5 | Merge conflicts remain (merge) |
| 6 | Findings at or above the --fail-on level (lint) |
Using it in CI
- Check —
relio lint model.erm --fail-on errorfails the build when there are errors. - Generate DDL —
relio export ddl --input model.erm --output model.sql --db-version 17. - Review changes —
relio diff --rev main model.erm --format markdown --output diff.mdrecords what changed as a document. - Migration SQL —
relio diff before.erm after.erm --format sql --output alter.sql.