Skip to content
Connect an agent
Command reference

plotwork check

Check every diagram against a team's style rules; fails on a broken rule at level error. 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 against a team's style rules; fails on a broken rule at level error.
How do I run it?npx -y @buun_group/plotwork@0.1.0-beta.13 check, or plotwork check once the package is installed.
What does it write?Nothing.
Does it use the network?No, unless --org or PLOTWORK_ORG names an organisation: then one request to the Plotwork API reads its rules, with the key in PLOTWORK_API_KEY.
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 check --help

Synopsis

sh
plotwork check <files...> [--org <slug>] [--format text|github] [--config <file>]

What it does

Checks every diagram of the files against style rules: required icons, naming patterns, allowed tones, a size budget, and forbidden kinds. The rules are the rules section of the repository settings file, or with --org the rules an organisation saved in Plotwork.

Each word is a Markdown or .diagram file, a folder, or a quoted glob. The header defaults of the settings are applied first, so a diagram is checked as it is drawn.

Options

OptionDefaultWhat it does
--org <slug>PLOTWORK_ORG, else the rules of the settings fileCheck against the rules an organisation saved instead, read with the key in PLOTWORK_API_KEY.
--format text|githubtextgithub prints each broken rule as a GitHub annotation on its line.
--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 the docs and every diagram file under diagrams against the rules of the settings file.

sh
plotwork check "docs/**/*.md" diagrams

Check against the organisation's saved rules in a GitHub workflow.

sh
plotwork check --org acme --format github "**/*.md"

Exit codes

CodeWhen
0No rule at level error is broken.
1A rule at level error is broken, a diagram has an error, or the saved rules 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. Also when no rules are found, or --org is given with no key.

See also

DocWhy
Command referenceEvery command of the command line
Repository settingsThe rules section and its checks
OrganisationsRules saved for a whole organisation
Exit codes and output formatsWhat every code and format means