Installs into .claude/skills of the current project.
Are you the author of Twitter Automation?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/huawolf-twitter-automation)
---
name: twitter-automation
description: 通过 inference.sh CLI 对 Twitter/X 进行一站式自动化管理,支持发推、带媒体内容发布、点赞、转发、私信、关注用户及获取用户资料等操作,适用于社交媒体内容排期、互动机器人或粉丝增长等场景。
allowed-tools: Bash(infsh *)
title: Twitter运营
example: 向已绑定的 Twitter 账号发布一条推文:“我们的新产品已正式上线!欢迎体验 🚀”。
version: 1.0.0
---
# Twitter/X Automation
Automate Twitter/X via [inference.sh](https://inference.sh) CLI.

## Authentication
To use this skill, the agent must be logged in to `inference.sh`.
### Installing inference.sh CLI
**macOS/Linux:**
```bash
curl -fsSL https://cli.inference.sh | sh
```
**Windows (PowerShell):**
```powershell
iwr -useb https://cli.inference.sh/install.ps1 | iex
```
**Windows (Manual):**
1. Download the binary from [dist.inference.sh](https://dist.inference.sh)
2. Add to PATH or run from the downloaded directory
> **Install note:** The install script only detects your OS/architecture, downloads the matching binary from `dist.inference.sh`, and verifies its SHA-256 checksum. No elevated permissions or background processes. [Manual install & verification](https://dist.inference.sh/cli/checksums.txt) available.
### Non-interactive Login (Recommended for Bots)
If the agent is not logged in (check with `infsh me`), ask the user for an **API Key** and run:
```bash
infsh login --key YOUR_API_KEY
```
### How to get an API Key
Guide the user to generate an API Key at: [https://app.inference.sh/settings/keys](https://app.inference.sh/settings/keys)
## Available Apps
| App | App ID | Description |
|-----|--------|-------------|
| Post Tweet | `x/post-tweet` | Post text tweets |
| Create Post | `x/post-create` | Post with media |
| Like Post | `x/post-like` | Like a tweet |
| Retweet | `x/post-retweet` | Retweet a post |
| Delete Post | `x/post-delete` | Delete a tweet |
| Get Post | `x/post-get` | Get tweet by ID |
| Send DM | `x/dm-send` | Send direct message |
| Follow User | `x/user-follow` | Follow a user |
| Get User | `x/user-get` | Get user profile |
## Examples
> **Windows Note:** In Windows CMD, use double quotes for the outer string and escape inner quotes with backslash. In PowerShell, you can use single quotes like in Unix/Mac.
### Post a Tweet
**Unix/Mac/PowerShell:**
```bash
infsh app run x/post-tweet --input '{"text": "Just shipped a new feature! 🚀"}'
```
**Windows CMD:**
```cmd
infsh app run x/post-tweet --input "{\"text\": \"Just shipped a new feature! 🚀\"}"
```
### Post with Media
```bash
infsh 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"
# }
infsh app run x/post-create --input input.json
```
### Like a Tweet
```bash
infsh app run x/post-like --input '{"tweet_id": "1234567890"}'
```
### Retweet
```bash
infsh app run x/post-retweet --input '{"tweet_id": "1234567890"}'
```
### Send a DM
**Unix/Mac/PowerShell:**
```bash
infsh app run x/dm-send --input '{
"recipient_id": "user_id_here",
"text": "Hey! Thanks for the follow."
}'
```
**Windows CMD:**
```cmd
infsh app run x/dm-send --input "{\"recipient_id\": \"user_id_here\", \"text\": \"Hey! Thanks for the follow.\"}"
```
### Follow a User
```bash
infsh app run x/user-follow --input '{"username": "elonmusk"}'
```
### Get User Profile
```bash
infsh app run x/user-get --input '{"username": "OpenAI"}'
```
### Get Tweet Details
```bash
infsh app run x/post-get --input '{"tweet_id": "1234567890"}'
```
### Delete a Tweet
```bash
infsh app run x/post-delete --input '{"tweet_id": "1234567890"}'
```
## Workflow: Generate AI Image and Post
**Unix/Mac/PowerShell:**
```bash
# 1. Generate image
infsh app run falai/flux-dev-lora --input '{"prompt": "sunset over mountains"}' > image.json
# 2. Post to Twitter with the image URL
infsh app run x/post-create --input '{
"text": "AI-generated art of a sunset 🌅",
"media_url": "<image-url-from-step-1>"
}'
```
**Windows CMD:**
```cmd
REM 1. Generate image
infsh app run falai/flux-dev-lora --input "{\"prompt\": \"sunset over mountains\"}" > image.json
REM 2. Post to Twitter with the image URL
infsh app run x/post-create --input "{\"text\": \"AI-generated art of a sunset 🌅\", \"media_url\": \"<image-url-from-step-1>\"}"
```
## Workflow: Generate and Post Video
**Unix/Mac/PowerShell:**
```bash
# 1. Generate video
infsh app run google/veo-3-1-fast --input '{"prompt": "waves on a beach"}' > video.json
# 2. Post to Twitter
infsh app run x/post-create --input '{
"text": "AI-generated video 🎬",
"media_url": "<video-url-from-step-1>"
}'
```
**Windows CMD:**
```cmd
REM 1. Generate video
infsh app run google/veo-3-1-fast --input "{\"prompt\": \"waves on a beach\"}" > video.json
REM 2. Post to Twitter
infsh app run x/post-create --input "{\"text\": \"AI-generated video 🎬\", \"media_url\": \"<video-url-from-step-1>\"}"
```
## Related Skills
```bash
# Full platform skill (all 150+ apps)
npx skills add inference-sh/skills@inference-sh
# 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
```
Browse all apps: `infsh app list`
## Documentation
- [X.com Integration](https://inference.sh/docs/integrations/x) - Setting up Twitter/X integration
- [X.com Integration Example](https://inference.sh/docs/examples/x-integration) - Complete Twitter workflow
- [Apps Overview](https://inference.sh/docs/apps/overview) - Understanding the app ecosystem