CLI
The skill runs the CLI for you. It ships inside the skill as one file; you can also run it directly with Node.js 22.12 or later:
node skill/bin/schemap.mjs <command> …The examples below write schemap for short.
validate
Section titled “validate”schemap validate <map.json> [--json]Checks the map and prints diagnostics with their allowed fixes. --json prints one object, { "ok", "diagnostics" }, for agents.
deliver
Section titled “deliver”schemap deliver <map.json> [-o out.html] [--embed md|iframe|none] [--md-dir <dir>] [--open]Validates, lays out and writes map.html and map.svg next to the JSON (or at -o and the same name with .svg), then prints a receipt and a snippet.
| option | default | meaning |
|---|---|---|
-o |
next to the JSON | where to write the HTML; the SVG goes beside it |
--embed |
md |
snippet style: markdown image, iframe, or none |
--md-dir |
current directory | directory of the markdown file the snippet goes into |
--open |
off | open the map in the browser |
delivered /repo/.schemap/bookshop/map.html · sha256 8a96a791555ac1c5 · 84082 bytes[](./.schemap/bookshop/map.html)schemap serve <map.json> [--port 4400]A live viewer at http://127.0.0.1:<port> that reloads on every save. When a save is invalid, the last good map stays on screen with a note of how many errors the save has; run validate for the details. It writes no files.
schemap diff <base.json> <head.json> [--json|--md]Compares two versions of a map by id: the nodes, edges, groups, lanes, phases and views added, removed or changed, which fields changed, and map-level changes such as the title. - stands for a side with no map, for a map that was added or removed. It never fails on the maps themselves: a file that does not parse counts as no map.
| output | what it prints |
|---|---|
| default | one line: Bookshop: +1 node · −1 edge · 1 changed |
--md |
the summary and a collapsed markdown table, for pull requests |
--json |
the full diff, for scripts |
The pull request Action uses it.
Exit codes
Section titled “Exit codes”| code | meaning |
|---|---|
0 |
ok; warnings allowed |
1 |
the map has errors |
2 |
usage, file or internal error |