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] [file(s)]
java -jar plantuml.jar [options] [file(s)]

PARAMETERS

-charset
    Specifies the character set to be used for reading input files, e.g., UTF-8.

-config
    Specifies a configuration file to load PlantUML settings from.

-D=
    Defines a preprocessor variable that can be used within the PlantUML source code.

-o


    Specifies the output directory where generated image files will be saved.

-overwrite
    Forces the command to overwrite existing output files without prompting.

-output
    Specifies the desired output image format, e.g., png, svg, eps.

-pipe
    Reads PlantUML source from standard input and writes the generated image to standard output.

-recursive
    Processes PlantUML files found in subdirectories of the specified input path.

-S=
    Sets a skin parameter to customize the visual appearance of diagrams.

-t
    Shorthand for -output , for instance, -tpng or -tsvg.

-verbose
    Enables verbose output, displaying detailed information during processing.

-version
    Displays the PlantUML version and exits.

DESCRIPTION

PlantUML is an open-source tool that allows users to create various types of diagrams, including UML (Unified Modeling Language) diagrams, using a simple plain text description language. It reads a textual definition of a diagram, often stored in a .puml or .plantuml file, and then renders it into an image format such as PNG, SVG, or EPS.

The plantuml command-line utility is the primary way to invoke this rendering process on Linux systems. It supports a wide array of diagram types beyond standard UML, including sequence, use case, class, activity, component, and state diagrams, as well as non-UML types like Gantt charts, mind maps, and Ditaa diagrams. Its simplicity and text-based approach make it highly suitable for version control systems, automation, and collaborative development.

CAVEATS

PlantUML requires a Java Runtime Environment (JRE) to be installed and accessible on the system. For generating most UML diagrams (e.g., class, activity, state diagrams), it relies on the Graphviz (specifically the dot command) layout engine. Therefore, Graphviz must be installed and properly configured in the system's PATH. Performance and memory usage can vary significantly based on diagram complexity and size.

RELIANCE ON GRAPHVIZ

While PlantUML can render some diagrams natively, many complex UML diagrams, particularly class, activity, and state diagrams, depend heavily on the Graphviz package for layout. Users must ensure Graphviz is installed and its dot executable is reachable in the system's PATH for full functionality.

TEXT-BASED SOURCE FILES

PlantUML diagrams are defined in plain text files, typically with a .puml or .plantuml extension. This text-based approach facilitates version control, diffing, and programmatic generation or modification of diagrams, making it a powerful tool for documentation as code.

HISTORY

PlantUML was first released in 2009 by Arnaud Roques. It was developed to address the need for a simple, text-based method for creating diagrams, which could be easily integrated into modern software development workflows, version control systems, and continuous integration pipelines. Its focus on a human-readable text syntax, rather than graphical editors, quickly popularized it among developers and technical writers. Since its inception, PlantUML has continuously evolved, expanding its support for numerous diagram types, output formats, and integration capabilities, making it a versatile tool for technical documentation and design.

SEE ALSO

dot(1), java(1), grep(1)

Copied to clipboard