Skip to content
Connect an agent
Command reference

plotwork read

Print the source a Plotwork SVG, a view link, or a hosted link carries, to edit it. It is a command of the Plotwork command line, the npm package @buun_group/plotwork.

TL;DR

QuestionAnswer
What does it do?Print the source a Plotwork SVG, a view link, or a hosted link carries, to edit it.
How do I run it?npx -y @buun_group/plotwork@0.1.0-beta.13 read, or plotwork read once the package is installed.
What does it write?The source, only with --out.
Does it use the network?Only for a hosted link: one request for that picture. A file or a view link is read on this machine.
Does it read the repository settings?No.
How do I read this in a terminal?plotwork read --help

Synopsis

sh
plotwork read <file.svg|link> [--out <file>]

What it does

Prints the source a Plotwork picture carries, so the diagram can be changed and drawn again. The target is an SVG file, a view link a tool returned, or a hosted link such as https://cdn.plotwork.dev/d/<token>.svg.

The source goes to standard output, or to --out, and everything else to standard error, so plotwork read picture.svg > picture.diagram writes only the source. A picture with no embedded source prints what can be read from it, such as its title and labels, and exits 1.

Options

OptionDefaultWhat it does
--out <file>standard outputWrite the source to a file.

Examples

Get the source back from a picture in the repository.

sh
plotwork read docs/assets/diagrams/flow.svg > flow.diagram

Get the source of a hosted picture.

sh
plotwork read https://cdn.plotwork.dev/d/<token>.svg --out flow.diagram

Exit codes

CodeWhen
0The source was printed or written.
1The picture carries no source, the source has errors, or a hosted link could not be read.
2A mistake in the command line: an unknown option, a missing operand, a file or glob that matches nothing, or a settings file that cannot be read.

See also

DocWhy
Command referenceEvery command of the command line
Editing an existing diagramChange a picture you already have
Hosted diagramsThe links read fetches
Exit codes and output formatsWhat every code and format means