tldraw-offline

Inspect, edit, and script tldraw Desktop canvases through a local HTTP API.

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/squidllee/skills --skill tldraw-offline-squidllee
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tldraw-offline
Source: https://github.com/squidllee/skills/tree/main/tldraw-offline
Command: npx skills add https://github.com/squidllee/skills --skill tldraw-offline-squidllee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working with open tldraw Desktop documents programmatically requires knowing the app's local server, per-launch auth token, and document ownership rules. This Skill provides the endpoints, helper commands, and recipes needed to read, edit, connect, and script live tldraw canvases without manual GUI work. ## Core Features & Use Cases - Canvas inspection and editing: List open documents, read shapes and bindings, capture screenshots, and run JavaScript against a live editor via /api/search and /api/doc/:id/exec. - Diagram generation and linting: Build flowcharts and mindmaps from Mermaid source, create bound arrow connections, and run lint checks before reporting completion. - Durable board scripts: Write script/main.js and config.js through the script workspace for clickable UI, animations, custom shapes, and shared-board-safe behavior. - Use Case: Ask the agent to arrange and connect the boxes on your open project-plan canvas; it discovers the document, creates bound arrows between shapes, lints the result, and saves the file. ## Quick Start Ask the agent to list the shapes on your currently open tldraw canvas and connect two of them with a labeled arrow.

Frequently Asked Questions about tldraw-offline

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I edit an open tldraw file programmatically?▼

Send JavaScript to the tldraw Desktop local server at the port listed in server.json, using POST /api/doc/:id/exec with a bearer token. The code runs against a live editor scoped to that document, and local docs are saved with helpers.saveDoc().

How do I create a flowchart in tldraw from text?▼

Use helpers.mermaid(source) inside an exec snippet to generate a flowchart, sequence diagram, state machine, or mindmap from Mermaid syntax. It creates real bound shapes and arrows rather than hand-placed elements.

Why does my tldraw API request return 401?▼

Each request needs the per-launch token from server.json sent as an authorization bearer header. Exported environment variables do not persist between fresh shell calls, so re-read the port and token on every call or use the tq.mjs helper.

Can I edit a shared or remote tldraw board?▼

Yes, remote and server docs accept /exec edits that sync to the host or server, but you cannot save their archives, open a script workspace, or access filePath. Always read shapes first and never clear a shared page you did not create.

How do I add clickable or animated behavior to a tldraw canvas?▼

Open the document's /script-workspace and write script/main.js, then check script-status until state is applied. Custom shapes, tools, and overlays additionally require a script/config.js that runs before the editor mounts.