LinuxCommandLibrary

plantuml

Generate diagrams from textual descriptions

TLDR

Render diagrams to default format (PNG)

$ plantuml [diagram1.puml] [diagram2.puml]
copy

Render a diagram in given format (e.g. png, pdf, svg, txt)
$ plantuml -t [format] [diagram.puml]
copy

Render all diagrams of a directory
$ plantuml [path/to/diagrams]
copy

Render a diagram to the output directory
$ plantuml -o [path/to/output] [diagram.puml]
copy

Render a diagram without storing the diagram's source code (Note: It's stored by default when the -nometadata option isn't specified)
$ plantuml -nometadata [diagram.png] > [diagram.puml]
copy

Retrieve source from a plantuml diagram's metadata
$ plantuml -metadata [diagram.png] > [diagram.puml]
copy

Render a diagram with the configuration file
$ plantuml -config [config.cfg] [diagram.puml]
copy

Display help
$ plantuml -help
copy

SYNOPSIS

plantuml [options] file1 [file2] [file3] ...

PARAMETERS

-help
    Shows usage help message and exits.

-version
    Displays the version of PlantUML and exits.

-verbose
    Enables verbose output during processing.

-quiet
    Suppresses normal output.

-failfast
    Exit after first error.

-tsvg
    Uses textual SVG output (useful for very large diagrams).

-charset
    Sets the character set for input files. Example: UTF-8

-config
    Specifies a configuration file. Useful to set options such as the GRAPHVIZ_DOT path.

-graphvizdot
    Set the path to the Graphviz dot executable. This is equivalent to setting the GRAPHVIZ_DOT environment variable.

-o
    Specifies the output directory. If not provided, the output image(s) are created in the same directory as the input file(s).

-t
    Sets the output format. Supported formats include png, svg, pdf, eps, txt, atxt, utxt, html. Default is png.


    Specifies the PlantUML input file. Multiple files can be specified to generate diagrams for each.

DESCRIPTION

The `plantuml` command is a command-line tool used to generate diagrams from textual descriptions written in the PlantUML language. PlantUML supports a wide variety of diagram types, including sequence diagrams, class diagrams, use case diagrams, activity diagrams, component diagrams, deployment diagrams, state diagrams, object diagrams, timing diagrams, network diagrams, and wireframe graphical interface descriptions. The `plantuml` command takes a PlantUML file as input and produces an image file (e.g., PNG, SVG, PDF) representing the diagram. It simplifies diagram creation by allowing users to define diagrams using simple, human-readable text. The command handles the rendering process using Graphviz (dot), and offers various options for customizing the output format, image size, and other diagram-specific settings. This command is commonly used by developers, architects, and anyone who needs to create diagrams quickly and efficiently.

CAVEATS

PlantUML requires Graphviz (dot) to be installed and accessible in the system's PATH for many diagram types. The `GRAPHVIZ_DOT` environment variable may need to be set if Graphviz is not in the PATH, or to specify a particular version.

ENVIRONMENT VARIABLES

GRAPHVIZ_DOT: Specifies the path to the Graphviz dot executable. JAVA_HOME: Specifies the path to the Java Runtime Environment (JRE) or Java Development Kit (JDK).

EXIT STATUS

The `plantuml` command typically returns 0 on success and a non-zero value on failure. Failures can occur due to syntax errors in the PlantUML input, missing dependencies (like Graphviz), or file I/O errors.

HISTORY

PlantUML was created by Arnaud Roques and has been under active development since 2009.
It provides a text based way to create UML diagrams.
The PlantUML command-line tool provides a practical way to automatically generate diagrams from text source files. It has become popular among developers for documentation and communication purposes.

SEE ALSO

dot(1)

Copied to clipboard