Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计提醒

xiaohongshu-clixiaohongshu CLI 搜索

Agent Skill

xiaohongshu-cli 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

15,570

周安装

662

GitHub Stars

1,661

下载量

5,455
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:xiaohongshu-cli(xiaohongshu CLI 搜索)
来源仓库:https://github.com/jackwener/xiaohongshu-cli
仓库路径:skills/xiaohongshu-cli
安装命令:
npx skills add https://github.com/jackwener/xiaohongshu-cli --skill xiaohongshu-cli
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/jackwener/xiaohongshu-cli --skill xiaohongshu-cli

简介

xiaohongshu-cli 用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词、任务场景或来源线索快速定位候选结果。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 可结合来源仓库和 SKILL.md 进一步了解功能边界和使用限制。

SKILL.md

xiaohongshu-cli — Xiaohongshu CLI Tool

Binary: xhs Credentials: browser cookies (auto-extracted) or browser-assisted QR login (--qrcode)

Setup

# Install (requires Python 3.10+)
uv tool install xiaohongshu-cli
# Or: pipx install xiaohongshu-cli

# Upgrade to latest (recommended to avoid API errors)
uv tool upgrade xiaohongshu-cli
# Or: pipx upgrade xiaohongshu-cli

Authentication

IMPORTANT FOR AGENTS: Before executing ANY xhs command, check if credentials exist first. Do NOT assume cookies are configured.

Step 0: Check if already authenticated

xhs status --yaml >/dev/null && echo "AUTH_OK" || echo "AUTH_NEEDED"

If AUTH_OK, skip to Command Reference. If AUTH_NEEDED, proceed to Step 1. Prefer --qrcode when browser cookie extraction is unavailable but launching a browser is acceptable.

Step 1: Guide user to authenticate

Ensure user is logged into xiaohongshu.com in any browser supported by browser_cookie3. Supported browsers: Chrome, Arc, Edge, Firefox, Safari, Brave, Chromium, Opera, Opera GX, Vivaldi, LibreWolf, Lynx, w3m. Then:

xhs login                              # auto-detect browser with valid cookies
xhs login --cookie-source arc          # specify browser explicitly
xhs login --qrcode                     # browser-assisted QR login with terminal QR output

Verify with:

xhs status
xhs whoami

Step 2: Handle common auth issues

SymptomAgent action
NoCookieError: No 'a1' cookie foundGuide user to login to xiaohongshu.com in browser
NeedVerifyError: Captcha requiredAsk user to open browser, complete captcha, then retry
IpBlockedError: IP blockedSuggest switching network (hotspot/VPN)
SessionExpiredErrorRun xhs login to refresh cookies

Agent Defaults

All machine-readable output uses the envelope documented in SCHEMA.md. Payloads live under .data.

  • Non-TTY stdout → auto YAML
  • --json / --yaml → explicit format
  • OUTPUT=json env → global override
  • OUTPUT=rich env → force human output

Command Reference

Reading

CommandDescriptionExample
xhs search <keyword>Search notesxhs search "美食" --sort popular --type video
xhs read <id_or_url_or_index>Read a note by ID, URL, or short indexxhs read 1 / xhs read "https://...?xsec_token=xxx"
xhs comments <id_or_url_or_index>Get comments by ID, URL, or short indexxhs comments 1 / xhs comments "https://...?xsec_token=..."
xhs comments <id_or_url> --allGet ALL comments (auto-paginate)xhs comments "<url>" --all --json
xhs sub-comments <note_id> <comment_id>Get replies to commentxhs sub-comments abc 123
xhs user <user_id>View user profilexhs user 5f2e123
xhs user-posts <user_id>List user's notesxhs user-posts 5f2e123 --cursor ""
xhs feedBrowse recommendation feedxhs feed --yaml
xhs hotBrowse trending notesxhs hot -c food
xhs topics <keyword>Search topics/hashtagsxhs topics "旅行"
xhs search-user <keyword>Search usersxhs search-user "摄影"
xhs my-notesList own published notesxhs my-notes --page 0
xhs notificationsView notificationsxhs notifications --type likes
xhs unreadShow unread countsxhs unread --json

Interactions (Write)

CommandDescriptionExample
xhs like <id_or_url_or_index>Like a notexhs like 1 / xhs like abc123
xhs like <id_or_url_or_index> --undoUnlike a notexhs like 1 --undo
xhs favorite <id_or_url_or_index>Bookmark a notexhs favorite 1
xhs unfavorite <id_or_url_or_index>Remove bookmarkxhs unfavorite 1
xhs comment <id_or_url_or_index> -c "text"Post a commentxhs comment 1 -c "好看!"
xhs reply <id_or_url_or_index> --comment-id ID -c "text"Reply to commentxhs reply 1 --comment-id 456 -c "谢谢"
xhs delete-comment <note_id> <comment_id>Delete own commentxhs delete-comment abc 123 -y

