用途
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 x/post-tweet --input '{"text": "Hello from inference.sh!"}'
示例
发布推文:
belt app run x/post-tweet --input '{"text": "Just shipped a new feature! 🚀"}'
发布带媒体的帖子:
belt app sample x/post-create --save input.json
# 编辑 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. 生成图像
belt app run falai/flux-dev-lora --input '{"prompt": "sunset over mountains"}' > image.json
# 2. 使用图像 URL 发布到 Twitter
belt app run x/post-create --input '{
"text": "AI-generated art of a sunset 🌅",
"media_url": "<image-url-from-step-1>"
}'
工作流:生成并发布视频
# 1. 生成视频
belt app run google/veo-3-1-fast --input '{"prompt": "waves on a beach"}' > video.json
# 2. 发布到 Twitter
belt app run x/post-create --input '{
"text": "AI-generated video 🎬",
"media_url": "<video-url-from-step-1>"
}'
相关技能
# 完整平台技能(所有应用)
npx skills add inference-sh/skills@infsh-cli
# 图像生成(创建要发布的图像)
npx skills add inference-sh/skills@ai-image-generation
# 视频生成(创建要发布的视频)
npx skills add inference-sh/skills@ai-video-generation
# AI 虚拟形象(创建主播视频)
npx skills add inference-sh/skills@ai-avatar-video
浏览所有应用:
belt app list
文档
- X.com Integration - 设置 Twitter/X 集成
- X.com Integration Example - 完整的 Twitter 工作流
- Apps Overview - 了解应用生态系统
适用场景
适用于需要通过命令行自动化执行 Twitter/X 发帖、互动(点赞、转推)、用户管理(关注、获取资料)以及发送私信的场景,也适合与 AI 图像、视频生成技能组合,实现自动生成内容并发布的工作流。
限制
使用前需要安装 inference.sh CLI(belt)并完成登录。具体平台支持范围、调用频率限制、收费与价格等信息暂未提供。