mcpField
P
poke-assistant

poke-assistant

github.com/ckorhonen生产力2243 次安装5 周前更新
代码仓库

关于 poke-assistant

poke-assistant 是通过 Poke 入站 webhook API 向 Poke 助手发送消息的 skill,供使用 Claude 的用户传递任务完成通知、错误和进度更新。消息可通过 Poke 支持的渠道送达。

主要功能

  1. 01通过 Poke API 发送文本消息
  2. 02将命令输出传入消息
  3. 03发送完成、错误和状态提醒
  4. 04通过 Python 命令行脚本运行

适用场景

  1. 01构建完成时通知 Poke
  2. 02测试失败后发送提醒
  3. 03发送部署错误以便跟进
  4. 04通过消息发送工作摘要

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/ckorhonen/claude-skills --skill poke-assistant

安装后在 Claude Code 中输入/poke-assistant确认已加载。

附带文件scripts/send_message.py

详细介绍

Poke 助手

概述

通过入站 Webhook API 向你的 Poke 助手发送消息。Poke 是一款对话式 AI 助手,支持 iMessage、SMS 和 WhatsApp 消息。本技能可让 Claude 直接向你的 Poke 发送通知、警报和更新。

适用场景

  • 长时间运行的任务完成时通知用户
  • 发送需要关注的错误警报或警告
  • 提供构建、测试或部署进度的状态更新
  • 发送提醒或摘要
  • 提醒重要事件(CI 失败、安全问题等)

前提条件

  • 拥有 poke.com 帐户
  • 设置 POKE_API_KEY 环境变量

安装

获取你的 API 密钥
  1. 前往 poke.com/settings
  2. 转到 Advanced 部分
  3. 生成或复制你的 API 密钥
  4. 将其添加到 shell 配置文件中:
echo 'export POKE_API_KEY="your-api-key"' >> ~/.zshrc
source ~/.zshrc

快速开始

发送一条简单消息:

python scripts/send_message.py -m "Hello from Claude Code!"

将内容通过管道发送到 Poke:

echo "Build completed successfully" | python scripts/send_message.py

命令参考

python scripts/send_message.py [options]

Options:
  -m, --message TEXT    Message to send to Poke
  -v, --verbose         Show detailed output
  -h, --help            Show help message

Input:
  Message can be provided via -m flag or piped to stdin.
  If both are provided, -m takes precedence.

Exit codes:
  0  Success
  1  Missing message or API key
  2  API error (authentication, rate limit, etc.)
  3  Network error

示例

任务完成警报
python scripts/send_message.py -m "Build completed: 42 tests passed, 0 failed"
错误通知
python scripts/send_message.py -m "ERROR: Deployment to production failed. Check logs."
通过管道发送命令输出
git log --oneline -5 | python scripts/send_message.py -m "Recent commits:
$(cat)"
发送包含详细信息的状态更新
python scripts/send_message.py -m "Code review complete:
- 3 files changed
- 2 suggestions made
- Ready for merge"
测试失败时发出警报
npm test || python scripts/send_message.py -m "Tests failed! Check the output."

工作流集成

长时间任务完成后通知

运行耗时较长的任务时,在任务完成后发送通知:

# Run build and notify
npm run build && python scripts/send_message.py -m "Build finished successfully" \
  || python scripts/send_message.py -m "Build failed!"
每日摘要

发送工作内容摘要:

python scripts/send_message.py -m "Daily summary:
- Implemented user auth
- Fixed 3 bugs
- Updated documentation"

最佳实践

何时发送通知
  • 耗时超过 2-3 分钟的任务
  • 需要用户关注的错误
  • 重要里程碑(部署、发布)
  • 安全相关警报
何时不发送
  • 很快就能完成的常规操作
  • 每个细小步骤(避免通知疲劳)
  • 敏感信息(凭据、令牌)
消息指南
  • 消息简洁明了,但信息充分
  • 包含可采取行动的上下文(发生了什么、该做什么)
  • 多行消息使用清晰的格式

故障排除

“未设置 POKE_API_KEY 环境变量”

设置你的 API 密钥:

export POKE_API_KEY="your-api-key"

或者将其添加到 ~/.zshrc,以便持久生效。

“API 返回 401:未授权”

你的 API 密钥无效或已过期。请前往 poke.com/settings 生成新密钥。

“API 返回 429:请求过多”

你受到速率限制。等待几分钟后再发送更多消息。

“网络错误:连接被拒绝”

检查你的网络连接。Poke API 需要网络访问权限。

消息未显示在 Poke 中
  • 确认你的 API 密钥正确
  • 检查 Poke 设置中是否已启用消息功能
  • 确保已配置你的消息渠道(iMessage/SMS/WhatsApp)

评论

支持 Markdown