Excalidraw Live Sync
Real-time Excalidraw canvas editor with instant disk & AI agent synchronization for Antigravity IDE and VS Code.
Language: English | Português (Brasil)

Overview
Excalidraw Live Sync is a specialized, local-first custom editor extension that brings real-time hot-reload and seamless disk synchronization to the Excalidraw whiteboarding experience.
Designed specifically for developers and AI-assisted workflows (such as pair programming with AI agents or automated Diagram-as-Code engines like Portulano), this extension eliminates the need to close and reopen files (Ctrl+W) when external tools update diagrams on disk.
┌────────────────────────────────────────────────────────┐
│ REAL-TIME DISK-TO-CANVAS PIPELINE │
└────────────────────────────────────────────────────────┘
[External Process / CLI / AI Agent]
│
▼ (writes atomic .excalidraw to disk)
┌─────────────────────┐
│ File on Local Disk │
└──────────┬──────────┘
│
▼ (fires onDidChangeCustomDocument)
┌──────────────────────────────────────────────┐
│ Extension Host (src/editor.ts) │
│ • Reads updated content │
│ • Dispatches postMessage({ type: 'doc-change' })
└──────────────────────┬───────────────────────┘
│
▼
┌──────────────────────────────────────────────┐
│ Webview React Layer (webview/src/App.tsx) │
│ • Listens for 'doc-change' event │
│ • Calls excalidrawAPI.updateScene(...) │
│ • CANVAS UPDATES LIVE WITHOUT LOSING PAN/ZOOM│
└──────────────────────────────────────────────┘
Key Features
| Feature |
Description |
| Instant Live Reload |
Automatically reflects disk updates in the active editor tab with zero-blind-window echo damping and guaranteed auto-save flush on tab close. Zoom, pan, and viewport state are smoothly preserved. |
| AI Agent Co-Creation |
Pair program with AI agents (Antigravity, Claude, Copilot) or CLI tools that write Excalidraw files. Watch diagrams evolve live. |
| Grid Alignment (Grid Snap) |
Dedicated grid icon in the editor tab header and overflow menu (...) to toggle grid snap (20px) on the fly without losing pan/zoom, backed by persistent excalidraw.gridMode (Ctrl + Shift + G / Cmd + Shift + G). |
| Status Bar Auto-Save Toggle |
Interactive indicator in the status bar (Auto-Save / Manual Ctrl+S) to switch save modes with a single click. |
| 1-Click Quick Exports |
Export directly to high-resolution SVG or PNG from the editor menu, saving automatically beside the original diagram. |
| New Diagram via Explorer |
Right-click any folder in the VS Code file explorer and select "New Excalidraw Diagram" to start whiteboarding instantly. |
| Decoupled Portulano Integration |
In-place Sugiyama deterministic layout, semantic spec extraction, and instant sibling file switching (.excalidraw ⇄ .json). 100% unbundled and guarded by excalidraw.enablePortulano. |
| Multi-Format Support |
Seamlessly open and edit .excalidraw, .excalidraw.json, .excalidraw.svg, and .excalidraw.png. |
| Adaptive Themes |
Supports Light, Dark, and automatic synchronization with VS Code color themes (Auto). |
| Security & Safe Links |
Robust defense against SSRF, loopback attacks, path traversal on local file:// links, and resource exhaustion in remote URIs, with strict protocol whitelisting (http:, https:, mailto:) on canvas links. |
| 100% Local-First |
Zero external telemetry, no remote tracking, and zero cloud dependencies. |
| Library Support |
Full support for Excalidraw libraries (.excalidrawlib) and repository-versioned collections. |
Getting Started
- Create or open any diagram in your workspace:
- Via File Explorer: Right-click any folder ➔ New Excalidraw Diagram.
- Via File Creation: Create files like
diagram.excalidraw, architecture.excalidraw.json, etc.
- Draw interactively using the Excalidraw interface, or let an AI agent / CLI tool update the file on disk.
- Disk changes sync into your active editor canvas in real time without losing camera position or viewport zoom!
Configuration
Customize the extension behavior in your settings.json:
{
// Enable 20px grid snap alignment by default
"excalidraw.gridMode": true,
// Automatically save drawings to disk on changes (default: true).
// If set to false, drawings are saved manually via Ctrl+S.
"excalidraw.autoSave": true,
// Delay in milliseconds before automatically writing changes to disk
"excalidraw.autoSaveDelay": 300,
// Interface language (default: "auto", syncs with IDE language; supports 30+ locales)
"excalidraw.language": "auto",
// Enable Portulano architecture integration and menu actions (default: true)
"excalidraw.enablePortulano": true,
// Embedded image export settings
"excalidraw.image": {
"exportScale": 1,
"exportWithBackground": true,
"exportWithDarkMode": false
},
// Path to shared Excalidraw library file within the workspace
"excalidraw.workspaceLibraryPath": ".vscode/library.excalidrawlib"
}
Available Commands
Access commands from the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) or interface buttons:
Excalidraw: Toggle Grid Alignment — Toggle 20px grid snap on or off (grid icon in editor header, ... menu, or Ctrl + Shift + G / Cmd + Shift + G).
Excalidraw: Toggle Auto-Save Mode — Switch between instant auto-save and manual saving (or click the status bar widget).
Excalidraw: Quick Export as SVG — Render and save .svg next to the diagram file.
Excalidraw: Quick Export as PNG — Render and save .png next to the diagram file.
Excalidraw: New Excalidraw Diagram — Create a new diagram in the selected folder.
Excalidraw: Switch Color Theme — Switch between Light, Dark, and Auto.
Excalidraw: View Raw Source Code — Open the underlying JSON/SVG text representation.
Portulano: Reorganize Diagram (Sugiyama Layout) — Apply deterministic Sugiyama layout via Portulano CLI.
Portulano: Extract Semantic Spec (.json) — Convert visual canvas elements into a clean structural specification.
Portulano: Switch to Sibling File — Instantly switch between .excalidraw and its corresponding .json sibling.
Anti-Bundling Philosophy (100% Standalone)
Excalidraw Live Sync is completely autonomous, functional, and self-contained. The integration with Portulano is strictly optional:
- If
excalidraw.enablePortulano is set to false, all Portulano menu items and actions are completely hidden.
- If a Portulano command is invoked and the
portulano CLI executable is not found in your system PATH, a non-blocking notification is displayed with GitHub documentation links, installation commands, and a 1-click button to disable Portulano actions.
Origin & Attribution
- Built upon the open-source
excalidraw-vscode project by pomdtr and the Excalidraw team.
- Enhanced and maintained by Renato Rezende (@rnt-rez) with real-time disk-to-canvas synchronization for AI coding agents and ergonomic tooling.
- Licensed under the MIT License.
| |