Skip to content
Connect an agent
Use the CLI

The Plotwork command line

plotwork checks, draws, and syncs Plotwork diagrams in a repository, on your machine and in CI. It is the npm package @buun_group/plotwork, built from the same engine as the MCP server, the HTTP API, and the GitHub Action, so a picture it draws is the picture they draw.

For
  • GitHub Actions
  • GitLab

TL;DR

QuestionAnswer
What does it do?Draws the pictures under every diagram fence of your Markdown files, fails CI when one is stale, checks diagrams and style rules, makes diagrams from Terraform, OpenAPI, SQL and other files, converts Mermaid, and reads the source back out of a picture.
How do I run it?npx -y @buun_group/plotwork@0.1.0-beta.13 <command>. Nothing to install beyond Node.
Which Node version?Node 22 or newer.
Does it need an account or a key?No. Only check --org, which reads an organisation's saved rules, needs a key.
Does it use the network?Not by default. It reads and writes the files you name. read fetches a hosted link you give it, and check --org reads an organisation's rules; nothing else makes a request.
Does it count anything?No. It keeps no usage counts and sends none.
Where is every command?Command reference, one page for each command, and plotwork <command> --help in a terminal.
How is it different from the GitHub Action?The Action runs the same engine inside GitHub Actions with inputs instead of flags. The command line runs anywhere Node runs: your machine, GitLab, Azure Pipelines, Jenkins, CircleCI.

Run it with npx or install it

There are two ways to run it. Both run the same release.

WayCommandUse it when
npx, pinnednpx -y @buun_group/plotwork@0.1.0-beta.13 sync --check "docs/**/*.md"In CI, and for a one-off run. Nothing is added to the project.
A dev dependencynpm install --save-dev --save-exact @buun_group/plotwork@0.1.0-beta.13, then npx plotwork syncThe project already has Node tooling, and you want the version in its lock file.
Installed for your usernpm install --global @buun_group/plotwork@0.1.0-beta.13, then plotwork syncYou run it often across many repositories.

Pin the exact version everywhere. A new release can draw a picture a little differently, and a check that runs the latest release would then fail on a pull request that changed nothing. Move the pin in a change you review, and run sync in the same change.

plotwork --version prints the release, and plotwork --help lists every command.

What it does

JobCommand
Draw the pictures under every diagram fence of a page, and keep them in stepplotwork sync
Fail CI when a picture is staleplotwork sync --check
Check a diagram for mistakes, with a line, a column, and a hintplotwork validate
Fail CI when a diagram breaks your team's style rulesplotwork check
Draw one diagram to an SVGplotwork render
Get the source back from a pictureplotwork read
Make diagrams from Terraform, OpenAPI, Compose and other files, and fail CI on driftplotwork generate
Draw one file of another format onceplotwork import-source
Convert Mermaidplotwork import
Paste a diagram into Confluence or Notionplotwork export

Where it runs

On a developer's machine, plotwork sync redraws the pictures before a commit. In CI, plotwork sync --check and plotwork generate --check fail the build when a picture or a generated diagram is out of step. On GitHub the GitHub Action does the same with annotations on the pull request, and on GitLab and every other CI the command line does it with an exit code. CI usage has a pipeline for each.

Privacy

The command line runs on your machine and keeps nothing. It counts no use and sends no totals: PLOTWORK_USAGE and DO_NOT_TRACK, which control the local MCP server's opt-in counts, have no effect on it. The two requests it can make are the ones you ask for: read with a hosted link, and check --org. Environment variables lists everything it reads.

See also

DocWhy
Quick startA first diagram, from a fence to a checked pull request
Command referenceEvery command, option, and default
CI usageGitHub Actions, GitLab CI, Azure Pipelines, Jenkins, and CircleCI
ConfigurationThe repository settings every command reads
MCP serverThe same engine for an AI agent