@lucasygu/redbook 0.1.14 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
> **"帮我安装 `@lucasygu/redbook` 这个小红书 CLI 工具,然后运行 `redbook whoami` 验证是否能正常连接。GitHub 地址:https://github.com/lucasygu/redbook"**
|
|
12
12
|
>
|
|
13
13
|
> AI 会自动完成安装、验证连接、处理可能的 Cookie 问题。你只需要确保已在 Chrome 中登录 xiaohongshu.com。
|
|
14
|
+
>
|
|
15
|
+
> 安装完成后,试试:**"帮我分析'AI编程'这个话题在小红书上的竞争格局"** —— AI 会自动搜索关键词、分析互动数据、发现头部博主、给出内容建议。
|
|
14
16
|
|
|
15
17
|
## 安装
|
|
16
18
|
|
|
@@ -22,6 +24,16 @@ npm install -g @lucasygu/redbook
|
|
|
22
24
|
|
|
23
25
|
安装后运行 `redbook whoami` 验证连接。如果遇到 macOS 钥匙串弹窗,请点击"始终允许"。CLI 会自动检测所有 Chrome 配置文件,找到你的小红书登录状态。
|
|
24
26
|
|
|
27
|
+
## 能做什么
|
|
28
|
+
|
|
29
|
+
- **话题研究** —— 搜索关键词,分析哪些话题有流量、哪些是蓝海
|
|
30
|
+
- **竞品分析** —— 找到头部博主,对比粉丝量、互动数据、内容风格
|
|
31
|
+
- **爆款拆解** —— 分析爆款笔记的标题钩子、互动比例、评论主题
|
|
32
|
+
- **内容策划** —— 基于数据发现内容机会,生成有数据支撑的选题建议
|
|
33
|
+
- **受众洞察** —— 从互动信号推断目标用户画像
|
|
34
|
+
|
|
35
|
+
通过 AI 助手使用时,这些工作流可以自动串联完成。直接使用 CLI 时,每个命令也可以独立运行。
|
|
36
|
+
|
|
25
37
|
## 快速开始
|
|
26
38
|
|
|
27
39
|
```bash
|
|
@@ -66,7 +78,7 @@ redbook post --title "测试" --body "..." --images img.png --private
|
|
|
66
78
|
| `user <userId>` | 查看用户资料 |
|
|
67
79
|
| `user-posts <userId>` | 列出用户所有笔记 |
|
|
68
80
|
| `feed` | 获取推荐页内容 |
|
|
69
|
-
| `post` |
|
|
81
|
+
| `post` | 发布图文笔记(易触发验证码,详见下方说明) |
|
|
70
82
|
| `topics <关键词>` | 搜索话题/标签 |
|
|
71
83
|
| `analyze-viral <url>` | 分析爆款笔记(钩子、互动、结构) |
|
|
72
84
|
|
|
@@ -86,7 +98,15 @@ redbook post --title "测试" --body "..." --images img.png --private
|
|
|
86
98
|
| `--type <类型>` | `all`(全部)、`video`(视频)、`image`(图文) | `all` |
|
|
87
99
|
| `--page <页码>` | 页码 | `1` |
|
|
88
100
|
|
|
89
|
-
###
|
|
101
|
+
### 分析选项(analyze-viral)
|
|
102
|
+
|
|
103
|
+
| 选项 | 说明 | 默认值 |
|
|
104
|
+
|------|------|--------|
|
|
105
|
+
| `--comment-pages <n>` | 获取评论页数 | `3` |
|
|
106
|
+
|
|
107
|
+
### 发布选项(post)
|
|
108
|
+
|
|
109
|
+
发布功能目前**容易触发验证码**(type=124)。图片上传正常,但发布步骤经常被拦截。如需发布笔记,建议使用浏览器自动化。
|
|
90
110
|
|
|
91
111
|
| 选项 | 说明 |
|
|
92
112
|
|------|------|
|
|
@@ -118,13 +138,19 @@ redbook post --title "测试" --body "..." --images img.png --private
|
|
|
118
138
|
安装后自动注册为 Claude Code 技能。在 Claude Code 中使用 `/redbook` 命令:
|
|
119
139
|
|
|
120
140
|
```
|
|
121
|
-
/redbook search "AI编程"
|
|
122
|
-
/redbook read <url>
|
|
123
|
-
/redbook user <userId>
|
|
124
|
-
/redbook analyze <
|
|
141
|
+
/redbook search "AI编程" # 搜索笔记
|
|
142
|
+
/redbook read <url> # 阅读笔记
|
|
143
|
+
/redbook user <userId> # 查看博主
|
|
144
|
+
/redbook analyze-viral <url> # 分析爆款笔记
|
|
125
145
|
```
|
|
126
146
|
|
|
127
|
-
|
|
147
|
+
技能内置了小红书平台专属的分析模块 —— 关键词矩阵、跨话题热力图、互动信号分类、博主画像、内容机会评分等。你可以直接用自然语言下达复杂任务:
|
|
148
|
+
|
|
149
|
+
- *"分析'AI编程'在小红书的竞争格局,找出蓝海关键词"*
|
|
150
|
+
- *"对比这三个博主的内容策略和互动数据"*
|
|
151
|
+
- *"拆解这篇爆款笔记,告诉我为什么火了"*
|
|
152
|
+
|
|
153
|
+
Claude 会自动组合多个命令,解析 JSON 数据,输出结构化分析报告。
|
|
128
154
|
|
|
129
155
|
## 编程接口
|
|
130
156
|
|
|
@@ -168,6 +194,8 @@ A fast CLI tool for [Xiaohongshu (小红书 / RED)](https://www.xiaohongshu.com)
|
|
|
168
194
|
> **"Install the `@lucasygu/redbook` Xiaohongshu CLI tool and run `redbook whoami` to verify it works. Repo: https://github.com/lucasygu/redbook"**
|
|
169
195
|
>
|
|
170
196
|
> The agent will handle installation, verify the connection, and troubleshoot any cookie issues. Just make sure you're logged into xiaohongshu.com in Chrome first.
|
|
197
|
+
>
|
|
198
|
+
> Once installed, try: **"Analyze the competitive landscape for 'AI编程' on Xiaohongshu"** — the agent will search keywords, analyze engagement data, profile top creators, and suggest content opportunities.
|
|
171
199
|
|
|
172
200
|
## Install
|
|
173
201
|
|
|
@@ -179,6 +207,16 @@ Requires Node.js >= 22. Uses cookies from your Chrome browser session — you mu
|
|
|
179
207
|
|
|
180
208
|
After installing, run `redbook whoami` to verify the connection. If macOS shows a Keychain prompt, click "Always Allow". The CLI auto-detects all Chrome profiles to find your XHS session.
|
|
181
209
|
|
|
210
|
+
## What You Can Do
|
|
211
|
+
|
|
212
|
+
- **Topic research** — Search keywords, analyze which topics have demand vs. gaps
|
|
213
|
+
- **Competitive analysis** — Find top creators, compare followers, engagement, content style
|
|
214
|
+
- **Viral note breakdown** — Analyze title hooks, engagement ratios, comment themes
|
|
215
|
+
- **Content planning** — Discover content opportunities with data-backed topic suggestions
|
|
216
|
+
- **Audience insights** — Infer target audience from engagement signals
|
|
217
|
+
|
|
218
|
+
When used through an AI agent, these workflows chain together automatically. Each CLI command also works standalone.
|
|
219
|
+
|
|
182
220
|
## Quick Start
|
|
183
221
|
|
|
184
222
|
```bash
|
|
@@ -223,7 +261,7 @@ redbook post --title "测试" --body "..." --images img.png --private
|
|
|
223
261
|
| `user <userId>` | Get user profile info |
|
|
224
262
|
| `user-posts <userId>` | List a user's posted notes |
|
|
225
263
|
| `feed` | Get homepage feed |
|
|
226
|
-
| `post` | Publish an image note |
|
|
264
|
+
| `post` | Publish an image note (captcha-prone, see below) |
|
|
227
265
|
| `topics <keyword>` | Search for topics/hashtags |
|
|
228
266
|
| `analyze-viral <url>` | Analyze why a viral note works (hooks, engagement, structure) |
|
|
229
267
|
|
|
@@ -243,8 +281,16 @@ redbook post --title "测试" --body "..." --images img.png --private
|
|
|
243
281
|
| `--type <type>` | `all`, `video`, `image` | `all` |
|
|
244
282
|
| `--page <n>` | Page number | `1` |
|
|
245
283
|
|
|
284
|
+
### Analyze-Viral Options
|
|
285
|
+
|
|
286
|
+
| Option | Description | Default |
|
|
287
|
+
|--------|-------------|---------|
|
|
288
|
+
| `--comment-pages <n>` | Number of comment pages to fetch | `3` |
|
|
289
|
+
|
|
246
290
|
### Post Options
|
|
247
291
|
|
|
292
|
+
Publishing **frequently triggers captcha** (type=124). Image upload works, but the publish step is unreliable. For posting, consider using browser automation instead.
|
|
293
|
+
|
|
248
294
|
| Option | Description |
|
|
249
295
|
|--------|-------------|
|
|
250
296
|
| `--title <title>` | Note title (required) |
|
|
@@ -275,13 +321,19 @@ redbook post --title "测试" --body "..." --images img.png --private
|
|
|
275
321
|
Installs automatically as a Claude Code skill. Use `/redbook` in Claude Code:
|
|
276
322
|
|
|
277
323
|
```
|
|
278
|
-
/redbook search "AI编程"
|
|
279
|
-
/redbook read <url>
|
|
280
|
-
/redbook user <userId>
|
|
281
|
-
/redbook analyze <
|
|
324
|
+
/redbook search "AI编程" # Search notes
|
|
325
|
+
/redbook read <url> # Read a note
|
|
326
|
+
/redbook user <userId> # Creator profile
|
|
327
|
+
/redbook analyze-viral <url> # Analyze a viral note
|
|
282
328
|
```
|
|
283
329
|
|
|
284
|
-
|
|
330
|
+
The skill includes XHS-native analysis modules — keyword engagement matrix, cross-topic heatmaps, engagement signal classification, creator profiling, opportunity scoring, and more. You can give natural language instructions for complex tasks:
|
|
331
|
+
|
|
332
|
+
- *"Analyze the competitive landscape for 'AI编程' on Xiaohongshu and find blue ocean keywords"*
|
|
333
|
+
- *"Compare the content strategies of these three creators"*
|
|
334
|
+
- *"Break down this viral note and tell me why it worked"*
|
|
335
|
+
|
|
336
|
+
Claude will automatically combine multiple commands, parse JSON data, and produce structured analysis reports.
|
|
285
337
|
|
|
286
338
|
## Programmatic Usage
|
|
287
339
|
|