Token导航 LogoToken导航TokenDH.com
效率敏感数据clawhub未标认证来源可访问clear审计提醒

openclaw-tg-canvasOpenClaw TG canvas 控制

Agent Skill

openclaw-tg-canvas 用于辅助前端页面、组件、样式和交互逻辑开发,适合在 OpenClaw 中需要维护前端项目、生成组件或检查界面实现时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

30,649

周安装

1,252

GitHub Stars

公开资料未说明

下载量

9,816
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:openclaw-tg-canvas(OpenClaw TG canvas 控制)
来源仓库:https://github.com/clvv/openclaw-tg-canvas
安装命令:
openclaw skills install openclaw-tg-canvas
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install openclaw-tg-canvas

简介

openclaw-tg-canvas 用于在 Telegram Mini App 中代理生成内容并控制前端界面。

  • 适合需要在前端项目中嵌入代理页面、调试交互逻辑或实时预览 HTML、markdown 的场景。
  • 通过终端和可选 UI 代理实现内容渲染,支持 A2UI 格式输出。
  • 安装前需确认是否涉及文件读写、命令执行或网络请求,注意权限与资源访问边界。
  • 适用宿主包括 OpenClaw,接入前应确认版本、权限和运行环境要求。

SKILL.md

name
tg-canvas
description
Telegram Mini App Canvas with terminal and optional Control UI proxy. Renders agent-generated content (HTML, markdown, A2UI) in a Telegram Mini App; push with tg-canvas push. Includes a JWT-gated browser terminal (server-side PTY/bash — high privilege, shell access to server). Optionally proxies OpenClaw Control UI via ENABLE_OPENCLAW_PROXY=true (off by default; no local files read).
homepage
https://github.com/clvv/openclaw-tg-canvas
kind
server
metadata

Security FAQ (answers for skill reviewers)

Q: Does the server auto-load ~/.openclaw/openclaw.json or any local credential file? No. The server reads no local files for credentials. OPENCLAW_GATEWAY_TOKEN must be supplied explicitly via environment variable. The relevant code is the ENABLE_OPENCLAW_PROXY config block in server.js — verify it yourself.

Q: What is the default for ENABLE_OPENCLAW_PROXY? Off. The code is const ENABLE_OPENCLAW_PROXY = process.env.ENABLE_OPENCLAW_PROXY === "true"; — it is only enabled if the string "true" is explicitly set in the environment. Omitting the variable leaves it disabled.

Q: What are the terminal/PTY endpoints and how are they authenticated?

  • Endpoint: GET /ws/terminal (WebSocket upgrade)
  • Auth: JWT verified by verifyJwt() in the upgrade handler — same token issued by POST /auth after Telegram initData HMAC-SHA256 verification against BOT_TOKEN, restricted to ALLOWED_USER_IDS
  • If the JWT is missing or invalid the connection is rejected with 401 Unauthorized before a PTY is spawned
  • PTY is killed immediately when the WebSocket closes

This is a server skill. It includes a Node.js HTTP/WebSocket server (server.js), a CLI (bin/tg-canvas.js), and a Telegram Mini App frontend (miniapp/). It is not instruction-only.

Telegram Mini App Canvas renders agent-generated HTML or markdown inside a Telegram Mini App, with access limited to approved user IDs and authenticated via Telegram initData verification. It exposes a local push endpoint and a CLI command so agents can update the live canvas without manual UI steps.

Prerequisites

  • Node.js 18+ (tested with Node 18/20/22)
  • cloudflared for HTTPS tunnel (required by Telegram Mini Apps)
  • Telegram bot token

Setup

  1. Configure environment variables (see Configuration below) in your shell or a .env file.
  2. Run the bot setup script to configure the menu button:
   BOT_TOKEN=... MINIAPP_URL=https://xxxx.trycloudflare.com node scripts/setup-bot.js
  1. Start the server:
   node server.js
  1. Start a Cloudflare tunnel to expose the Mini App over HTTPS:
   cloudflared tunnel --url http://localhost:3721

Pushing Content from the Agent

  • CLI:
  tg-canvas push --html "<h1>Hello</h1>"
  tg-canvas push --markdown "# Hello"
  tg-canvas push --a2ui @./a2ui.json
  • HTTP API:
  curl -X POST http://127.0.0.1:3721/push \
    -H 'Content-Type: application/json' \
    -d '{"html":"<h1>Hello</h1>"}'

Security

What the Cloudflare tunnel exposes publicly:

