Xpersona
W

WeixinClawBot Send

CLAWHUB · Unverified

主动给微信用户发消息(文本、图片、视频、文件)。微信机器人默认只能被动回复, 这个技能让 agent 能主动推送消息到用户微信。 Use when: 主动发微信, 定时提醒, 告警通知, 推送报告, 发图片/文件到微信, proactive WeChat message, push notification to... Skill: WeixinClawBot Send Owner: lroolle Summary: 主动给微信用户发消息(文本、图片、视频、文件)。微信机器人默认只能被动回复, 这个技能让 agent 能主动推送消息到用户微信。 Use when: 主动发微信, 定时提醒, 告警通知, 推送报告, 发图片/文件到微信, proactive WeChat message, push notification to... Tags: latest:0.5.2 Version history: v0.5.2 | 2026-03-27T07:38:52.382Z | auto - Skill documentation is now primarily in Chinese, optimized for mainland Chinese users. - Usage scenarios, quick start, and error h

62
Rank
84
Safety
1.0k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s177jyaj8w2f9qrbkvs3tf0kyd83m778:wxclawbot-send
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-lroolle-wxclawbot-send/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

127,540 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: wxclawbot-send
version: 0.5.2
description: >
  主动给微信用户发消息(文本、图片、视频、文件)。微信机器人默认只能被动回复,
  这个技能让 agent 能主动推送消息到用户微信。
  Use when: 主动发微信, 定时提醒, 告警通知, 推送报告, 发图片/文件到微信,
  proactive WeChat message, push notification to WeChat, send image/file to WeChat.
  Triggers: 发微信, 微信通知, 微信提醒, 推送微信, wxclawbot, send wechat,
  wechat message, weixin message, wx message, push wechat, send image wechat.
  DO NOT TRIGGER when: 发邮件, 发短信, Slack, Teams, Telegram 等非微信消息。
metadata:
  openclaw:
    requires:
      bins: [wxclawbot]
      config: [~/.openclaw/openclaw-weixin/accounts/]
    primaryEnv: WXCLAW_TOKEN
    install:
      - kind: node
        package: "@claw-lab/wxclawbot-cli"
        bins: [wxclawbot]
    os: [macos, linux]
    envVars:
      - name: WXCLAW_TOKEN
        required: false
        description: "覆盖 bot token (bot@im.bot:your-token)"
      - name: WXCLAW_BASE_URL
        required: false
        description: "覆盖 API 端点 (默认: https://ilinkai.weixin.qq.com)"
    author: lroolle
    links:
      homepage: https://github.com/lroolle/wxclawbot-cli
      repository: https://github.com/lroolle/wxclawbot-cli
---

# wxclawbot-send

## 这个技能解决什么问题

微信机器人(iLink Bot)只能被动回复用户消息,不能主动发起对话。
这意味着 agent 没法做定时提醒、告警推送、报告发送等主动触达场景。

这个技能通过 `wxclawbot` CLI 让 agent 能主动给微信用户推送消息,
包括文本、图片、视频、文件。配合 cron 可实现定时任务。

## 前置条件

- Node.js >= 20
- `npm install -g @claw-lab/wxclawbot-cli`
- openclaw-weixin 已登录(凭证在 `~/.openclaw/openclaw-weixin/accounts/`)

验证: `wxclawbot accounts --json`

## 快速上手

```bash
wxclawbot send --text "消息内容" --json
wxclawbot send --file ./photo.jpg --json
wxclawbot send --file ./report.pdf --text "请查收" --json
```

## 什么时候用什么

```
主动发文本消息  → wxclawbot send --text "msg" --json
主动发文件/图片 → wxclawbot send --file ./path --json
检查账号状态    → wxclawbot accounts --json
编程调用        → see references/programmatic-api.md
```

## 命令参考

### send

