
excalidraw-cli
Manage Excalidraw+ via CLI and the official MCP endpoint: scenes, scene content, collections, workspace users, invites, logs, and raw MCP tool calls. Use when the user mentions Excalidraw, Excalidraw+, diagrams, .excalidraw scene editing, workspace collections, or the Excalidraw MCP/API.
Install
$ npx api2cli install Melvynx/excalidraw-cliDetails
README
excalidraw-cli
CLI for Excalidraw+ through the official MCP endpoint:
https://api.excalidraw.com/api/v1/mcp
Built with api2cli.dev. Published from Melvynx/excalidraw-cli.
Install
npx api2cli install Melvynx/excalidraw-cli
This clones the repo, builds the CLI, links it to your PATH, and installs the AgentSkill to your coding agents.
Authentication
Create an Excalidraw+ API key in your workspace settings, then either save it locally:
excalidraw-cli auth set "EXCALIDRAW_API_KEY"
excalidraw-cli auth test
Or use an environment variable:
export EXCALIDRAW_API_KEY="EXCALIDRAW_API_KEY"
excalidraw-cli auth test --json
Token file path: ~/.config/tokens/excalidraw-cli.txt, chmod 600.
Usage
excalidraw-cli --help
excalidraw-cli tools list --json
excalidraw-cli scenes list --limit 10 --json
excalidraw-cli collections list --json
Resources
tools
Raw MCP discovery and passthrough.
excalidraw-cli tools list --json
excalidraw-cli tools schema create_scene --json
excalidraw-cli tools call list_scenes --arg limit=10 --json
excalidraw-cli tools call create_collection --args-json '{"name":"Ideas"}' --json
scenes
Create, inspect, update, delete, search, and edit scenes.
excalidraw-cli scenes list --limit 10 --json
excalidraw-cli scenes create --name "Architecture" --collection-id COLLECTION_ID --json
excalidraw-cli scenes get SCENE_ID --json
excalidraw-cli scenes update SCENE_ID --name "New name" --json
excalidraw-cli scenes content SCENE_ID --json
excalidraw-cli scenes search SCENE_ID --query "Auth" --type rectangle --json
excalidraw-cli scenes format --json
excalidraw-cli scenes edit SCENE_ID --add '[{"type":"rectangle","x":100,"y":100,"width":220,"height":90,"label":{"text":"Hello","fontSize":20,"fontFamily":5}}]' --json
excalidraw-cli scenes delete SCENE_ID --json
For scenes edit:
--addis a JSON array string of new element skeletons. Do not includeid.--updateis a JSON array string of patches with real persistedidvalues.--deleteis a JSON array of element IDs.- Shape labels should use
label: { "text": "..." }. - Arrows pointing at shapes should include explicit
startBindingandendBinding.
collections
excalidraw-cli collections list --json
excalidraw-cli collections create --name "Product diagrams" --json
excalidraw-cli collections get COLLECTION_ID --json
excalidraw-cli collections update COLLECTION_ID --name "Renamed" --json
excalidraw-cli collections scenes COLLECTION_ID --json
excalidraw-cli collections create-scene COLLECTION_ID --name "Flow" --json
excalidraw-cli collections delete COLLECTION_ID --json
workspace
excalidraw-cli workspace get --json
excalidraw-cli workspace update --name "Team Workspace" --json
excalidraw-cli workspace users --limit 20 --json
excalidraw-cli workspace user USER_ID --json
excalidraw-cli workspace update-user USER_ID --role admin --json
excalidraw-cli workspace remove-user USER_ID --json
invites
excalidraw-cli invites list --json
excalidraw-cli invites create-email --email user@example.com --role member --json
excalidraw-cli invites create-link --role member --max-uses 5 --restricted-domains '["example.com"]' --json
excalidraw-cli invites get INVITE_ID --json
excalidraw-cli invites update INVITE_ID --role admin --json
excalidraw-cli invites delete INVITE_ID --json
logs
excalidraw-cli logs list --limit 20 --operation update --json
excalidraw-cli logs list --date-from 2026-01-01T00:00:00Z --json
Output format
Always use --json when calling the CLI from agents or scripts.
Success envelope:
{ "ok": true, "data": { "example": true }, "meta": { "total": 1 } }
Error envelope:
{ "ok": false, "error": { "code": 401, "message": "Authentication failed." } }
Development
bun install
bun run build
npx api2cli bundle excalidraw
npx api2cli link excalidraw
excalidraw-cli auth test --json