tldraw-offline

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

2|Updated Sep 14, 2026
One-click install
npx skills add https://github.com/kwanpham2195/agent-stuff --skill tldraw-offline-kwanpham2195
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tldraw-offline
Source: https://github.com/kwanpham2195/agent-stuff/tree/main/pi/skills/tldraw-offline
Command: npx skills add https://github.com/kwanpham2195/agent-stuff --skill tldraw-offline-kwanpham2195

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working with open tldraw Desktop documents programmatically requires knowing the app's local HTTP server, its per-launch bearer token, and which endpoints read shapes, execute editor code, or install durable board scripts. This Skill provides the complete operating procedure so an agent can inspect, edit, connect, lint, and script a live canvas without manual GUI work. ## Core Features & Use Cases - Canvas inspection and editing: Discover open documents, read shapes and bindings, and mutate the canvas via the /api/search and /api/doc/:id/exec endpoints, with screenshots for visual verification. - Durable board scripts: Create persistent behavior (clickable UI, animations, custom shapes, bindings, overlays) through the /script-workspace endpoint and script/main.js / script/config.js files, with watcher status checks. - Safe collaboration handling: Distinguish local, remote, and server document ownership, gate shared-board script writes on host status, and save only locally owned documents. - Use Case: Ask the agent to arrange and connect boxes on your open project-plan canvas, add a clickable card UI that persists across sessions, then verify the result with a screenshot and lint pass. ## Quick Start Ask the agent to list the shapes on your currently open tldraw canvas and connect two of them with a bound 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 a tldraw canvas programmatically?▼

Use the tldraw Desktop app's local HTTP server: discover open documents with POST /api/search, then run JavaScript against the live editor with POST /api/doc/:id/exec. Each request needs the bearer token from server.json in the app's Application Support folder.

How do I add persistent behavior to a tldraw board?▼

Open the document's /script-workspace endpoint, write script/main.js with your behavior, then poll /api/doc/:id/script-status until state is applied. Use config.js instead when registering custom shapes, tools, bindings, or overlays.

Why do tldraw API requests return 401 unauthorized?▼

Each Bash call runs in a fresh shell, so an exported token variable does not persist between calls. Re-read the port and token from server.json at the top of every request, or use the tq helper script that handles this automatically.

Can I edit a shared or remote tldraw board?▼

Yes, remote and server documents accept /exec edits that sync to the host or server, but you cannot save their archives or open a script workspace. Only locally owned documents support helpers.saveDoc() and local script files.

What should I do when the tldraw target window closes mid-task?▼

Do not retry the old document id. Call api.getDocs() fresh and match by document name; if no match exists, stop and report rather than writing to whatever document happens to be open.