Community程式設計與開發github.com

Canvas

在已連接的 OpenClaw 節點畫布上顯示 HTML、進行導覽/評估/快照,並偵錯畫布主機 URL。

Canvas 是什麼?

Canvas 是 OpenClaw 生態系統中的一個外掛技能,它允許開發者與 AI 代理在已連接的 Mac/iOS/Android 節點上顯示和操作 HTML 內容。其核心架構包含一個可提供靜態檔案的主機伺服器,並且透過 OpenClaw Gateway 的路由機制,將畫布 URL 傳送至節點應用程式的 WebView 中渲染。此技能支援全面的動作控制,包括顯示畫布(present)、隱藏(hide)、導航至新 URL(navigate)、在當前頁面執行 JavaScript(eval)以及擷取螢幕截圖(snapshot),非常適合進行 UI 測試、遠端除錯或展示動態內容。它支援多種網路環境(本機迴路、區域網路、Tailscale 網路),並會自動選擇最佳路由以確保可靠性。組態設定(如啟用主機、設定根目錄和即時重新載入)儲存在 OpenClaw 組態檔案中。Canvas 對於需要在視覺化節點上建構、測試或呈現基於 HTML 的介面的開發者而言,是一個不可或缺的工具。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/clawdbot/clawdbot/tree/main/skills/canvas

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Canvas 是做什麼的?

使用 Canvas 在已連接的 Mac/iOS/Android 節點上顯示 HTML。

模型

  • Canvas 主機從 plugins.entries.canvas.config.host.root 提供檔案。
  • Canvas 路由存在於 Gateway HTTP 埠(gateway.port,預設為 18789)上。
  • 節點橋(Node Bridge)將 Canvas URL 發送到已連接的節點應用程式。
  • 節點應用程式在 WebView 中渲染 URL。
  • 主機名稱遵循 gateway.bind:僅限迴路的本機,區域網路則使用 LAN IP,Tailnet 則使用 Tailscale 主機,自動選擇最佳路由。
  • 僅在同一台機器上的節點,Localhost URL 才能運作。
  • 已配對的節點通常會收到節點範圍的 pluginSurfaceUrls.canvas 功能 URL;優先使用這些 URL(當可用時)。

設定

作用中的設定檔:$OPENCLAW_CONFIG_PATH 或 ~/.openclaw/openclaw.json。

{
  "plugins": {
    "entries": {
      "canvas": {
        "config": {
          "host": {
            "enabled": true,
            "root": "~/.openclaw/canvas",
            "liveReload": true
          }
        }
      }
    }
  },
  "gateway": { "bind": "auto" }
}

動作

  • present:顯示畫布,可選 URL。
  • hide:隱藏畫布。
  • navigate:開啟新的 URL。
  • eval:在當前畫布中執行 JavaScript。
  • snapshot:擷取螢幕截圖。

工作流程

  1. 確保 Canvas 外掛主機已啟用。
  2. 將 HTML/CSS/JS 放置在 plugins.entries.canvas.config.host.root 或預設的畫布目錄下。
  3. 使用目標節點可達的路由。
  4. 呈現已託管的 URL:/__openclaw__/canvas/<file>.html。
  5. 當使用者需要證明時,使用 snapshot。

URL 格式

http://<gateway-host>:<gateway.port>/__openclaw__/canvas/index.html
http://<gateway-host>:<gateway.port>/__openclaw__/canvas/games/snake.html

路徑對應:

  • /__openclaw__/canvas/index.html -> <canvas host root>/index.html
  • /__openclaw__/canvas/games/snake.html -> <canvas host root>/games/snake.html

故障排除

  • 節點看到 localhost 但實際上是遠端:修正 gateway.bind 或公開 URL,重新產生 URL。
  • LAN 節點無法載入:確認相同的網路、防火牆、Gateway 埠,以及驗證/功能 URL。
  • Tailnet 節點無法載入:確認 Tailscale 狀態和廣播的主機。
  • 空白頁面:在本機開啟 URL,檢查瀏覽器主控台,然後對節點進行 snapshot。
  • 即時重新載入遺失:確認 liveReload 以及在根目錄下的檔案寫入。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

acp-router

Route plain-language requests for Claude Code, Cursor, Copilot, OpenClaw ACP, OpenCode, Gemini CLI, Grok Build, Qwen, Kiro, Kimi, iFlow, Factory Droid, Kilocode, or explicit ACP harness work into either OpenClaw ACP runtime sessions or direct acpx-driven sessions ("telephone game" flow). For coding-agent thread requests, read this skill first, then use only `sessions_spawn` for thread creation. Codex chat binding defaults to the native Codex app-server plugin unless ACP is explicit or background spawn needs ACP.

add-model-provider

Add and live-prove a model provider with non-interactive config one-liners, without exposing credentials.

agent-transcript

Requested GitHub PR/issue agent transcripts: redact, trim, preview, and insert safely.

apple-notes

Create, view, edit, delete, search, move, or export Apple Notes via the memo CLI on macOS.

apple-reminders

List, add, edit, complete, or delete Apple Reminders and reminder lists via remindctl.

auto-qa

Run OpenClaw-wide autonomous QA and live/stress campaigns across independent subsystem lanes, with verified fixes and a resumable evidence report.

autoreview

Structured code review through the shared OpenClaw agent-skills installation.

bear-notes

Create, search, and manage Bear notes via grizzly CLI.

blacksmith-testbox

Run Blacksmith Testbox for CI-parity checks, secrets, hosted services, migrations, or builds local cannot reproduce.

block-kit

Use proactively for structured or interactive Slack replies, and when asked to author or validate native Slack Block Kit JSON.

blogwatcher

Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.

blucli

BluOS CLI (blu) for discovery, playback, grouping, and volume.

bluebubbles

Send and manage iMessages via BlueBubbles, including attachments, tapbacks, edits, replies, and groups.

browser-automation

Use when controlling web pages with the OpenClaw browser tool, especially multi-step flows, login checks, tab management, or recovery from stale refs/timeouts.

camsnap

Capture frames or clips from RTSP/ONVIF cameras and local webcams, including USB pan/tilt/zoom control.

channel-message-flows

Use when running QA Lab channel message flow evidence.

clawdtributor

Clawtributor PRs here, last week or another window: discover conversation refs, recheck GitHub, rank by impact.

clawhub

Search ClawHub for plugins by default, or skills and agent Templates when requested; add Templates; install, verify, update, uninstall, publish, or sync skills.

claw-score

Audit or refresh OpenClaw maturity scorecard docs from root taxonomy, maturity scores, and QA evidence artifacts without using maintainer discrawl data or committed inventory reports.

相關技能