名称: Pocket Alert – iOS 与 Android 推送通知
描述: OpenClaw 的 Pocket Alert (pocketalert.app) 技能使 OpenClaw 代理和工作流能够向 iOS 和 Android 设备发送推送通知。它用于传递来自自动化任务、工作流和后台进程的警报和更新。
此技能支持通过其 CLI 工具与 Pocket Alert 服务进行交互。
必须安装并认证 pocketalert CLI:
# 安装(如尚未安装)
# 从 https://info.pocketalert.app/cli.html 下载并解压到 /usr/local/bin/
# 使用您的 API 密钥进行认证
pocketalert auth <您的-api-密钥>
# 基础通知
pocketalert send -t "标题" -m "消息"
# 完整形式
pocketalert messages send --title "警报" --message "服务器宕机!"
# 发送到特定应用
pocketalert messages send -t "部署" -m "构建完成" -a <应用-tid>
# 发送到特定设备
pocketalert messages send -t "警报" -m "检查服务器" -d <设备-tid>
# 发送到所有设备
pocketalert messages send -t "警报" -m "系统更新" -d all
# 列出最近的消息
pocketalert messages list
pocketalert messages list --limit 50
pocketalert messages list --device <设备-tid>
# 列出应用
pocketalert apps list
# 列出设备
pocketalert devices list
# 列出 Webhook
pocketalert webhooks list
# 列出 API 密钥
pocketalert apikeys list
# 创建应用
pocketalert apps create --name "我的应用"
pocketalert apps create -n "生产环境" -c "#FF5733"
# 获取应用详情
pocketalert apps get <tid>
# 删除应用
pocketalert apps delete <tid>
# 列出设备
pocketalert devices list
# 获取设备详情
pocketalert devices get <tid>
# 删除设备
pocketalert devices delete <tid>
# 创建 Webhook
pocketalert webhooks create --name "GitHub Webhook" --message "*"
pocketalert webhooks create -n "部署钩子" -m "由 %sender.login% 部署了 %repository.name%"
pocketalert webhooks create -n "CI/CD" -m "*" -a <应用-tid> -d all
# 列出 Webhook
pocketalert webhooks list
# 获取 Webhook 详情
pocketalert webhooks get <tid>
# 删除 Webhook
pocketalert webhooks delete <tid>
创建 Webhook 时,可以使用来自传入负载的模板变量:
pocketalert webhooks create \
--name "GitHub 推送" \
--message "推送至 %repository.name%:%head_commit.message%"
查看或修改配置:
# 查看配置
pocketalert config
# 设置 API 密钥
pocketalert config set api_key <新-api-密钥>
# 设置自定义基础 URL(用于自托管)
pocketalert config set base_url https://您的-api.示例.com
配置存储在 ~/.pocketalert/config.json。
# GitHub Actions / GitLab CI
pocketalert send -t "构建完成" -m "版本 $VERSION 已部署"
# 使用 cron 进行服务器监控
*/5 * * * * /usr/local/bin/pocketalert send -t "服务器健康状态" -m "$(uptime)"
# 服务检查脚本
if ! systemctl is-active --quiet nginx; then
pocketalert send -t "NGINX 宕机" -m "NGINX 在 $(hostname) 上未运行"
fi
CLI 返回适当的退出代码:
- 0 - 成功
- 1 - 认证或 API 错误
- 2 - 参数无效
请始终检查命令输出以获取错误详情。