用途
twitter-automation 用于通过 inference.sh CLI(命令名为 belt)自动化 Twitter/X 上的操作,涵盖内容发布、互动(点赞、转推)以及用户管理(关注、获取资料、发送私信)。
主要能力
该技能提供以下应用(App):
| 应用 | App ID | 说明 |
|---|---|---|
| Post Tweet | x/post-tweet | 发布纯文字推文 |
| Create Post | x/post-create | 发布带媒体的内容 |
| Like Post | x/post-like | 点赞推文 |
| Retweet | x/post-retweet | 转推帖子 |
| Delete Post | x/post-delete | 删除推文 |
| Get Post | x/post-get | 按 ID 获取推文 |
| Send DM | x/dm-send | 发送私信 |
| Follow User | x/user-follow | 关注用户 |
| Get User | x/user-get | 获取用户资料 |
使用方式
先安装 belt CLI 技能:
npx skills add belt-sh/cli
该技能依赖 inference.sh CLI(belt)。使用前需登录:
belt login
随后通过 belt app run <app-id> --input '<json>' 的形式调用各应用。以下为文档中的示例:
发布推文:
belt app run x/post-tweet --input '{"text": "Just shipped a new feature! 🚀"}'
发布带媒体的内容,可先生成输入模板再编辑:
belt app sample x/post-create --save input.json
# Edit input.json:
# {
# "text": "Check out this AI-generated image!",
# "media_url": "https://your-image-url.jpg"
# }
belt app run x/post-create --input input.json
点赞推文:
belt app run x/post-like --input '{"tweet_id": "1234567890"}'
转推:
belt app run x/post-retweet --input '{"tweet_id": "1234567890"}'
发送私信:
belt app run x/dm-send --input '{
"recipient_id": "user_id_here",
"text": "Hey! Thanks for the follow."
}'
关注用户:
belt app run x/user-follow --input '{"username": "elonmusk"}'
获取用户资料:
belt app run x/user-get --input '{"username": "OpenAI"}'
获取推文详情:
belt app run x/post-get --input '{"tweet_id": "1234567890"}'
删除推文:
belt app run x/post-delete --input '{"tweet_id": "1234567890"}'
组合工作流示例
生成 AI 图片并发布:
# 1. Generate image
belt app run falai/flux-dev-lora --input '{"prompt": "sunset over mountains"}' > image.json
# 2. Post to Twitter with the image URL
belt app run x/post-create --input '{
"text": "AI-generated art of a sunset 🌅",
"media_url": "<image-url-from-step-1>"
}'
生成并发布视频:
# 1. Generate video
belt app run google/veo-3-1-fast --input '{"prompt": "waves on a beach"}' > video.json
# 2. Post to Twitter
belt app run x/post-create --input '{
"text": "AI-generated video 🎬",
"media_url": "<video-url-from-step-1>"
}'
相关技能
# Full platform skill (all apps)
npx skills add inference-sh/skills@infsh-cli
# Image generation (create images to post)
npx skills add inference-sh/skills@ai-image-generation
# Video generation (create videos to post)
npx skills add inference-sh/skills@ai-video-generation
# AI avatars (create presenter videos)
npx skills add inference-sh/skills@ai-avatar-video
浏览全部应用:
belt app list
适用场景
- 通过命令行批量或脚本化地发布推文、带图片或视频的内容。
- 自动化互动操作,如点赞、转推。
- 自动化用户相关操作,如关注、获取用户资料、发送私信。
- 与图像/视频生成应用串联,实现“先生成素材,再发布”的工作流。
限制
资料中仅展示了上述命令与示例,未提供关于账号权限、API 配额、速率限制、收费与价格的说明,相关信息暂未提供。使用时需先完成 belt CLI 安装与 belt login 登录。