Skip to content
Connect an agent
Command reference

plotwork validate

Check every diagram of a Markdown or .diagram file; --strict also fails on warnings. It is a command of the Plotwork command line, the npm package @buun_group/plotwork.

TL;DR

QuestionAnswer
What does it do?Check every diagram of a Markdown or .diagram file; --strict also fails on warnings.
How do I run it?npx -y @buun_group/plotwork@0.1.0-beta.13 validate, or plotwork validate once the package is installed.
What does it write?Nothing.
Does it use the network?No. It reads and writes files on this machine only.
Does it read the repository settings?Yes: the header defaults of the settings file apply to every diagram. See Configuration.
How do I read this in a terminal?plotwork validate --help

Synopsis

sh
plotwork validate <file> [--strict] [--config <file>]

What it does

Parses every diagram of one file: each diagram fence of a Markdown file, or the whole of a .diagram file. Each mistake is printed with its line and column in the file, the code, and a hint that says how to fix it. Warnings, such as a label too long to read, are printed and pass unless --strict is given.

Options

OptionDefaultWhat it does
--strictOffExit 1 on warnings as well as errors.
--config <file>PLOTWORK_CONFIG, else the nearest plotwork.config.json or .plotwork/config.json from the file up to the repository rootThe repository settings file to read: header defaults, and the style rules check applies.

Examples

Check every diagram fence of a Markdown file.

sh
plotwork validate docs/architecture.md

Fail on warnings too.

sh
plotwork validate checkout.diagram --strict

Exit codes

CodeWhen
0Every diagram is valid.
1A diagram has an error, or a warning with --strict.
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
Writing diagramsThe language the errors point at
Language referenceEvery statement and option
Exit codes and output formatsWhat every code and format means