lucas@oss ~/projects/redbook[EN]
 ██████╗  ███████╗ ██████╗  ██████╗   ██████╗   ██████╗  ██╗  ██╗
 ██╔══██╗ ██╔════╝ ██╔══██╗ ██╔══██╗ ██╔═══██╗ ██╔═══██╗ ██║ ██╔╝
 ██████╔╝ █████╗   ██║  ██║ ██████╔╝ ██║   ██║ ██║   ██║ █████╔╝ 
 ██╔══██╗ ██╔══╝   ██║  ██║ ██╔══██╗ ██║   ██║ ██║   ██║ ██╔═██╗ 
 ██║  ██║ ███████╗ ██████╔╝ ██████╔╝ ╚██████╔╝ ╚██████╔╝ ██║  ██╗
 ╚═╝  ╚═╝ ╚══════╝ ╚═════╝  ╚═════╝   ╚═════╝   ╚═════╝  ╚═╝  ╚═╝
  ██████╗ ██╗      ██╗
 ██╔════╝ ██║      ██║
 ██║      ██║      ██║
 ██║      ██║      ██║
 ╚██████╗ ███████╗ ██║
  ╚═════╝ ╚══════╝ ╚═╝

redbook

小红书命令行工具。Cookie 认证,零配置。

搜索笔记、阅读内容、分析博主、发布图文。使用浏览器 Cookie 认证,无需 API Key。

──

快速开始

────────────────────────────────────────────────────────────
$ npm install -g @lucasygu/redbook
$ redbook whoami
──

命令

────────────────────────────────────────────────────────────
whoami检查连接和当前用户
search <keyword>搜索笔记
read <url>阅读单篇笔记
comments <url>获取笔记评论
user <userId>查看用户资料
user-posts <userId>列出用户所有笔记
feed获取推荐页内容
topics <keyword>搜索话题标签
post发布图文笔记
──

工作原理

────────────────────────────────────────────────────────────

Cookie 认证

通过 sweet-cookie 从 Chrome 读取会话 Cookie。无需 API Key、无需浏览器自动化、无需 headless Chrome —— 纯 HTTP 请求。

双签名系统

主 API(edith.xiaohongshu.com)使用 144 字节 x-s 签名读取数据。创作者 API(creator.xiaohongshu.com)使用 AES-128-CBC 签名发布内容。

Claude Code 技能

安装后自动注册为 Claude Code 技能。在 Claude Code 中使用 /redbook 进行 AI 驱动的研究 —— 竞品分析、博主研究、话题调研。