qpr is a lightweight Bash, Dash or Zsh script that renders PlantUML diagrams using the official Docker image. It simplifies the process of generating SVG or PNG diagrams from the terminal without requiring a local Java or PlantUML installation. Diagrams can also be displayed directly in graphics-capable terminals (currently supporting Kitty).
- POSIX Compliant: Compatible with
bash,dash, andzsh. - Docker-powered: No local dependencies other than Docker. The script will prompt to pull the plantuml/plantuml image if it's not found locally.
- SVG & PNG Support: Default output is SVG, with an option for PNG.
- Batch Rendering: Supports multiple files or filename prefixes.
- Terminal Preview: Integration with Kitty terminal (
kitten icat) to display diagrams directly in your terminal. - Smart Path Handling: Automatically resolves relative paths for Docker volume mounting.
The repository includes a templates/ directory with starter files that you can copy and modify for testing the qpr workflow:
- C4 Diagram: Templates for System Context, Container, Component, and Code diagrams using the C4-PlantUML library.
- Class Diagram
- Activity Diagram
- Docker
- (Optional) Kitty Terminal for the
--printfeature.
- Download the
qprscript. - Make it executable:
chmod +x qpr
- Move it to a directory in your
PATH(e.g.,~/.local/binor/usr/local/bin).
qpr accepts both full filenames and filename prefixes. If a prefix is provided, it will render all matching .puml files.
qpr [options] <prefix-or-filename>...--pngOutput PNG instead of the default SVG.--printDisplay the resulting PNG in the terminal (requires Kitty terminal). Implies the--pngflag.-q, --quietSuppress status messages.-h, --helpShow help message.
Render a specific .puml file to SVG:
qpr diagram.pumlRender all .puml files starting with the prefix "c4" to PNG and preview them in the terminal:
qpr --print c4