Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ excalidraw-cli convert diagram.excalidraw --format svg --no-export-background
| `{Label}` | Diamond | Decisions, conditionals |
| `(Label)` | Ellipse | Start/End points |
| `[[Label]]` | Database | Data storage |
| `[Label @fillStyle:hachure @backgroundColor:#a5d8ff]` | Styled node | Add inline node style attributes |
| `->` | Arrow | Connection |
| `-->` | Dashed Arrow | Dashed connection |
| `-> "text" ->` | Labeled Arrow | Connection with label |
Expand All @@ -99,6 +100,41 @@ excalidraw-cli convert diagram.excalidraw --format svg --no-export-background
{Valid?} -> "no" -> [Show Error] -> [Enter Credentials]
```

### Node Styling

Add shape-level styling directly to nodes with inline `@key:value` attributes:

```excalidraw
(Start) -> [Enter Credentials @fillStyle:hachure @backgroundColor:#a5d8ff] -> {Valid?}
{Valid?} -> "no" -> [Show Error @backgroundColor:#ffc9c9 @strokeStyle:dashed] -> [Enter Credentials]
```

For repeated or shared nodes, define defaults with an `@node` block:

```excalidraw
@node [Enter Credentials]
fillStyle: solid
backgroundColor: #a5d8ff

(Start) -> [Enter Credentials @fillStyle:hachure] -> {Valid?}
```

Supported node style keys:

- `fillStyle`: `solid`, `hachure`, `cross-hatch`
- `backgroundColor`
- `strokeColor`
- `strokeWidth`
- `strokeStyle`: `solid`, `dashed`, `dotted`
- `roughness`
- `opacity`

Precedence rules:

- `@node` blocks provide defaults for matching nodes
- inline node attributes override block values
- repeated references to the same node merge explicit style properties with later values winning per property

### Directives

```
Expand Down
39 changes: 39 additions & 0 deletions man/excalidraw-cli.1
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ Ellipse node.
.B [[Label]]
Database node.
.TP
.BI "[Label @key:value ...]"
Rectangle node with inline style attributes.
.TP
.BI "@node [Label]"
Start a node-style block followed by indented
Comment on lines +177 to +180
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The man page describes [Label @key:value ...] as a "Rectangle node with inline style attributes" and shows @node [Label], but inline styles and @node selectors are supported for other node syntaxes too (e.g. {...}, (...), [[...]]). Updating this wording/examples to refer to “shape nodes” (or “any node selector”) would avoid misleading users about the feature scope.

Suggested change
Rectangle node with inline style attributes.
.TP
.BI "@node [Label]"
Start a node-style block followed by indented
Shape node with inline style attributes.
.TP
.BI "@node <node-selector>"
Start a node-style block for a node selector followed by indented

Copilot uses AI. Check for mistakes.
.I key: value
lines.
.TP
.B ![path]
Image node using the default image size.
.TP
Expand All @@ -193,6 +201,34 @@ Nodes are deduplicated by label and type.
Chains such as
.B [A] -> [B] -> [C]
produce one edge per hop.
.SS "Node styling"
.P
Shape nodes can define style properties inline:
.P
.B [Login @fillStyle:hachure @backgroundColor:#a5d8ff]
.P
Supported style keys are
.BR fillStyle ,
.BR backgroundColor ,
.BR strokeColor ,
.BR strokeWidth ,
.BR strokeStyle ,
.BR roughness ,
and
.BR opacity .
.P
Node styles can also be declared in a block:
.P
.RS
.nf
@node [Login]
fillStyle: hachure
backgroundColor: #a5d8ff
.fi
.RE
.P
When both forms are used, block styles provide defaults and inline attributes
override them on matching nodes.
.SS "Comments"
.TP
.B # comment
Expand Down Expand Up @@ -378,6 +414,9 @@ excalidraw-cli create --format json --inline '{"nodes":[{"id":"a","type":"rectan
.B Create from stdin
echo "[A] -> [B]" | excalidraw-cli create --stdin -o diagram.excalidraw
.TP
.B Create a styled node from inline DSL
excalidraw-cli create --inline "(Start) -> [Login @fillStyle:hachure @backgroundColor:#a5d8ff] -> (End)" -o styled.excalidraw
.TP
.B Write to stdout
excalidraw-cli create flowchart.dsl -o -
.TP
Expand Down
Loading
Loading