Install
openclaw skills install xhs-auto-publishClawHub Security found sensitive or high-impact capabilities. Review the scan results before using.
Automate publishing image+text posts (图文笔记) on Xiaohongshu (小红书) creator platform. Use when the user wants to publish a Xiaohongshu post, create XHS content, auto-post to 小红书, or schedule social media posts for the Chinese market. Supports multi-image upload, title, body text, and hashtags. Requires a browser with CDP (Chrome DevTools Protocol) already logged in to creator.xiaohongshu.com.
openclaw skills install xhs-auto-publishPublish image+text posts to Xiaohongshu via browser automation. No API key needed — uses CDP to control an already-logged-in browser.
npm install -g playwright-corecreator.xiaohongshu.com in that browserFor OpenClaw users: the managed browser (profile="openclaw") provides CDP automatically at http://127.0.0.1:18800.
node scripts/publish.js \
--title "你的标题(20字以内)" \
--body "正文内容(1000字以内)" \
--images cover.png,slide2.png,slide3.png \
--hashtags "AI绘画,独立开发" \
--cdp-url http://127.0.0.1:18800
This auto-publishes the post. Add --dry-run to preview without publishing.
| Flag | Description | Required |
|---|---|---|
--title <text> | Post title, max 20 Chinese chars | ✅ |
--body <text> | Post body, max 1000 chars | ✅* |
--body-file <path> | Read body from a text file | ✅* |
--images <paths> | Comma-separated image paths (1-18) | ✅ |
--hashtags <tags> | Comma-separated hashtags (auto-prefixed with #) | Optional |
--cdp-url <url> | CDP endpoint (default: http://127.0.0.1:9222, or XHS_CDP_URL env) | Optional |
--dry-run | Preview only, skip publish (default: auto-publish) | Optional |
--screenshot <path> | Save preview screenshot path | Optional |
*One of --body or --body-file is required (unless using --hashtags alone).
creator.xiaohongshu.com/publish/publish--publish first to verify via screenshot| Problem | Solution |
|---|---|
| "Cannot connect to CDP" | Ensure browser is running with remote debugging. For OpenClaw: check openclaw browser status |
| "Redirected" / not logged in | Open the browser manually and log in to creator.xiaohongshu.com |
| Title input not found | Page may not have loaded. Increase wait time or check network |
| Images fail to upload | Ensure images are PNG/JPG/WebP and under 20MB each |