Docs
Refer friends. Keep the rewards coming!Your friend can unlock up to 10M tokens · earn up to 30% revenue share.
+500K TokensGenerate link

多平台发布 (Archive)

Archived original-language source from the legacy CrabClaw docs. This page is intentionally not machine-translated.

本教程介绍如何使用 Crab Claw 的媒体子系统将内容一键发布到多个社交平台。

前置条件

  • Crab Claw 已安装并运行
  • 浏览器自动化已配置(参见 浏览器自动化
  • 至少配置了一个媒体平台账号

第一步:配置媒体账号

编辑 ~/.crabclaw/crabclaw.json

json
{
  "media": {
    "enabled": true,
    "publisher_profiles": {
      "xiaohongshu": {
        "enabled": true,
        "account": "your-xhs-account"
      }
    }
  }
}
{
  "media": {
    "enabled": true,
    "publisher_profiles": {
      "xiaohongshu": {
        "enabled": true,
        "account": "your-xhs-account"
      }
    }
  }
}

第二步:登录平台

在聊天中告诉智能体登录目标平台:

shell
> 登录小红书账号
> 登录小红书账号

系统会:

  1. 打开浏览器并导航到登录页面
  2. 等待你完成扫码或密码登录
  3. 自动保存登录态(Cookie)

登录态保存在 ~/.crabclaw/state/_media/ 目录下。

第三步:创建并发布内容

通过聊天交互

shell
> 帮我写一篇关于 AI 工具的小红书笔记并发布
> 帮我写一篇关于 AI 工具的小红书笔记并发布

智能体会:

  1. 起草内容
  2. 请求你确认(plan_confirm 审批)
  3. 确认后自动发布到目标平台

通过组合技能

创建一个发布技能 docs/skills/media/cross-publish/SKILL.md

yaml
---
name: media-cross-publish
description: "跨平台内容发布"
metadata:
  crabclaw:
    tool_schema:
      input:
        type: object
        properties:
          content: { type: string, description: "发布内容" }
          platforms: { type: array, items: { type: string } }
      steps:
        - action: "发布内容"
          tool: message
          loop_over: "{{input.platforms}}"
          input_map:
            channel: "{{item}}"
            text: "{{input.content}}"
          approval: plan_confirm
          on_error: skip
---

将内容发布到指定的多个平台。
---
name: media-cross-publish
description: "跨平台内容发布"
metadata:
  crabclaw:
    tool_schema:
      input:
        type: object
        properties:
          content: { type: string, description: "发布内容" }
          platforms: { type: array, items: { type: string } }
      steps:
        - action: "发布内容"
          tool: message
          loop_over: "{{input.platforms}}"
          input_map:
            channel: "{{item}}"
            text: "{{input.content}}"
          approval: plan_confirm
          on_error: skip
---

将内容发布到指定的多个平台。

编译后使用:

bash
crabclaw skills codegen
crabclaw skills codegen

发布策略

审批控制

所有发布操作默认需要 plan_confirm 审批。智能体在发布前会:

  1. 展示内容预览
  2. 通过当前消息频道请求确认
  3. 用户确认后才执行发布

执行预算

系统内置每日限额防止过度发布:

限制默认值
每日发布次数3 次
每日草稿次数10 次
发布时间窗口9:00 - 22:00

定时发布

通过 cron 定时触发:

json
{
  "cron": {
    "jobs": [
      {
        "name": "daily-publish",
        "schedule": "0 10 * * *",
        "action": "agent",
        "message": "执行今日内容发布计划"
      }
    ]
  }
}
{
  "cron": {
    "jobs": [
      {
        "name": "daily-publish",
        "schedule": "0 10 * * *",
        "action": "agent",
        "message": "执行今日内容发布计划"
      }
    ]
  }
}

常见问题

登录态过期?

  • 重新执行登录流程: "重新登录小红书"
  • Cookie 过期时间因平台而异

发布失败?

  • 检查浏览器是否正常运行: crabclaw browser status
  • 检查账号登录态是否有效
  • 查看日志: crabclaw logs