Skip to content

feat: SVG and frame rendering, Mermaid conversion, scene sharing, and a clearer login - #7

Merged
dwelle merged 20 commits into
masterfrom
feat/reference-json
Nov 6, 2026
Merged

dwelle merged 20 commits into
masterfrom
feat/reference-json

Conversation

@maielo

@maielo maielo commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Release scope for 0.3.0: SVG and per-frame rendering, Mermaid conversion, scene sharing, fonts behind proxies, and a login screen that shows the CLI is free to use without an account.

What's new

  • render, scenes render: SVG output (.svg or --format svg), with fonts subset to the text used.
  • --all-frames --out slides/: one image per frame, in slide order (01-title.png, …).
  • --scale is no longer capped at 2048 px: --max-width/--max-height default to 16384, and a warning says when a limit shrinks a PNG.
  • mermaid flow.mmd --out flow.excalidraw|.png|.svg: editable Excalidraw elements, runs locally, no key. Gantt, quadrant and timeline diagrams are editable too.
  • scenes share <id> --access view|edit|none, scenes share-slides <id> [--off]: public scene and presentation links.
  • login: what's free next to what Excalidraw+ adds, a hint for AI agents, browser login (OAuth) listed as coming soon, and "Not now".
  • --help: laid out like the login screen, with commands under "Free, no account" and "With Excalidraw+", wrapped notes, and at most 5 notes per command, linking to the docs.
  • HTTPS_PROXY, HTTP_PROXY and NO_PROXY work as in curl, including values without a scheme and socks5://.
  • CJK font (Xiaolai) downloads try Excalidraw's CDN, then npmmirror, then jsDelivr. --fonts-url takes mirrors or a local folder.
  • API requests send User-Agent: excalidraw-cli/<version> …, so the API counts them as CLI usage.
  • dist/reference.json: every command's usage, options and examples, for the docs site.
  • README: a banner, features, install, quick start and links to plus.excalidraw.com/docs/cli. The guides moved to docs/, which the package ships for the docs site (excalidraw-plus#3498).

Fixes

  • A frame's SVG is clipped to the frame and no longer embeds the whole scene.
  • SVGs are valid XML: no more &nbsp;.
  • A file missing from the install fails the render at once instead of hanging until --timeout.
  • --all-frames writes each frame as it's drawn, and --timeout applies per frame.
  • --fonts-url mistakes (trailing comma, none with mirrors, missing https://) are errors, not folders.
  • Mermaid with CJK labels waits for every font, even after a failed download, so shapes fit their labels.
  • A proxy the CLI can't use, such as socks4://, is skipped with a warning instead of failing every request.
  • The missing-key error says render and mermaid work without a key.

Screenshots

excalidraw login After pasting a key
Login screen Successful login
excalidraw --help excalidraw render --help
Top-level help render help
Missing key
Missing API key error
Mermaid Gantt chart, now editable Mermaid timeline, now editable
Mermaid Gantt chart Mermaid timeline
mermaid flow.mmd --out flow.png mermaid seq.mmd --out seq.svg --theme dark
Mermaid flowchart Mermaid sequence diagram, dark SVG
Mermaid with Chinese labels --all-frames: first slide
Mermaid with Chinese labels First slide
Chinese in Excalifont, with Xiaolai When Xiaolai can't be downloaded
Chinese text in Xiaolai Chinese text in a system font

Notes

  • New bundled dev dependencies: @excalidraw/mermaid-to-excalidraw@3.6.0 and @excalidraw/element@0.18.0-4ce8305 (latest lacks convertToExcalidrawElements). They become dist/mermaid.js (1 MB), loaded only by mermaid.
  • undici loads only when a proxy is set. With socks5://, Node prints a warning that SOCKS support is experimental.
  • The SVG font-subsetting WebAssembly ships as base64 in dist/wasm/ (1.7 MB) and loads only for SVGs. Package: 2.0 MB packed, 4.8 MB unpacked.
  • "Log in with the browser" is a disabled placeholder until OAuth ships.
  • The login screen shows v0.2.0 until the version bump.

Testing

  • pnpm run test: 64/64. pnpm run test:render (Chrome): 26/26. The SVG, frame, font and Mermaid tests also pass with Firefox.
  • Proxy support checked against an HTTP proxy and a SOCKS5 server.
  • The interactive login was checked by hand in a terminal (screenshots above). It has no automated test.
  • Live API tests, including scenes share and share-slides, skip in CI without a key, so they haven't run yet.

The build writes dist/reference.json from the commander definitions and help
text: every command's usage, arguments, options, examples and notes. The docs
at plus.excalidraw.com/docs/cli are generated from the published copy.

Help notes that were wrapped by hand are now one line each, since the docs list
each line as an item.
… and proxy-aware CJK fonts

- `scenes share <id> --access view|edit|none` and `scenes share-slides <id> [--off]` turn a scene's public link and its shared presentation link on or off, through the new PUT /scenes/:id/link-sharing and /shared-slides routes, and print the URL
- `render` and `scenes render` write SVG when --out ends in .svg or with --format svg; SVGs embed the fonts their text uses, subset to its glyphs. The font-subsetting WebAssembly the build used to drop now ships in dist/wasm/ and is only loaded for SVG exports (with it missing, SVG export hung)
- --all-frames renders each frame to its own file in the --out directory, numbered in presentation order (customData.slidesOrder) and named after the frame, in one browser session
- `excalidraw mermaid <file> --out <.excalidraw|.png|.svg>` converts Mermaid into editable elements as the editor's import does, with @excalidraw/mermaid-to-excalidraw 3.4.0 (Pele) and @excalidraw/element's convertToExcalidrawElements running in the render page from dist/mermaid.js. The labels' fonts are loaded and the diagram laid out again before converting, so shapes fit their text; --elbow and --font-size are supported
- font downloads, API requests and the update check go through HTTPS_PROXY / HTTP_PROXY and honor NO_PROXY, as curl does; Node's fetch ignored them, which left CJK text in a fallback font behind a proxy. undici is bundled into a chunk only loaded when a proxy is set
- npmmirror is a default font mirror between Excalidraw's CDN and jsDelivr, and --fonts-url accepts a local folder or file: URL, such as an unpacked @excalidraw/excalidraw dist/prod, read directly and not cached
- tests cover SVG, frames, Mermaid (including Chinese labels), Chinese text in Excalifont vs other fonts, proxies, and local font folders; test runs ignore the developer's proxy settings
- pnpm-workspace.yaml exempts @excalidraw/mermaid-to-excalidraw@3.4.0, published today, from the one-day release age

Opus 5.5 (xhigh)
@maielo
maielo force-pushed the feat/reference-json branch from 8ebd8af to fccdbfd Compare November 3, 2026 22:03
@maielo maielo self-assigned this Nov 3, 2026
The browser inherited HTTP_PROXY and HTTPS_PROXY, so Chrome sent its own
background requests (component updates, time checks) through the proxy. The
page gets everything through page.route(), so the browser no longer sees proxy
settings, like the API key. CI's proxy test caught Chrome's requests.
@maielo maielo changed the title feat: ship a command reference for the docs feat: render SVG and frames, convert Mermaid, share scenes, and fix CJK fonts behind proxies Nov 3, 2026
API requests send `excalidraw-cli/<version> node/<version> <platform>-<arch>`.
The public API records requests whose User-Agent starts with
`excalidraw-cli/<version>` as CLI usage (cli-request) instead of
public-api-request, with the CLI version. Without it they were sent as Node's
default `node`.
- A proxy without a scheme, such as proxy.corp:8080, is an HTTP proxy.
- A socks4:// or otherwise unusable proxy is skipped with a warning that
  doesn't print the value, and requests connect directly instead of failing.
- NODE_USE_ENV_PROXY=0 no longer turns off the CLI's proxy support.
- One pattern lists the proxy variables the render browser doesn't get.
… frames

- SVGs are serialized as XML, so a non-breaking space is no longer &nbsp;.
- A frame's SVG is clipped to the frame again and no longer embeds the
  whole scene.
- Mermaid conversion waits for every font face, including after a failed
  CJK font download, before laying the diagram out.
- A renderer file missing from the install fails the render at once instead
  of hanging until the timeout.
- --all-frames writes each frame as soon as it's drawn, and --timeout
  applies to each frame.
- --fonts-url rejects empty entries, none mixed with mirrors, and URLs
  without a scheme instead of reading them as folders.
- Excalidraw's CDN gets half the font download time again, and the README
  says mirrors are tried in order.
- The SVG font-subsetting WebAssembly ships as base64 text, so it isn't
  re-encoded on each render.
- excalidraw login opens with the CLI's name and version, lists the free
  commands, and picks a login method: paste an API key, log in with the
  browser (coming soon, disabled until OAuth ships), or not now. After
  logging in, it shows the workspace, key type and where the key was saved.
- Help groups commands into "No account needed" and "Excalidraw+", and the
  README's quick start and command table are split the same way.
- The missing-key error says render and mermaid work without a key.
Bumps @excalidraw/mermaid-to-excalidraw to 3.6.0, which still lays diagrams
out with Pele and now converts these three diagram types into Excalidraw
elements instead of one image.
The help command created for the top-level group was shared with every
subcommand registered after it, so "excalidraw scenes --help" listed its
help command under "NO ACCOUNT NEEDED". It's now created last.
…adds

excalidraw login opens with a banner: the CLI's name and version, what
works without an account (PNG and SVG export, one image per frame, Mermaid
to editable diagrams) next to what logging in adds, and a line on using the
CLI with AI agents. The login method follows right after; "Not now" says
the free CLI keeps working without an account. A successful login ends with
the workspace, the key type and a command to try.
The project is on 3.6.0 now, which is older than a day.
Short bullets about what changes for users, screenshots of anything
visible, and test results, so notes stay the same whoever writes them.
@maielo maielo changed the title feat: render SVG and frames, convert Mermaid, share scenes, and fix CJK fonts behind proxies feat: SVG and frame rendering, Mermaid conversion, scene sharing, and a clearer login Nov 6, 2026
maielo and others added 8 commits November 6, 2026 15:20
…s them

--max-width and --max-height default to 16384 instead of 2048, so --scale 3 on a 940 px drawing gives 2820 px instead of stopping at 2048. When --max-width, --max-height, the 16384-pixel side or the 64-megapixel limit makes a PNG smaller than --scale asks for, a warning on stderr names the limit and suggests SVG for full size.
Every command's help starts with the Excalidraw CLI badge, lists commands under "Free, no account" and "With Excalidraw+" in the login screen's colors, uses title-case sections, wraps notes to the terminal as bullets, and dims option defaults and env vars. reference.json reads the same help sections, so the docs don't change.
render, scenes render and mermaid went from 9-11 notes to 4-5, and patch, put, create, share-slides and logs list to 3-4, each ending with a link to its guide. Everything cut is in docs/rendering.md, mermaid.md, scene-content.md and scripting.md.
…d the exit status

scenes content patch says to increase an element's version to change it and to send at least one field; mermaid says what --out - writes and that syntax errors name the line; the top-level help says errors go to stderr and exit with status 1. Agents learn these from --help alone.
@dwelle

dwelle commented Nov 6, 2026

Copy link
Copy Markdown
Member

🔥

@dwelle
dwelle merged commit d1e716f into master Nov 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants