https://github.com/nestorrente/erdiagram-cli
ERDiagram library CLI command
https://github.com/nestorrente/erdiagram-cli
diagram entity erdiagram generation java javascript js mysql nomnoml oracle oracledb plantuml postgres postgresql relationship sql sqlite sqlserver ts typescript
Last synced: 14 days ago
JSON representation
ERDiagram library CLI command
- Host: GitHub
- URL: https://github.com/nestorrente/erdiagram-cli
- Owner: nestorrente
- License: mit
- Created: 2021-02-01T19:04:02.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-14T00:33:46.000Z (over 2 years ago)
- Last Synced: 2025-02-18T01:38:09.596Z (2 months ago)
- Topics: diagram, entity, erdiagram, generation, java, javascript, js, mysql, nomnoml, oracle, oracledb, plantuml, postgres, postgresql, relationship, sql, sqlite, sqlserver, ts, typescript
- Language: TypeScript
- Homepage:
- Size: 7 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ERDiagram CLI
This application is the CLI version of the [ERDiagram library](https://github.com/nestorrente/erdiagram).
Please, refer to the library docs for further information about _ERDiagram_ features.
## Table of contents
* [Installation](#installation)
* [Usage](#usage)
+ [Generate command](#generate-command)
+ [Create config command](#create-config-command)## Installation
Global installation:
```shell
npm install -g @nestorrente/erdiagram-cli
```You can also install it for a single project:
```shell
npm install --save-dev @nestorrente/erdiagram-cli
```## Usage
```shell
erdiagram [options]
```Commands:
* `erdiagram generate `: generate the code of an entity-relationship model.
* `erdiagram create-config`: create a config file with the default values.Options:
* `--help`, `-h`: Show help.
* `--version`, `-v` Show version number.### Generate command
The `generate` command generates the output code from an input entity-relationship diagram written using the _ERDiagram_
language.Usage:
```shell
erdiagram generate -f
```Required options:
* `--format `, `-f `: output format. See below the full list of supported formats.Additional options:
* `--config `, `-c `: config file path. If not specified, uses `erdiagram.config.json` (if exists).
* `--output `, `-o `: output file path. Prints to standard output if not specified.Supported output formats:
* Database creation script:
* `mysql`
* `oracle`
* `postgresql`, `postgres`
* `sqlite`
* `sqlserver`, `mssql`, `mssqlserver`
* OOP classes/interfaces:
* `java`
* `typescript`, `ts`
* Diagram:
* `nomnoml`
* `plantuml`### Create config command
The `create-config` commands generates a config file with the default values.
By default, if the file already exists, it asks for confirmation, but this behaviour can be customized using the
`--override` and `--preserve` options.```shell
erdiagram create-config
```Additional:
* `--config `, `-c `: config file path. If not specified, uses `erdiagram.config.json` if exists.
* `--overwrite`, `-w`: overwrite existing config file without asking.
* `--preserve`, `-p`: preserve existing config file without asking.