多平台发布 (Archive)
Archived original-language source from the legacy CrabClaw docs. This page is intentionally not machine-translated.
本教程介绍如何使用 Crab Claw 的媒体子系统将内容一键发布到多个社交平台。
前置条件
- Crab Claw 已安装并运行
- 浏览器自动化已配置(参见 浏览器自动化)
- 至少配置了一个媒体平台账号
第一步:配置媒体账号
编辑 ~/.crabclaw/crabclaw.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"
}
}
}
}第二步:登录平台
在聊天中告诉智能体登录目标平台:
> 登录小红书账号> 登录小红书账号系统会:
- 打开浏览器并导航到登录页面
- 等待你完成扫码或密码登录
- 自动保存登录态(Cookie)
登录态保存在 ~/.crabclaw/state/_media/ 目录下。
第三步:创建并发布内容
通过聊天交互
> 帮我写一篇关于 AI 工具的小红书笔记并发布> 帮我写一篇关于 AI 工具的小红书笔记并发布智能体会:
- 起草内容
- 请求你确认(
plan_confirm审批) - 确认后自动发布到目标平台
通过组合技能
创建一个发布技能 docs/skills/media/cross-publish/SKILL.md:
---
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
---
将内容发布到指定的多个平台。编译后使用:
crabclaw skills codegencrabclaw skills codegen发布策略
审批控制
所有发布操作默认需要 plan_confirm 审批。智能体在发布前会:
- 展示内容预览
- 通过当前消息频道请求确认
- 用户确认后才执行发布
执行预算
系统内置每日限额防止过度发布:
| 限制 | 默认值 |
|---|---|
| 每日发布次数 | 3 次 |
| 每日草稿次数 | 10 次 |
| 发布时间窗口 | 9:00 - 22:00 |
定时发布
通过 cron 定时触发:
{
"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