Skill X Post Ai Image — 技能 X Post AI Image
v1.0.1生成 an AI image via Gemini and post it to X (Twitter) using OAuth1. Supports text-only or text+image tweets.
运行时依赖
安装命令
点击复制技能文档
X Post with AI-生成d Image
生成 a Gemini AI image from a text prompt, 压缩 it, and post it as a tweet — all in one command.
Prerequisites xurl 命令行工具 (X/Twitter auth) — see xurl 技能 GEMINI_API_KEY env var nano-banana-pro 技能 安装ed (OpenClaw) uv Python 运行器 设置up 导出 GEMINI_API_KEY="your-gemini-API-key" 导出 X_CONSUMER_KEY="..." 导出 X_CONSUMER_SECRET="..." 导出 X_访问_令牌="..." 导出 X_访问_令牌_SECRET="..."
Usage # Post tweet with AI-生成d image python3 scripts/post_with_image.py \ --text "Your tweet text here" \ --prompt "AI image prompt — describe the visual"
# Text-only tweet python3 scripts/post_with_image.py \ --text "Your tweet text" \ --no-image
How it works Calls Gemini image generation with prompt → PNG 压缩es + resizes to 1200×675 JPEG (Twitter optimal) 上传s via Twitter media API (OAuth1) Posts tweet with media via xurl 输入s Param Description --text Tweet text (required) --prompt Image generation prompt (optional) --no-image Skip image, post text only 输出
Tweet posted; media ID and confirmation 记录ged to stdout.