Auto-Redbook-Skills: Automate Xiaohongshu Content Creation
Auto‑Redbook‑Skills: Automate Xiaohongshu Content Creation
Xiaohongshu (Little Red Book) has become a premier platform for lifestyle and shopping content. The Auto‑Redbook‑Skills repository gives creators a head‑start by turning plain Markdown into ready‑to‑publish posts, complete with styled images and optional auto‑posting.
Why Use Auto‑Redbook‑Skills?
- Speed – Create a draft, render all images, and publish in seconds.
- Consistency – All images share a unified card layout and brand‑sensitive theme.
- Flexibility – Switch between Python or Node.js tooling, choose themes, adjust pagination, and control image dimensions.
- Open‑Source – Fork, modify, or contribute. The MIT license makes it safe for commercial use.
Core Features
| Feature | Description |
|---|---|
| 8 Built‑in Themes | Default‐gray, Playful Geometric, Neo‑Brutalism, Botanical, Professional, Retro, Terminal, Sketch |
| 4 Pagination Modes | separator, auto‑fit, auto‑split, dynamic |
| Custom Width/Height | Override defaults (1080×1440) to match platform specs |
| Auto‑Publishing | Optional script that sends cookies‑based requests to Xiaohongshu API |
| Cross‑Platform | Works on Windows, macOS, Linux; requires Playwright for headless browser rendering |
Getting Started
1. Clone the Repository
git clone https://github.com/comeonzhj/Auto-Redbook-Skills.git
cd Auto-Redbook-Skills
2. Install Dependencies
Python
pip install -r requirements.txt
playwright install chromium
Node.js
npm install
npx playwright install chromium
Tip: Store the repository under your agent’s skill directory (e.g.,
~/.claude/skills/).
Rendering Images
The heart of the workflow is the rendering script. Pick the language that suits you.
Python
# Default theme + manual page break
python scripts/render_xhs.py demos/content.md
# Automatic split (recommended for long content)
python scripts/render_xhs.py demos/content.md -m auto-split
# Change theme
python scripts/render_xhs.py demos/content.md -t playful-geometric -m auto-split
# Custom dimensions & DPR
python scripts/render_xhs.py demos/content.md -t retro -m dynamic --width 1080 --height 1440 --max-height 2160 --dpr 2
Node.js
# Default theme + manual page break
node scripts/render_xhs.js demos/content.md
# Theme selection + auto‑split
node scripts/render_xhs.js demos/content.md -t terminal -m auto-split
After execution you’ll find a cover.png and one or more card_X.png files in your working directory.
Publishing to Xiaohongshu
The publish script uses your browser‑obtained cookie to authenticate.
-
Copy the example env file and fill in your cookie string:
cp env.example.txt .env # Edit .env → XHS_COOKIE=your_cookie_string_here -
Run the publish script:
python scripts/publish_xhs.py \ --title "Your Post Title" \ --desc "Optional description" \ --images cover.png card_1.png card_2.png
Optional flags:
- --private – publish as a private note.
- --post-time "2024-01-01 12:00:00" – schedule future posting.
- --dry-run – test without actual publish.
Security Note: Never commit
.envor cookie strings to version control.
Contributing to Auto‑Redbook‑Skills
- Fork the repository.
- Create a feature/bug‑fix branch.
- Follow the existing coding style (Python 3.10+, Node 18+). |
- Submit a pull request – we welcome theme additions, pagination tweaks, or bug fixes.
The contributor guide is in CONTRIBUTING.md.
Bottom Line
Auto‑Redbook‑Skills packs Xiaohongshu automation into a one‑click solution. Whether you’re a solo content creator or part of a marketing team, the ability to automate rendering, styling, and publishing dramatically reduces manual overhead. Fork the repo, try a demo run, and see how fast you can transform a Markdown note into a polished, ready‑to‑publish Xiaohongshu post.
Happy content‑creating!