Scripting and agents
Use the CLI from shell scripts, CI and AI agents.
- Commands print JSON, except
loginandlogout, which print a confirmation.-o tableprints list commands,whoamiandupdateas a table. - Set
EXCALIDRAW_API_KEYrather than runninglogin, which asks for the key in a terminal.excalidraw login --api-key <key>saves a key without asking. - Lists return 5 items by default (50 for logs), up to 100 with
--limit.--allfetches every page and prints{ count, data }.logs listreads the log in order with--cursor, or jumps to a page with--page; its--allfollows the cursor to the end and can't be combined with--page. --rawprints the API's response text as received, and shows API errors in full.-as a file path reads from stdin for inputs (render -,--file -) and writes to stdout for--out.- Rate-limited and failed read requests are retried, see
--retriesand--request-timeout. Retry notices go to stderr, so stdout stays parseable. - Any error exits with status 1.
- API requests send
User-Agent: excalidraw-cli/<version> node/<version> <platform>-<arch>, so the API can tell CLI usage apart from other API clients. - The update check only runs when stdout and stderr are both a terminal, and never in CI (
CIset), so it doesn't touch piped output or slow down scripts.
Last updated on