drawio
Create and edit diagrams via high-level command strings. Automates shape, connection, style, and layout management for clear diagramming.
Instructions
Execute drawio operations. Each op string follows the FCP verb DSL.
SHAPES: add TYPE LABEL [theme:T] [near:REF dir:DIR] [at:X,Y] [size:WxH] [label:"Display Name"] remove REF | remove @SELECTOR define NAME base:TYPE [theme:T] [badge:"text"] [size:WxH]
CONNECTIONS: connect SRC ARROW TGT [label:"text"] [style:STYLE] [exit:FACE entry:FACE] disconnect SRC -> TGT
APPEARANCE: style REF [fill:#HEX] [stroke:#HEX] [font:#HEX] [fontSize:N] [bold] [italic] label REF "new text" | label SRC -> TGT "new text" badge REF "text" [pos:POSITION]
POSITION: move REF to:X,Y | to:REGION | near:REF dir:DIR resize REF to:WxH swap REF REF layout @all algo:layered|force|tree dir:TB|LR|BT|RL [spacing:N] orient TB|LR|BT|RL
ORGANIZATION: group REF REF ... as:"Group Name" ungroup "Group Name"
STRUCTURE: page add|switch|remove|list "Name" layer create|switch|show|hide|list "Name"
META: checkpoint NAME title "Diagram Title" load list | load PACK
VISUAL: export [inline|file] [fmt:png|svg|pdf] [width:N] [height:N] [page:N] [as:PATH]
NODE TYPES: box plain rectangle (generic) svc rounded rectangle (services, components) circle ellipse (states, events) decision diamond (decisions, conditions) db cylinder (databases, storage) api hexagon (apis, gateways) cloud cloud (external services) actor person shape (users, personas) doc document shape (files, reports) queue parallelogram (queues, streams) triangle triangle (warnings, deltas) process double-bordered rect (predefined processes)
THEMES (FILL / STROKE): blue #dae8fc / #6c8ebf green #d5e8d4 / #82b366 red #f8cecc / #b85450 yellow #fff2cc / #d6b656 orange #ffe6cc / #d79b00 purple #e1d5e7 / #9673a6 gray #f5f5f5 / #666666 dark #1a1a2e / #16213e (light text) white #ffffff / #000000
EDGE STYLES: solid, dashed (- - -), dotted (· · ·), animated, thick, curved, orthogonal Arrows: -> (directed), <-> (bidirectional), -- (undirected) Arrow heads: arrow, open-arrow, diamond, circle, crow-foot, none
SELECTORS: @type:TYPE, @group:NAME, @connected:REF, @recent, @recent:N, @all, @orphan, @page:NAME, @layer:NAME
RESPONSE PREFIXES:
shape created ~ edge created/modified
shape modified - shape/edge removed ! group operation @ layout/position change
CONVENTIONS:
Labels are unique identifiers - no ID management needed
Position auto-computed if omitted (near last created shape)
near:REF dir:DIRECTION places relative to existing shape
All XML structure, IDs, and geometry handled by the tool
Call drawio_help for full reference with examples
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ops | Yes | Array of operation strings |