```bash
wxclawbot send --text "message" --json
wxclawbot send --to "user@im.wechat" --text "你好" --json
wxclawbot send --file ./photo.jpg --json
wxclawbot send --file ./report.pdf --text "请查收" --json
wxclawbot send --file "https://example.com/img.png" --json
echo "日报已生成" | wxclawbot send --json
wxclawbot send --text "test" --dry-run
```

| 参数 | 说明 |
|------|------|
| `--text <msg>` | 消息文本。`"-"` 显式读 stdin |
| `--file <path>` | 本地文件或 URL(图片 / 视频 / 文件) |
| `--to <userId>` | 目标用户 ID。默认: 账号绑定用户 |
| `--account <id>` | 指定账号。默认: 第一个可用的 |
| `--json` | JSON 格式输出。**编程调用必须带上** |
| `--dry-run` | 预览,不发送 |

媒体类型按扩展名自动识别:
- 图片: .png .jpg .jpeg .gif .webp .bmp
- 视频: .mp4 .mov .webm .mkv .avi
- 文件: 其他所有

### accounts

```bash
wxclawbot accounts --json
```

返回: `[{"id":"<botId>-im-bot","configured":true,"baseUrl":"..."}]`

## 账号发现机制

CLI 自动从 `~/.openclaw/openclaw-weixin/accounts/*.json` 发现账号。
每个文件包含 `token`, `baseUrl`, `userId`(默认 `--to` 目标)。

- Bot ID 从 token 运行时提取(不是硬编码的)
- 账号 ID 会在 openclaw-weixin 升级或重新注册后变化
- `--to` 默认是账号文件里的 `userId`(绑定用户)
- 设了 `WXCLAW_TOKEN` 环境变量会覆盖文件发现

### Context Token(主动推送关键)

微信要求 `context_token` 才能主动推送消息。没有它,消息会留在服务器上,
直到用

README.md

# @claw-lab/wxclawbot-cli

