8000 GitHub - excalidraw/cli: Official Excalidraw CLI for humans and agents · GitHub
[go: up one dir, main page]

Skip to content
excalidrawPublic

About

Official Excalidraw CLI for humans and agents

Resources

Contributing

Stars

446 stars

Watchers

4 watching

Forks

Repository files navigation

Excalidraw CLI: turn .excalidraw files and Mermaid diagrams into PNG, SVG, slides and Excalidraw+ scenes from your terminal

Documentation · npm · Excalidraw+ · Excalidraw

npm license

Render Excalidraw drawings and Mermaid diagrams from your terminal, free and without an account. Log in to Excalidraw+ to manage your workspace too.

Features

  • 🖼️ Render to PNG or SVG: any .excalidraw file, light or dark, transparent, up to 16× scale.
  • 🎞️ Export slides: each frame to its own image, in presentation order.
  • 🧜 Mermaid to Excalidraw: flowcharts, sequence, class, ER and state diagrams, mind maps, Gantt charts, quadrant charts and timelines become editable shapes, laid out and colored as the Excalidraw+ MCP does. excalidraw diagram does the same for nodes and edges listed in JSON.
  • 🩺 Layout check: excalidraw check finds text that doesn't fit, arrows through shapes and other layout problems, as the Excalidraw+ MCP reports them.
  • 🔒 Runs locally: uses the browser you already have. Nothing is uploaded, no account needed.
  • ☁️ Excalidraw+ workspace: log in with your browser, then manage scenes, collections, share links, presentations, members and audit logs.
  • 🤖 Made for scripts and AI agents: JSON output, stdin and stdout, EXCALIDRAW_API_KEY, and scenes written as short element skeletons, converted as the Excalidraw+ MCP does.
  • ✏️ Excalidraw+ MCP tools, no setup: excalidraw mcp gives agents the drawing tools (diagrams, charts, slides, screenshots) through the CLI's login.

Install

npm install -g @excalidraw/cli

Or run it without installing: npx @excalidraw/cli --help. Requires Node.js 22 or newer. excalidraw update updates it.

Quick start

# No account needed
excalidraw render drawing.excalidraw --out drawing.png
excalidraw render deck.excalidraw --all-frames --out slides/
excalidraw mermaid flow.mmd --out flow.excalidraw
excalidraw check flow.excalidraw

# With Excalidraw+
excalidraw login --web    # log in with your browser
excalidraw scenes list --output table
excalidraw scenes render <sceneId> --out scene.png

Every command has --help with examples.

Examples

Made without an account, from the files next to each image.

A map of this codebase, from nodes and edges in JSON A Mermaid sequence diagram
The CLI's source files grouped by what they do, with arrows from each command to the code it calls Sequence diagram of a user, the CLI and Chrome, with a loop and an alt block
excalidraw diagram architecture.json --out map.png excalidraw mermaid sequence.mmd --out sequence.png
A drawing, from element skeletons Slides, one image per frame
Hand-drawn laptop showing CLI commands, an arrow to a sketched flowchart, a sticky note and a sun Four slides: a title, the four free commands, a Mermaid pipeline diagram and install commands
excalidraw render drawing.json --out drawing.png excalidraw render deck.excalidraw --all-frames --out slides/

Logging in

excalidraw login asks how to log in; pick the browser, or run excalidraw login --web. It opens Excalidraw+, where you sign in, pick a workspace and allow the CLI. The CLI then acts as you in that workspace, with your role, and stays logged in until you run excalidraw logout or disconnect it under Settings → Connected apps; either cuts it off at once.

For scripts, CI and machines without a browser, use an API key instead: excalidraw login --api-key <key>, --api-key or EXCALIDRAW_API_KEY. A key passed with --api-key or EXCALIDRAW_API_KEY takes priority over the saved login, so unset it to use your browser login. excalidraw whoami shows which one is in use. See Configuration and API keys.

Documentation

📚 plus.excalidraw.com/docs/cli

The same guides are in docs/.

Contributing

See CONTRIBUTING.md for building the CLI and running the tests.

License

MIT

About

Official Excalidraw CLI for humans and agents

Resources

Contributing

Stars

446 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages

0