Skill 157 · Excalidraw Diagram Generator
Subchapter 157.6
scripts/README.mdMarkdown6 KBView on GitHub
This directory contains scripts for working with Excalidraw libraries.
Splits an Excalidraw library file (*.excalidrawlib) into individual icon JSON files for efficient token usage by AI assistants.
python split-excalidraw-library.py <path-to-library-directory>Create library directory:
mkdir -p skills/excalidraw-diagram-generator/libraries/aws-architecture-iconsDownload and place library file:
.excalidrawlib fileaws-architecture-icons.excalidrawlibRun the script:
python skills/excalidraw-diagram-generator/scripts/split-excalidraw-library.py skills/excalidraw-diagram-generator/libraries/aws-architecture-icons/The script creates the following structure in the library directory:
skills/excalidraw-diagram-generator/libraries/aws-architecture-icons/
aws-architecture-icons.excalidrawlib # Original file (kept)
reference.md # Generated: Quick reference table
icons/ # Generated: Individual icon files
API-Gateway.json
CloudFront.json
EC2.json
S3.json
....excalidrawlib filelibraryItems arrayicons/ directoryreference.md file with a table mapping icon names to filenamesreference.md to find relevant icons, then load only the specific icon files needed../libraries/reference.md files to locate and use icons efficiently.excalidrawlib file you provide.Error: File not found
.excalidrawlib extensionError: Invalid library file format
libraryItems arrayWhen using third-party icon libraries:
This script is for personal/organizational use. Redistribution of split icon files should comply with the original library’s license terms.
Adds a specific icon from a split Excalidraw library into an existing .excalidraw diagram. The script handles coordinate translation and ID collision avoidance, and can optionally add a label under the icon.
.excalidraw)split-excalidraw-library.py)python add-icon-to-diagram.py <diagram-path> <icon-name> <x> <y> [OPTIONS]Options
--library-path PATH : Path to the icon library directory (default: aws-architecture-icons)--label TEXT : Add a text label below the icon
– --use-edit-suffix : Edit via .excalidraw.edit to avoid editor overwrite issues (enabled by default; pass --no-use-edit-suffix to disable)# Add EC2 icon at position (400, 300)
python add-icon-to-diagram.py diagram.excalidraw EC2 400 300
# Add VPC icon with label
python add-icon-to-diagram.py diagram.excalidraw VPC 200 150 --label "VPC"
# Safe edit mode is enabled by default (avoids editor overwrite issues)
# Use `--no-use-edit-suffix` to disable
python add-icon-to-diagram.py diagram.excalidraw EC2 500 300
# Add icon from another library
python add-icon-to-diagram.py diagram.excalidraw Compute-Engine 500 200 \
--library-path libraries/gcp-icons --label "API Server"icons/ directoryAdds a straight arrow between two points in an existing .excalidraw diagram. Supports optional labels and line styles.
.excalidraw)python add-arrow.py <diagram-path> <from-x> <from-y> <to-x> <to-y> [OPTIONS]Options
--style {solid|dashed|dotted} : Line style (default: solid)--color HEX : Arrow color (default: #1e1e1e)--label TEXT : Add a text label on the arrow
– --use-edit-suffix : Edit via .excalidraw.edit to avoid editor overwrite issues (enabled by default; pass --no-use-edit-suffix to disable)# Simple arrow
python add-arrow.py diagram.excalidraw 300 200 500 300
# Arrow with label
python add-arrow.py diagram.excalidraw 300 200 500 300 --label "HTTPS"
# Dashed arrow with custom color
python add-arrow.py diagram.excalidraw 400 350 600 400 --style dashed --color "#7950f2"
# Safe edit mode is enabled by default (avoids editor overwrite issues)
# Use `--no-use-edit-suffix` to disable
python add-arrow.py diagram.excalidraw 300 200 500 300