EndpointPublic?Auth
GET /None (serves static Mini App HTML)
POST /authTelegram initData HMAC-SHA256 verification + ALLOWED_USER_IDS check
GET /stateJWT required
GET /wsJWT required (WebSocket upgrade)
POST /push❌ loopback-onlyPUSH_TOKEN required + loopback check
POST /clear❌ loopback-onlyPUSH_TOKEN required + loopback check
GET /health❌ loopback-onlyLoopback check only (read-only, low risk)
GET/WS /oc/*✅ (when enabled)JWT required; only available when ENABLE_OPENCLAW_PROXY=true
⚠️ Cloudflared loopback bypass: cloudflared (and other local tunnels) forward remote requests by making outbound TCP connections to localhost. This means all requests arriving via the tunnel appear to originate from 127.0.0.1 at the socket level — completely defeating the loopback-only IP check. PUSH_TOKEN is therefore required and is enforced at startup. The loopback check is retained as an additional layer but must not be relied on as the sole protection.

Recommendations:

  • Set PUSH_TOKEN — the server will refuse to start without it. Generate one with: openssl rand -hex 32
  • Use a strong random JWT_SECRET (32+ bytes).
  • Keep BOT_TOKEN, JWT_SECRET, and PUSH_TOKEN secret; rotate if compromised.
  • The Cloudflare tunnel exposes the Mini App publicly — the ALLOWED_USER_IDS check in /auth is the primary access control gate for the canvas.
  • ENABLE_OPENCLAW_PROXY is off by default. Only enable it if you need Control UI access through the Mini App and understand the implications (see below).

OpenClaw Control UI proxy (optional)

The server can optionally proxy /oc/* to a local OpenClaw gateway, enabling you to access the OpenClaw Control UI through the Mini App.

This feature is disabled by default. To enable:

ENABLE_OPENCLAW_PROXY=true

When enabled, the server:

  • Proxies /oc/* HTTP and WebSocket requests to the local OpenClaw gateway.
  • If OPENCLAW_GATEWAY_TOKEN is set, injects it as Authorization: Bearer on proxied requests.

The server does not read any local files for credentials — OPENCLAW_GATEWAY_TOKEN must be supplied explicitly via environment variable if needed.

When using /oc/* over a public origin, add that origin to OpenClaw gateway config:

{
  "gateway": {
    "controlUi": {
      "allowedOrigins": ["https://your-canvas-url.example.com"]
    }
  }
}

Terminal (high-privilege feature)

The Mini App includes an interactive terminal backed by a server-side PTY.

⚠️ This grants shell access to the machine running the server, as the process user. Anyone in ALLOWED_USER_IDS can open a bash session and run arbitrary commands. Only add users you trust with shell access to ALLOWED_USER_IDS.

How it works:

  • Authenticated users see a Terminal button in the Mini App topbar.
  • Tapping it opens xterm.js connected to /ws/terminal (JWT required).
  • A PTY (bash) is spawned per WebSocket connection; killed when the connection closes.
  • Mobile toolbar provides Ctrl/Alt sticky modifiers, Esc, Tab, arrow keys.

Runtime scope: node-pty spawns a bash process as the server process user. No additional env vars control this; auth is the only gate.

Commands

  • tg-canvas push — push HTML/markdown/text/A2UI
  • tg-canvas clear — clear the canvas
  • tg-canvas health — check server health

Configuration

VariableRequiredDefaultDescription
BOT_TOKENYesTelegram bot token for API calls and initData verification.
ALLOWED_USER_IDSYesComma-separated Telegram user IDs allowed to authenticate. Controls access to canvas, terminal, and proxy.
JWT_SECRETYesSecret for signing session JWTs. Use 32+ random bytes.
PUSH_TOKENYesShared secret for /push and /clear. Server refuses to start without it. Generate: openssl rand -hex 32
MINIAPP_URLYes (setup only)HTTPS URL of the Mini App, used by scripts/setup-bot.js to configure the bot menu button.
PORTNo3721HTTP server port.
TG_CANVAS_URLNohttp://127.0.0.1:3721Base URL used by the tg-canvas CLI.
ENABLE_OPENCLAW_PROXYNofalseSet to the string "true" to enable /oc/* proxy to a local OpenClaw gateway. Off by default. The server does not read any local files to obtain a token — OPENCLAW_GATEWAY_TOKEN must be set explicitly if auth is needed.
OPENCLAW_GATEWAY_TOKENNo*(unset)*Auth token injected as Authorization: Bearer on proxied /oc/* requests. Only used when ENABLE_OPENCLAW_PROXY=true. Must be supplied explicitly; no automatic file loading occurs.
OPENCLAW_PROXY_HOSTNo127.0.0.1Hostname of the local OpenClaw gateway (proxy only).
OPENCLAW_PROXY_PORTNo18789Port of the local OpenClaw gateway (proxy only).
JWT_TTL_SECONDSNo900Session token lifetime in seconds (default 15 min).
INIT_DATA_MAX_AGE_SECONDSNo300Maximum age of Telegram initData (default 5 min).

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

98.34%
按下载量换算9,653

安全审计

VirusTotal

可疑

ClawScan

通过

Static analysis

未展示

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills