名称: 终端显示
描述: 通过 webhook 向终端电子墨水屏设备发送消息。当用户希望在他们的终端显示设备上显示文本、通知或更新时,使用此技能。
argument-hint: [标题] [消息]
允许工具: Bash
此技能通过 webhook API 将内容发送到 TRMNL 电子墨水屏设备。
https://trmnl.com/api/custom_plugins/0d9e7125-789d-46a6-9a51-070ac95364d8使用 curl 发送包含 merge_variables 的 JSON 数据:
curl "https://trmnl.com/api/custom_plugins/0d9e7125-789d-46a6-9a51-070ac95364d8" \
-H "Content-Type: application/json" \
-d '{"merge_variables": {"title": "你的标题", "text": "你的消息内容"}}' \
-X POST
TRMNL 设备配置的模板支持以下变量:
| 变量 | 描述 |
|---|---|
title |
突出显示的主标题 |
text |
标题下方的正文内容(支持 Markdown) |
image |
图像的完整 URL(显示在右侧) |
text 字段支持 Markdown 格式,可呈现更丰富的内容:
**文本***文本*- 项目 或 1. 项目\n## 标题(请谨慎使用,主标题已很突出)简单通知:
{"merge_variables": {"title": "提醒", "text": "站起来伸展一下!"}}
带格式的状态更新:
{"merge_variables": {"title": "构建状态", "text": "**所有测试通过**\n\n准备部署。"}}
列表格式:
{"merge_variables": {"title": "今日任务", "text": "- 审查 PR #42\n- 更新文档\n- 团队站会 10点"}}
天气信息样式:
{"merge_variables": {"title": "旧金山", "text": "**晴朗,72°F**\n\n散步的好天气"}}
带图片:
{"merge_variables": {"title": "今日专辑", "text": "**Kind of Blue**\nMiles Davis", "image": "https://example.com/album-cover.jpg"}}
当用户要求向 TRMNL 设备发送内容时:
如果用户提供类似 /trmnl 5分钟后开会 的参数,请将前几个词解释为可能的标题,其余部分作为消息,或根据你的判断创建合适的标题/文本分割。
成功响应示例如下:
{"message":null,"merge_variables":{"title":"...","text":"..."}}
如果在响应中看到错误消息,请告知用户问题所在。
https://example.com/image.png)。