ZJU-REAL/Easel / skills/builtin/skill-xhs-analyzer
redbook
Flagged小红书内容分析:搜索笔记、拉取互动数据、分析爆款规律、创作者画像、限流检测,支持 CLI 自动化操作。 当用户说"小红书数据分析""小红书爆款分析""笔记数据""小红书限流检测""小红书创作者画像""分析小红书账号"时使用。 发布与日常互动运营请用 skill-xhs-publisher。
| File | Kind | Size |
|---|---|---|
| .github/workflows/npm-publish.yml | config | 3.8 KB |
| EASEL-META.md | markdown | 2.1 KB |
| SKILL.md | skill md | 5.2 KB |
| package-lock.json | manifest | 36.6 KB |
| package.json | manifest | 1.6 KB |
| references/commands.md | markdown | 4.4 KB |
| references/modules.md | markdown | 6.2 KB |
| references/platform-signals.md | markdown | 1.7 KB |
| references/research-loop.md | markdown | 8.2 KB |
| references/technical-reference.md | markdown | 3.8 KB |
| scripts/postinstall.js | script | 4.5 KB |
| scripts/preuninstall.js | script | 1.4 KB |
| social-preview.html | other | 5.1 KB |
| social-preview.png | binary | 261.4 KB |
| src/cli.ts | script | 76.8 KB |
| src/lib/analyze.ts | script | 20.0 KB |
| src/lib/cdp-cookies.ts | script | 13.1 KB |
| src/lib/client.ts | script | 22.2 KB |
| src/lib/cookies.ts | script | 13.3 KB |
| src/lib/creator-signing.ts | script | 1.8 KB |
| src/lib/detect.ts | script | 6.6 KB |
| src/lib/fingerprint-data.ts | script | 2.3 KB |
| src/lib/health.ts | script | 5.5 KB |
| src/lib/platform.ts | script | 2.7 KB |
| src/lib/render.ts | script | 19.5 KB |
| src/lib/reply-strategy.ts | script | 6.0 KB |
| src/lib/signing.ts | script | 21.1 KB |
| src/lib/template.ts | script | 8.0 KB |
| src/lib/url.ts | script | 1.8 KB |
| tsconfig.json | config | 458 B |
references/commands.md
View on GitHub# redbook 命令详解
**始终加 `--json`** 供程序解析(否则输出人读文本)。全局选项见文末。
## 读取(reading)
### `redbook search <keyword>`
按关键词搜索笔记,返回标题/URL/点赞/作者。
```bash
redbook search "AI编程" --sort popular --json # sort: general(默认)/popular/latest
redbook search "Cursor" --type image --json # type: all(默认)/video/image
redbook search "MCP Server" --page 2 --json # 分页
```
### `redbook read <url>`
读笔记全文 —— 标题/正文/图片/点赞/评论数。接受完整 URL 或短 noteId(bare noteId 常返回 `{}`,需 xsec_token)。API 返回验证码时回退 HTML 抓取。
### `redbook comments <url>`
获取评论,`--all` 拉全部页。`redbook comments "<url>" --all --json`
### `redbook user <userId|profileUrl>`
创作者档案 —— 昵称/简介/粉丝数/笔记数/获赞。bare userId 返回 `code=-1` 时用含 `xsec_token` 的完整 profile URL,或 `--xsec-token <token> --xsec-source pc_search`。
### `redbook user-posts <userId|profileUrl>`
列出创作者所有笔记(标题/URL/点赞/时间)。
### `redbook account-report <userId|profileUrl...>`
批量汇总账号发帖与参与度。
```bash
redbook account-report --file accounts.txt --month 2026-07 --json
redbook account-report "<url1>" "<url2>" --max-pages 2 --json
```
选项:`--file`(换行分隔 ID/URL)· `--month YYYY-MM`(默认当月)· `--max-pages n`(默认 1)· `--all`(全页)· `--delay ms`(默认 3000)。KOS/KOC 报告用已知 ID,勿用关键词搜索。
### `redbook feed`
浏览推荐流。`redbook feed --json`
### `redbook topics <keyword>`
搜索话题标签。`redbook topics "Claude Code" --json`
### `redbook favorites [userId]`
列出收藏笔记,默认当前登录用户。`--all` 拉全页。他人收藏仅在未设私密时可见。
### `redbook analyze-viral <url>`
分析爆款原因,返回确定性 0–100 分。`--comment-pages n`(默认 3,最大 10)。
JSON:`{ note, score, hook, content, visual, engagement, comments, relative, fetchedAt }`
- `score.overall` = hook(20)+engagement(20)+relative(20)+content(20)+comments(20)
- `hook.hookPatterns[]` · `engagement`(点赞/评论/收藏/分享 + 三比率)· `relative.viralMultiplier`(点赞/作者中位)· `relative.isOutlier`(>3)· `comments.themes[]`
### `redbook viral-template <url> [url2] [url3]`
从 1-3 篇爆款提取可复用模板。`--comment-pages n`(默认 3,最大 10)。
JSON:`{ dominantHookPatterns, titleStructure, bodyStructure, engagementProfile, audienceSignals, sourceNotes, generatedAt }`
### `redbook health`
检测笔记隐藏限流 level(见 modules.md Module M)。`redbook health --all --json`
### `redbook whoami`
检查连接状态,验证 cookie 并显示登录用户。
### `redbook boards` / `redbook board <board-url>`
列出用户合集 / 列出合集内笔记。
## 写操作边界
本 Skill 只允许上面的读取与分析命令。不要调用 CLI 内置的发布、评论、回复、点赞、收藏或批量互动命令;这些路径没有 Easel 的确认与内容安全闸门。发布改用 `skill-xhs-publisher`,评论和回复改用 `skill-xhs-comment-reply`。
### `redbook render <file>`(离线,无需 cookie)
markdown → styled PNG 卡片,用本机 Chrome。
选项:`--style purple/xiaohongshu(默认)/mint/sunset/ocean/elegant/dark` · `--pagination auto(默认)/separator` · `--output-dir` · `--width`(1080) · `--height`(1440) · `--dpr`(2)。需 `puppeteer-core` + `marked`;Chrome 非标准位置设 `CHROME_PATH`。
### `redbook auth`
为 OpenClaw/云/CI 管理保存的 cookie。
```bash
redbook auth export # 从本地浏览器导出到 ~/.redbook/cookies.json
redbook auth save --cookie-string "a1=...; web_session=..."
redbook auth path / inspect --json / clear
```
cookie 解析顺序:`--cookie-string` → `REDBOOK_COOKIE_STRING` → `REDBOOK_COOKIE_FILE` → `~/.redbook/cookies.json` → 浏览器抽取。cookie 文件是明文凭证(`0600`),勿提交/记录。
## 全局选项(所有命令)
- `--cookie-source chrome(默认)/safari/firefox`
- `--chrome-profile <name>`(省略则自动发现)
- `--cookie-string "a1=...; web_session=..."`
- `--platform xhs(大陆)/rednote(全球)`(默认自动检测,见 technical-reference.md)
- `--global`(= `--platform rednote`)
- `--json`
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |