Excalidraw CLI

excalidraw scenes

List, create, update, share, delete, and edit workspace scenes.

Work with Excalidraw scenes, including metadata, collection placement, and drawing content.

excalidraw scenes [options] [command]
CommandDescription
renderRender a workspace scene as a local PNG or SVG.
listList scene metadata in the current workspace.
getShow metadata for one scene.
createCreate a scene, optionally with content from a file.
updateUpdate scene metadata.
deleteMove a scene to trash.
shareTurn a scene's public link on or off.
share-slidesShare a scene's frames as a presentation.
contentRead, replace, or patch scene canvas JSON.

Examples

excalidraw scenes list --limit 25
excalidraw scenes list --collection-id <collectionId>
excalidraw scenes get <sceneId>
excalidraw scenes content get <sceneId> --out scene.json

Notes

  • Scene metadata commands do not read or write drawing elements.
  • Use excalidraw scenes content --help for commands that handle the canvas JSON.
  • Every scene belongs to a collection. Personal (uk-) API keys may pass private as the collection ID.

render

Fetch scene content through the public API, then render it locally with an installed browser.

excalidraw scenes render [options] <sceneId>
ArgumentDescription
<sceneId>Scene ID to render.
OptionDescription
--out <file>Write the image to a file (overwrites), - for stdout, or a directory with --all-frames. Required.
--format <format>Png or svg; defaults to the --out extension, else png.
--frame-id <id>Render just this frame, clipped to its bounds.
--all-framesRender each frame to its own file in the --out directory.
--padding <pixels>Padding in scene pixels; ignored for frames; default 20.
--scale <number>Resolution multiplier, up to 16; default 1.
--max-width <pixels>Maximum PNG width, up to 16384; default 16384.
--max-height <pixels>Maximum PNG height, up to 16384; default 16384.
--theme <theme>Light or dark; defaults to the scene's export preference.
--transparentExport with a transparent background.
--browser-path <path>Path to Chrome, Chromium, Edge, or Firefox; a binary named firefox is driven as Firefox. Environment variable: EXCALIDRAW_BROWSER_PATH.
--fonts-url <urls>Comma-separated mirror URLs or local folders for CJK fonts, or none. Environment variable: EXCALIDRAW_FONTS_URL.
--timeout <ms>Browser startup and render deadline; default 30000 ms.

Examples

excalidraw scenes render <sceneId> --out scene.png
excalidraw scenes render <sceneId> --out scene.svg --theme dark
excalidraw scenes render <sceneId> --frame-id <frameId> --out frame.png
excalidraw scenes render <sceneId> --all-frames --out slides/
excalidraw scenes render <sceneId> --out - > scene.png

Notes

  • Needs an API key that can read the scene, and an installed Chrome, Chromium, Edge or Firefox. The key never reaches the browser.
  • The format follows the --out extension, .png or .svg, unless --format is set. SVGs embed their fonts and have no size limit.
  • --all-frames writes each frame to the --out directory as its own file, numbered in presentation order, such as 01-intro.png.
  • With --out -, stdout gets only the image, without the JSON summary. Errors and retry notices go to stderr.
  • Fonts, proxies, browsers and size limits: /docs/cli/rendering

list

List scene metadata, sharing links, and collection assignments without fetching full canvas content.

excalidraw scenes list [options]
OptionDescription
--collection-id <id>Only return scenes in this collection.
--limit <number>Maximum number of scenes to return, from 1 to 100; default 5.
--offset <number>Number of scenes to skip for offset pagination.
--allFetch every page and print one combined list; --limit sets the page size.

Examples

excalidraw scenes list --limit 50
excalidraw scenes list --collection-id <collectionId> --limit 25
excalidraw scenes list --all --output table

Notes

  • Use this first when you need scene IDs for follow-up commands.
  • Use --limit to keep output bounded for scripts and agents, or --all to walk every page.
  • With --all the output is { count, data } instead of a single page with hasNextPage.

get

Get one scene's metadata, sharing links, pinned state, and collection assignment.

excalidraw scenes get [options] <sceneId>
ArgumentDescription
<sceneId>Scene ID returned by a list or create command.

Examples

excalidraw scenes get <sceneId>

Notes

  • This returns metadata only. Use scenes content get to fetch drawing elements and files.

create

Create a scene in a collection. With --file, write its drawing content in the same run; without it, the scene starts empty.

excalidraw scenes create [options]
OptionDescription
--name <name>Name for the new scene. Required.
--collection-id <id>Collection to place the scene in; personal API keys may use private. Required.
--pinnedPin the scene in the workspace UI.
--file <file>Scene content JSON to write into the new scene; use - to read stdin.

Examples

excalidraw scenes create --name "Architecture sketch" --collection-id <collectionId>
excalidraw scenes create --name "Sprint board" --collection-id <collectionId> --pinned
excalidraw scenes create --name "Scratchpad" --collection-id private
excalidraw scenes create --name "Imported" --collection-id <collectionId> --file drawing.excalidraw
generate-diagram | excalidraw scenes create --name "Generated" --collection-id <collectionId> --file -

Notes

  • --file takes a full Excalidraw export or a partial payload with elements, appState or files, and is checked before the scene is created. Without it the scene starts empty.
  • Workspace API keys need a real collection ID; personal (uk-) keys may pass private for the owner's private collection.
  • More: /docs/cli/scene-content

