Xiaohongshu Publisher Skill (小红书发布器)
English | 中文
English
Publish images and notes to Xiaohongshu (小红书) with one command. Uses CDP mode to connect to your existing browser session.
v3.0.0 — Now using agent-browser with CDP mode for seamless browser automation
The Problem
Publishing to Xiaohongshu manually is tedious:
| Pain Point | Description |
|---|
| Login Hassle | Must scan QR code every session |
| Multiple Images | Upload images one by one |
| Content Formatting | Copy-paste text, add tags manually |
| Time Consuming | 5-10 minutes per post |
Time Comparison
| Task | Manual | With This Skill |
|---|
| Login | 30 sec - 1 min | Login once in browser, reuse session |
| Image upload (5 images) | 2-3 min | 30 sec |
| Title & content | 1-2 min | 10 sec |
| Total | 5-10 min | 1-2 min |
5x efficiency improvement
The Solution
This skill uses CDP (Chrome DevTools Protocol) mode to connect to your existing browser:
1. Start Chrome with debug port
2. Login to Xiaohongshu once in browser
3. AI connects to your browser session
4. Automates publishing while you stay logged in
Images/Markdown File
↓ Python parsing
Structured Data (title, content, images, tags)
↓ agent-browser --cdp 9222
Your Chrome Browser (already logged in)
↓
Draft/Published Note
Key Features
- 🔌 CDP Mode: Connect to your existing browser via
--cdp 9222 flag
- 🔐 Session Persistence: Login once in Chrome, reuse session indefinitely
- 📤 Multi-Image Upload: Upload up to 18 images at once
- 📝 Content Parsing: Extract title, content, and tags from Markdown
- ✅ Safe by Default: Saves as draft unless you specify publish
- 🛠️ agent-browser CLI: Simple command-line interface, no MCP server needed
What's New in v3.0.0
| Feature | v2.x | v3.0 |
|---|
| Connection mode | New browser each time | CDP (connect to existing) |
| Login handling | QR code detection + auth files | Login once in your browser |
| Session management | Auth state files | Browser's own session |
| Command format | npx agent-browser open ... | npx agent-browser --cdp 9222 open ... |
Requirements
| Requirement | Details |
|---|
| Claude Code | claude.ai/code |
| Chrome | Launch with --remote-debugging-port=9222 |
| Python 3.9+ | With dependencies below |
| macOS | Currently macOS only |
# Install Python dependencies
pip install Pillow pyobjc-framework-Cocoa
Pre-requisite: Launch Chrome with Debug Port
Before using this skill, start Chrome with remote debugging:
# macOS
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
Tip: Add an alias to your shell config (~/.zshrc or ~/.bashrc):
alias chrome-debug='/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222'
Then login to Xiaohongshu once: https://creator.xiaohongshu.com/publish/publish
Tip: After login, you can minimize the browser to the Dock. It must stay running, but you don't need to see it.
Installation
Method 1: Git Clone (Recommended)
git clone https://github.com/wshuyi/xiaohongshu-publisher-skill.git
cp -r xiaohongshu-publisher-skill/skills/xiaohongshu-publisher ~/.claude/skills/
Method 2: Plugin Marketplace
/plugin marketplace add wshuyi/xiaohongshu-publisher-skill
/plugin install xiaohongshu-publisher@wshuyi/xiaohongshu-publisher-skill
Usage
Natural Language
发布这些图片到小红书: /path/to/photo1.jpg, /path/to/photo2.jpg
标题是"周末探店"
Publish /path/to/note.md to Xiaohongshu
帮我把这篇笔记发到小红书,存草稿就行
Skill Command
/xiaohongshu-publisher /path/to/note.md
Workflow Steps
[1/5] Verify browser connection...
→ Connect to Chrome via CDP (port 9222)
→ Check if already logged in
[2/5] Parse content...
→ Extract title, content, images, tags
[3/5] Upload images...
→ Upload all images (1-18 supported)
[4/5] Fill title and content...
→ Add title, description, tags
[5/5] Save draft...
→ ✅ Review and publish manually
→ (Or publish directly if requested)
Multi-Account Support
With CDP mode, account switching is handled by Chrome profiles:
- Use Chrome profiles - Create different Chrome profiles for different accounts
- Start Chrome with profile - Launch Chrome with the desired profile before connecting
- Or switch accounts in browser - Login/logout in your browser, then use the skill
Content Formats
From Images + Text
发布这些图片到小红书:
- /path/to/photo1.jpg
- /path/to/photo2.jpg
- /path/to/photo3.jpg
标题: 周末好去处
内容: 发现了一家超赞的咖啡店...
标签: 咖啡, 探店, 周末