[English](./README.en.md) | [npm](https://www.npmjs.com/package/@claw-lab/wxclawbot-cli) | [GitHub](https://github.com/lroolle/wxclawbot-cli) | [ClawHub](https://clawhub.ai/lroolle/wxclawbot-send)

让你的 AI agent 主动给微信用户发消息。文本、图片、视频、文件,想发就发。

## 为什么做这个

> 7)现在还不支持主动定时给你发消息
> 也就是说,它不会像小秘书一样,自己跳出来提醒你。
>
> -- [龙虾接入微信教程](https://mp.weixin.qq.com/s/nYDQ1obQEHe1WavGpNzasQ)

**现在可以了。**

## 安装 / 更新

把下面这段直接发给你的龙虾就行:

```
安装/更新一个技能让你能主动给我发微信。

技能源码:https://github.com/lroolle/wxclawbot-cli
SKILL.md 在仓库根目录,把它放到 skills/wxclawbot-send/SKILL.md
CLI 依赖:npm install -g @claw-lab/wxclawbot-cli
如果你有 clawhub 可以直接:clawhub install wxclawbot-send

装好后用 wxclawbot accounts --json 验证账号是否正常。
```

agent 会自己搞定:下载 SKILL.md、装 CLI 依赖、放到正确的 skills 目录、重新加载。

你不需要碰命令行。你不需要写 cron。你不需要看下面的技术文档。

## 使用场景

你不是在"用 CLI",你是在跟 agent 说话。以下是你可以直接发给龙虾的提示词:

**活着提醒系列:**

> 每 45 分钟提醒我喝水,别客气直接骂

> 每坐满 1 小时提醒我站起来,语气凶一点

> 凌晨 1 点还在跟你聊天直接骂我去睡觉

> 周五 5:55 提醒我下班,不要接新需求

> 工作日 11:15 提醒我点外卖,不然配送排到下午两点

**搬砖告警系列:**

> CI 挂了第一时间微信通知我,告诉我是谁的 commit 炸的

> 有 PR 超过 24 小时没人 review 就催我

> 每次部署完成通知我,成功失败都要说

> 生产环境错误率超过 1% 立刻告警

**老板视角系列:**

> 每天早上 9 点把昨天的核心指标发给我

> 工单超 SLA 4 小时自动升级通知我

> 检测到异常登录立刻告警

> 服务器磁盘超 90% 微信通知我

你说人话,agent 干活。就这么简单。

---

以下是给 agent、脚本和开发者看的技术文档。普通用户到这里就可以关掉了。

## CLI 参考

```bash
wxclawbot send --text "消息内容" --json
wxclawbot send --file ./photo.jpg --json
wxclawbot send --file ./report.pdf --text "请查收" --json
wxclawbot send --to "user@im.wechat" --text "你好" --json
echo "日报已生成" | wxclawbot send --json
wxclawbot send --text "test" --dry-run
```

| 参数 | 说明 |
|------|------|
| `--text <msg>` | 消息文本。`"-"` 显式读 stdin |
| `--file <path>` | 本地文件或 URL(图片 / 视频 / 文件) |
| `--to <userId>` | 目标用户 ID。默认:账号绑定用户 |
| `--account <id>` | 指定账号。默认:第一个可用的 |
| `--json` | JSON 格式输出。**始终带上** |
| `--dry-run` | 预览,不发送 |

媒体类型按扩展名自动识别:

- 图片:.png .jpg .jpeg .gif .webp .bmp
- 视频:.mp4 .mov .webm .mkv .avi
- 文件:其他所有

## 输出格式

```json
{"ok":true,"to":"user@im.wechat","clientId":"..."}
{"ok":false,"error":"ret=-2 (rate limited, try again later)"}
```

退出码:0 = CLI 执行成功,1 = 失败。注意:exit 0 只代表 CLI 跑完了,不代表消息送达。看 `ok` 字段。

## 错误码

| ret | 含义 | 处理 |
|-----|------|------|
| -2 | 频率限制 | 等 5-10 秒重试,别搞紧循环 |
| -14 | 会话过期 | 通过 openclaw 重新登录 |

频率限制:每个机器人账号约 **7 条 / 5 分钟**,服务端限制,所有客户端共享。

## 账号

```bash
wxclawbot accounts --json
```

自动从 `~/.openclaw/openclaw-weixin/accounts/` 发现。环境变量覆盖:

```bash
export WXCLAW_TOKEN="bot@im.bot:your-token"
export WXCLAW_BASE_URL="https://ilinkai.weixin.qq.com"
```

## 编程接口

```typescript
import { WxClawClient } from "@claw-lab/wxclawbot-cli";
import { resolveAccount } from "@claw-lab/wxclawbot-cli/accounts";

const account = resolveAccount();
const client = new WxClawClient({
  baseUrl: account.baseUrl,
  token: account.token,
  botId: account.botId,
});

await client.sendText("user@im.wechat", "你好");
await client.sendFile("user@im.wechat", "./photo.jpg", { text: "请查收" });
```

详见 [references/programmatic-api.md](references/programmatic-api.md)。

## 相关链接

- [npm](https://www.

_meta.json

{
  "ownerId": "kn75s7qhj28cr74d0dqqmb7bbh804744",
  "slug": "wxclawbot-send",
  "version": "0.5.2",
  "publishedAt": 1774597132382
}

references/programmatic-api.md

# wxclaw Programmatic API

## TypeScript Usage

```typescript
import { WxClawClient } from "@claw-lab/wxclawbot-cli";
import { resolveAccount } from "@claw-lab/wxclawbot-cli/accounts";

const account = resolveAccount();
const client = new WxClawClient({
  baseUrl: account.baseUrl,
  token: account.token,
  botId: account.botId,
  contextToken: account.contextToken,
});

const result = await client.sendText("user@im.wechat", "Hello");
// { ok: true, to: "...", clientId: "..." }
```

`contextToken` is required for proactive push notifications. Without it,
messages send successfully but won't push to the user's WeChat client.
`resolveAccount()` auto-resolves it from `{accountId}.context-tokens.json`.

## Account File Format

Accounts are stored at `~/.openclaw/openclaw-weixin/accounts/{accountId}.json`.

Each file contains bot credentials including token, botId, baseUrl, and the
bound user ID (default --to target).

Context tokens are stored separately at `{accountId}.context-tokens.json`
as a `userId → token` map, maintained by openclaw-weixin.

## Package Exports

| Export | Module |
|--------|--------|
| `@claw-lab/wxclawbot-cli` | `WxClawClient` class |
| `@claw-lab/wxclawbot-cli/accounts` | `resolveAccount()`, account discovery |

README.en.md

# @claw-lab/wxclawbot-cli

[简体中文](./README.md) | [npm](https://www.npmjs.com/package/@claw-lab/wxclawbot-cli) | [GitHub](https://github.com/lroolle/wxclawbot-cli) | [ClawHub](https://clawhub.ai/lroolle/wxclawbot-send)

Let your AI agent proactively send WeChat messages. Text, images, video, files -- whatever you need.

## Why This Exists

WeChat bots can only reply. They can't initiate. That's like having a secretary who only talks when spoken to and otherwise sits there staring at the wall.

> "Currently doesn't support proactively sending you messages on a schedule"
>
> -- [Lobster's WeChat Integration Tutorial](https://mp.weixin.qq.com/s/nYDQ1obQEHe1WavGpNzasQ)

**Now it does.**

## Install / Update

Send this to your OpenClaw agent (Lobster):

```
Install/update a skill so you can proactively WeChat me.

Skill source: https://github.com/lroolle/wxclawbot-cli
SKILL.md is at repo root, put it in skills/wxclawbot-send/SKILL.md
CLI dependency: npm install -g @claw-lab/wxclawbot-cli
If you have clawhub: clawhub install wxclawbot-send

Verify with: wxclawbot accounts --json
```

The agent handles the rest: download SKILL.md, install CLI dependency, place it in the right skills directory, reload.

You don't touch the CLI. You don't write cron jobs. You don't need the technical docs below.

## What You Can Do With It

You're not "running commands." You're talking to your agent. These are prompts you send directly:

**Stay-alive reminders:**

> Remind me to drink water every 45 minutes, don't be polite about it

> Every hour of sitting, tell me to get up and move. Be aggressive.

> If I'm still chatting with you after 1 AM, yell at me to go to sleep

> Friday 5:55 PM -- remind me to stop working. Do not accept new tasks.

> Weekdays 11:15 -- remind me to order lunch before delivery queues explode

**DevOps alerts:**

> If CI breaks, WeChat me immediately with whose commit blew it up

> PR sitting unreviewed for 24 hours? Ping me.

> Notify me on every deploy -- success or failure, I want to know

> Production error rate over 1%? Alert me via WeChat, right now

**Business ops:**

> Every morning at 9, send me yesterday's key metrics summary

> Ticket exceeds SLA by 4 hours -- auto-escalate and notify me

> Suspicious login detected? Alert me immediately

> Server disk over 90%? WeChat me

You talk. The agent works. That's the whole idea.

---

Everything below is technical reference for agents, scripts, and developers. Normal humans can stop here.

## CLI Reference

```bash
wxclawbot send --text "message" --json
wxclawbot send --file ./photo.jpg --json
wxclawbot send --file ./report.pdf --text "See attached" --json
wxclawbot send --to "user@im.wechat" --text "Hello" --json
echo "report ready" | wxclawbot send --json
wxclawbot send --text "test" --dry-run
```

| Flag | Description |
|------|-------------|
| `--text <msg>` | Message text. `"-"` to explicitly read stdin |
| `--file <path>` | Local file path or URL (image/video/file) |
| `--to <userId>` | 

Sponsored

Ads related to WeixinClawBot Send and adjacent AI workflows.