update

Rename, pin, or move a scene without changing its drawing content.

excalidraw scenes update [options] <sceneId>
ArgumentDescription
<sceneId>Scene ID to update.
OptionDescription
--name <name>New scene name.
--collection-id <id>Move the scene to this collection; personal API keys may use private.
--pinnedPin the scene in the workspace UI.
--no-pinnedUnpin the scene.

Examples

excalidraw scenes update <sceneId> --name "Updated diagram"
excalidraw scenes update <sceneId> --collection-id <collectionId>
excalidraw scenes update <sceneId> --no-pinned

Notes

  • Provide at least one field to update. Omitted fields stay unchanged.
  • Use --pinned to pin and --no-pinned to unpin.

delete

Soft-delete a scene by moving it to trash. This does not permanently destroy it.

excalidraw scenes delete [options] <sceneId>
ArgumentDescription
<sceneId>Scene ID to move to trash.

Examples

excalidraw scenes delete <sceneId>

Notes

  • Existing links or integrations may stop working while the scene is in trash.

share

Set what anyone with the scene's public link may do, and print the link. This is the link from the scene's Share dialog.

excalidraw scenes share [options] <sceneId>
ArgumentDescription
<sceneId>Scene ID to share.
OptionDescription
--access <access>View, edit, or none to turn the link off. Required.

Examples

excalidraw scenes share <sceneId> --access view
excalidraw scenes share <sceneId> --access edit
excalidraw scenes share <sceneId> --access none
excalidraw scenes share <sceneId> --access view | jq -r .url

Notes

  • Anyone with the link can open the scene without signing in. With view or edit, they can also read and write comments.
  • The output is the link's access and its URL; url is null once the link is off.
  • Turning the link on fails with HTTP 403 when a workspace admin has disabled scene sharing.

share-slides

Turn the scene's shared presentation link on, or off with --off, and print the link. Anyone with the link can step through the scene's frames as slides without signing in.

excalidraw scenes share-slides [options] <sceneId>
ArgumentDescription
<sceneId>Scene ID whose frames to share.
OptionDescription
--offTurn the shared slides link off.

Examples

excalidraw scenes share-slides <sceneId>
excalidraw scenes share-slides <sceneId> --off

Notes

  • Each frame in the scene is one slide. Sharing fails with HTTP 400 when the scene has no frames.
  • The link stays the same when sharing is turned off and on again; url is null while it's off.
  • Turning sharing on fails with HTTP 403 when a workspace admin has disabled scene sharing.

content

Work with the complete Excalidraw scene content: elements, files, app state, and version data.

excalidraw scenes content [options] [command]
CommandDescription
getFetch complete scene content.
putReplace all content in a scene.
patchMerge partial content into a scene.

Examples

excalidraw scenes content get <sceneId> --out scene.json
excalidraw scenes content patch <sceneId> --file patch.json
excalidraw scenes content put <sceneId> --file replacement.json

Notes

  • Prefer patch for incremental agent edits. Use put only for authoritative full replacements.
  • Patch merges with the stored scene; put replaces the stored scene.

content get

Return the full scene JSON, including elements, files, app state, and embedded file status.

excalidraw scenes content get [options] <sceneId>
ArgumentDescription
<sceneId>Scene ID to read.
OptionDescription
--out <file>Write response JSON to a file (overwrites); - prints to stdout.

Examples

excalidraw scenes content get <sceneId>
excalidraw scenes content get <sceneId> --out scene.json

Notes

  • Large scenes can produce large JSON. Use --out when saving content for review, backup, or later patching.
  • GET responses may include filesFailedToEmbed; write commands ignore that field if it is reused as input.

content put

Authoritatively replace a scene with the complete Excalidraw content JSON from a file.

excalidraw scenes content put [options] <sceneId>
ArgumentDescription
<sceneId>Scene ID to replace.
OptionDescription
--file <file>Complete scene content JSON file; use - to read stdin. Required.

Examples

excalidraw scenes content put <sceneId> --file replacement.json
cat drawing.excalidraw | excalidraw scenes content put <sceneId> --file -

Notes

  • This is a full replacement: elements not present in the file are removed from the scene.
  • The file only needs elements; missing fields are filled in, and the file is checked before anything is sent.
  • Connected editors are forced to reload. For most automated edits, use patch instead.
  • More: /docs/cli/scene-content

content patch

Patch scene content by merging the supplied elements, files, or appState fields into the current scene.

excalidraw scenes content patch [options] <sceneId>
ArgumentDescription
<sceneId>Scene ID to patch.
OptionDescription
--file <file>Partial scene content JSON file; use - to read stdin. Required.

Examples

excalidraw scenes content patch <sceneId> --file patch.json
echo '{"appState":{"viewBackgroundColor":"#f8f9fa"}}' | excalidraw scenes content patch <sceneId> --file -

Notes

  • Send at least one of elements, appState or files. Elements and files you leave out are kept.
  • Elements merge by ID, and the higher version wins: to change an element, send it with its version increased. Send it with isDeleted: true to remove it.
  • Files are added or replaced by ID. From appState, only viewBackgroundColor and lockedMultiSelections are stored.
  • More: /docs/cli/scene-content

Last updated on

On this page