Community编程与开发github.com

Canvas

在已连接的 OpenClaw 节点画布上呈现 HTML,支持导航、执行脚本、截图以及调试画布主机 URL。

Canvas 是什么?

Canvas 是一个专为 OpenClaw 节点(Mac/iOS/Android)设计的 HTML 呈现工具。它允许 AI 代理或开发者将本地或远程的 HTML/CSS/JS 内容通过网关路由发送到节点的 WebView 中显示。该技能支持实时预览、JavaScript 执行、页面截图和 URL 导航,非常适合构建动态 UI、调试或快速原型展示。Canvas 自动选择最佳路由(本地回环、局域网或 Tailscale),并通过节点桥向已配对节点推送能力 URL。配置位于 `~/.openclaw/openclaw.json` 中,可控制主机根目录、启用实时重载和网关绑定模式。调试时请检查网络连通性、网关端口及能力 URL 的有效性。

兼容平台~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 路由驻留在网关 HTTP 端口(gateway.port,默认 18789)上。
  • 节点桥将 Canvas URL 发送到已连接的节点应用。
  • 节点应用在 WebView 中渲染 URL。
  • 主机名遵循 gateway.bind:回环仅限本地,局域网 IP 用于局域网,Tailscale 主机用于 tailnet,自动选择最佳路由。
  • 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。
  • 局域网节点无法加载:验证同一网络、防火墙、网关端口以及认证/能力 URL。
  • Tailnet 节点无法加载:验证 Tailscale 状态和公布的主机。
  • 空白页面:在本地打开 URL,检查浏览器控制台,然后截图节点。
  • 缺少实时重载:验证 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.

相关技能