Skip to content

CLI help documentation

To view the CLI help documentation, run:

erdantic --help
# or
python -m erdantic --help
 Usage: erdantic [OPTIONS] MODELS_OR_MODULES...                                                                                                                                      

 Draw entity relationship diagrams (ERDs) for Python data model classes. Diagrams are rendered using the Graphviz library. Currently supported data modeling frameworks are          
 Pydantic, attrs, and standard library dataclasses.                                                                                                                                  

╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    models_or_modules      MODELS_OR_MODULES...  One or more full dotted paths for data model classes, or modules containing data model classes, to include in diagram, e.g.,    │
│                                                   'erdantic.examples.pydantic.Party'. Only the root models of composition trees are needed; erdantic will traverse the            │
│                                                   composition tree to find component classes.                                                                                     │
│                                                   [default: None]                                                                                                                 │
│                                                   [required]                                                                                                                      │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *  --out                     -o      PATH                                      Output filename. [default: None] [required]                                                        │
│    --terminal-model          -t      TEXT                                      Full dotted paths for data model classes to set as terminal nodes in the diagram. erdantic will    │
│                                                                                stop searching for component classes when it reaches these models. Repeat this option if more than │
│                                                                                one.                                                                                               │
│    --terminus                        TEXT                                      Deprecated. Use --terminal-model instead.                                                          │
│    --limit-search-models-to  -m      [pydantic|pydantic_v1|attrs|dataclasses]  Plugin identifiers. If any are specified, when searching a module, limit data model classes to     │
│                                                                                those ones. Repeat this option if more than one. Defaults to None which will find data model       │
│                                                                                classes matching any active plugin.                                                                │
│    --dot                     -d                                                Print out Graphviz DOT language representation for generated graph to console instead of rendering │
│                                                                                an image. The --out option will be ignored.                                                        │
│    --no-overwrite                                                              Prevent overwriting an existing file.                                                              │
│    --quiet                   -q      INTEGER                                   Use to decrease log verbosity. Can use multiple times.                                             │
│    --verbose                 -v      INTEGER                                   Use to increase log verbosity. Can use multiple times.                                             │
│    --version                                                                   Show erdantic version and exit.                                                                    │
│    --install-completion                                                        Install completion for the current shell.                                                          │
│    --show-completion                                                           Show completion for the current shell, to copy it or customize the installation.                   │
│    --help                                                                      Show this message and exit.                                                                        │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