@larksuite/whiteboard-cli
v0.1.4
Published
Headless whiteboard engine CLI — render auto-layout DSL JSON or Mermaid diagrams to PNG.
Readme
@larksuite/whiteboard-cli
Headless whiteboard engine CLI — render auto-layout DSL JSON or Mermaid diagrams to PNG.
Install
npm install -g @larksuite/whiteboard-cliUsage
# Render from DSL JSON
whiteboard-cli -i diagram.json -o diagram.png
# Render from Mermaid
whiteboard-cli -i flowchart.mmd -o flowchart.png
# From stdin
echo '{"version":2,"nodes":[{"type":"rect","width":200,"height":100,"text":"Hello"}]}' \
| whiteboard-cli --output hello.png
# Export layout coordinates (for two-stage rendering)
whiteboard-cli -i diagram.json -o diagram.png -l coords.jsonOptions
| Option | Description |
|--------|-------------|
| -i, --input <path> | Input path (reads from stdin if omitted), automatically detects format |
| -o, --output <path> | Output path for main product |
| -f, --from <type> | Force input format: dsl or mermaid |
| -t, --to <type> | Main product type: image (default) or openapi |
| -s, --scale <num> | Pixel density scale factor (default: 2), only valid for -t image |
| -l, --layout <file> | Output computed layout coordinates to JSON file |
| -F, --format <type> | Delivery format: json (default), ndjson, or data |
| -b, --base64 | Return Base64 string for image output, only valid for -t image |
| -d, --dry-run | Dry run mode: validate and layout, but skip rendering/writing |
| -V, --verbose | Verbose logging to stderr |
| -v, --version | Show version information |
| -h, --help | Show help |
System Requirements
- Node.js >= 18
License
This software is licensed under the @larksuite/whiteboard-cli license. See the LICENSE file and THIRD-PARTY-LICENSES.md included in the package for full terms, conditions, and third-party notices.
