redbook  by lucasygu

Automate Xiaohongshu content analysis and workflows with an AI-powered CLI

Created 2 months ago
253 stars

Top 99.3% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

Redbook is a powerful Command Line Interface (CLI) tool designed for interacting with Xiaohongshu (RED) content. It enables users and AI agents to search notes, analyze creators and topics, extract content templates, manage comments, and even render Markdown into Xiaohongshu-style image cards. By leveraging browser cookies for authentication, it bypasses the need for API keys, offering a direct and efficient way to access and process Xiaohongshu data for research, competitive analysis, and content strategy development.

How It Works

Redbook operates by reading authentication cookies directly from a user's Chrome browser session. It employs a three-tier cookie extraction strategy, including direct database access (sweet-cookie), a headless Chrome DevTools Protocol fallback for newer Chrome versions, and manual cookie string input. API requests are signed using TypeScript implementations of Xiaohongshu's proprietary signing algorithms for both the main API (using an x-s signature) and the creator API (using AES-128-CBC). The tool's core functionality is built around 13 composable analysis modules (A-M) that facilitate deep dives into keyword performance, audience insights, content trends, and creator strategies.

Quick Start & Requirements

  • Installation: Install globally via npm (npm install -g @lucasygu/redbook) or through the OpenClaw ecosystem (clawhub install redbook).
  • Prerequisites: Requires Node.js version 22 or higher. Users must be logged into xiaohongshu.com in their Chrome browser.
  • OS Support: macOS, Windows, and Linux.
  • Authentication: Relies on Chrome browser cookies. Specific handling is included for macOS Keychain prompts and Windows Chrome 127+ App-Bound Encryption.
  • AI Integration: Seamlessly integrates with AI coding assistants like Claude Code and OpenClaw, allowing natural language commands.
  • Documentation: Links to GitHub repository are available.

Highlighted Details

  • Comprehensive Analysis: Offers modules for topic research, competitive analysis, viral note breakdown, audience inference, and content planning.
  • Content Creation Aids: Includes functionality to extract viral content templates and render Markdown into Xiaohongshu-style PNG image cards with multiple themes.
  • Automation & Management: Supports comment management, including batch replies with configurable strategies (questions, top-engaged, unanswered) and rate-limit detection for notes.
  • Cookie-Based Auth: Eliminates the need for API keys by utilizing browser cookies.

Maintenance & Community

The project is integrated with AI agent ecosystems like Claude Code and OpenClaw, indicating active development and community interest in leveraging its capabilities within broader AI workflows. Specific details on core maintainers or community forums beyond these integrations are not explicitly detailed in the README.

Licensing & Compatibility

  • License: MIT License.
  • Compatibility: The MIT license permits commercial use and integration into closed-source projects. However, the tool relies on unofficial Xiaohongshu APIs, which are subject to change or blocking by the platform.

Limitations & Caveats

The tool utilizes unofficial APIs, meaning Xiaohongshu could alter or disable them at any time, potentially breaking functionality. The post command for publishing notes is noted as unreliable and prone to triggering CAPTCHAs. Users must exercise caution regarding Xiaohongshu's rate limits, even with the tool's built-in safety measures like randomized reply delays.

Health Check
Last Commit

2 weeks ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
0
Star History
56 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.