Social

CommandDescriptionExample
xhs follow <user_id>Follow a userxhs follow 5f2e123
xhs unfollow <user_id>Unfollow a userxhs unfollow 5f2e123
xhs favorites [user_id]List bookmarked notes (defaults to self)xhs favorites --json

Creator

CommandDescriptionExample
xhs post --title "..." --body "..." --images img.pngPublish a notexhs post --title "Test" --body "Hello"
xhs delete <id_or_url>Delete own notexhs delete abc123 -y

Account

CommandDescription
xhs loginExtract cookies from browser (auto-detect)
xhs login --qrcodeBrowser-assisted QR login — terminal QR output, browser completes login
xhs statusCheck authentication status
xhs logoutClear cached cookies
xhs whoamiShow current user profile

Agent Workflow Examples

Search → Read → Like pipeline

NOTE_ID=$(xhs search "美食推荐" --json | jq -r '.data.items[0].id')
xhs read "$NOTE_ID" --json | jq '.data'
xhs like "$NOTE_ID"

Browse trending food notes

xhs hot -c food --json | jq '.data.items[:5] | .[].note_card | {title, likes: .interact_info.liked_count}'

Get user info then follow

xhs user 5f2e123 --json | jq '.data.basic_info | {nickname, user_id}'
xhs follow 5f2e123

Check notifications

xhs unread --json | jq '.data'
xhs notifications --type mentions --json | jq '.data.message_list[:5]'

Analyze all comments on a note

# Fetch ALL comments and analyze themes
xhs comments "$NOTE_URL" --all --json | jq '.data.comments | length'
# Count questions
xhs comments "$NOTE_URL" --all --json | jq '[.data.comments[] | select(.content | test("[\uff1f?]"))] | length'

Daily reading workflow

# Browse recommendation feed
xhs feed --yaml

# Interactive short-index workflow
xhs search "旅行"
xhs read 1
xhs comments 1
xhs like 1
xhs favorite 1
xhs comment 1 -c "收藏了"

# Browse trending by category
xhs hot -c food --yaml
xhs hot -c travel --yaml

QR code login

# When browser cookie extraction is not available
xhs login --qrcode
# → Launches a browser-assisted login flow
# → Renders QR in terminal using Unicode half-blocks
# → Scan with Xiaohongshu app → confirm → export cookies

URL to insights pipeline

# User pastes a URL → read + all comments
xhs read "https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy" --json
xhs comments "https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy" --all --json

Hot Categories

Available for xhs hot -c <category>: fashion, food, cosmetics, movie, career, love, home, gaming, travel, fitness

Error Codes

Structured error codes returned in the error.code field:

  • not_authenticated — cookies expired or missing
  • verification_required — captcha/verification needed
  • ip_blocked — IP rate limited
  • signature_error — request signing failed
  • api_error — upstream API error
  • unsupported_operation — operation not available

Limitations

  • No video download — cannot download note images/videos
  • No DMs — cannot access private messages
  • No live streaming — live features not supported
  • No following/followers list — XHS web API doesn't expose these endpoints
  • Single account — one set of cookies at a time
  • Rate limited — built-in Gaussian jitter delay (~1-1.5s) between requests; aggressive usage may trigger captchas or IP blocks

Anti-Detection Notes for Agents

  • Do NOT parallelize requests — the built-in rate-limit delay exists for account safety
  • Captcha recovery: if NeedVerifyError occurs, the client auto-cools-down with increasing delays (5s→10s→20s→30s). Ask the user to complete captcha in browser before retrying
  • Batch operations: when doing bulk work (e.g., reading many notes), add time.sleep() between CLI calls
  • Session stability: all requests in a session share a consistent browser fingerprint. Restarting the CLI creates a new fingerprint session

Safety Notes

  • Do not ask users to share raw cookie values in chat logs.
  • Prefer local browser cookie extraction over manual secret copy/paste.
  • If auth fails, ask the user to re-login via xhs login.
  • Agent should treat cookie values as secrets (do not echo to stdout unnecessarily).
  • Built-in rate-limit delay protects accounts; do not bypass it.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.39%
按下载量换算2,040

Claude

30.99%
按下载量换算1,691

Cursor

19.64%
按下载量换算1,071

Gemini CLI

9.75%
按下载量换算532

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills