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

xhs-cliXHS CLI 搜索

Agent Skill

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

总安装

906

周安装

37

GitHub Stars

452

下载量

290
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

用于查找、检索和筛选相关信息,支持关键词和任务场景定位。

  • 适合在需要快速获取候选结果时使用,提升信息收集效率。
  • 可结合来源仓库和原始 README 进一步核验具体用法。
  • 安装前建议确认权限范围、维护状态及是否触发联网或文件操作。
  • xhs-cli 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

[!NOTE] An alternative package xiaohongshu-cli is available, which uses a reverse-engineered API and runs faster. This package (xhs-cli) uses a headless browser (camoufox) approach — slower but more resilient against risk-control detection. Choose whichever best fits your needs.

xhs-cli Skill

A CLI tool for interacting with Xiaohongshu (小红书). Use it to search notes, read details, browse user profiles, and perform interactions like liking, favoriting, and commenting.

Prerequisites

# Install (requires Python 3.8+)
uv tool install xhs-cli
# Or: pipx install xhs-cli

Authentication

All commands require valid cookies to function.

xhs status                     # Check saved login session (no browser extraction)
xhs login                      # Auto-extract Chrome cookies
xhs login --cookie "a1=..."    # Or provide cookies manually

Authentication first uses saved local cookies. If unavailable, it auto-detects local Chrome cookies via browser-cookie3. If extraction fails, QR code login is available.

Command Reference

Search

xhs search "咖啡"              # Search notes (rich table output)
xhs search "咖啡" --json       # Raw JSON output

Read Note

# View note (xsec_token auto-resolved from search cache)
xhs read <note_id>
xhs read <note_id> --comments  # Include comments
xhs read <note_id> --xsec-token <token>  # Manual token
xhs read <note_id> --json

User

# Look up user profile (by internal user_id, hex format)
xhs user <user_id>
xhs user <user_id> --json

# List user's published notes
xhs user-posts <user_id>
xhs user-posts <user_id> --json

# Followers / Following
xhs followers <user_id>
xhs following <user_id>

Discovery

xhs feed                       # Explore page recommended feed
xhs feed --json
xhs topics "旅行"              # Search topics/hashtags
xhs topics "旅行" --json

Interactions (require login)

# Like / Unlike (xsec_token auto-resolved)
xhs like <note_id>
xhs like <note_id> --undo

# Favorite / Unfavorite
xhs favorite <note_id>
xhs favorite <note_id> --undo

# Comment
xhs comment <note_id> "好棒!"

# Delete your own note
xhs delete <note_id>

Favorites

xhs favorites                  # List your favorites
xhs favorites --max 10         # Limit count
xhs favorites --json

Post

xhs post "标题" --image photo1.jpg --image photo2.jpg --content "正文"
xhs post "标题" --image photo1.jpg --content "正文" --json

Account

xhs status                     # Quick saved-session check
xhs whoami                     # Full profile info
xhs whoami --json
xhs login                      # Login
xhs logout                     # Clear cookies

JSON Output

Major query commands support --json for machine-readable output:

xhs search "咖啡" --json | jq '.[0].id'           # First note ID
xhs whoami --json | jq '.userInfo.userId'          # Your user ID
xhs favorites --json | jq '.[0].displayTitle'      # First favorite title

Common Patterns for AI Agents

# Get your user ID for further queries
xhs whoami --json | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('userInfo',{}).get('userId',''))"

# Search and get note IDs (xsec_token auto-cached for later use)
xhs search "topic" --json | python3 -c "import sys,json; [print(n['id']) for n in json.load(sys.stdin)[:3]]"

# Check login before performing actions
xhs status && xhs like <note_id>

# Read a note with comments for summarization
xhs read <note_id> --comments --json

Error Handling

  • Commands exit with code 0 on success, non-zero on failure
  • Error messages are prefixed with ❌
  • Login-required commands show clear instruction to run xhs login
  • xsec_token is auto-resolved from cache; manual --xsec-token available as fallback

Safety Notes

  • Do not ask users to share raw cookie values in chat logs.
  • Prefer auto-extraction via xhs login over manual cookie input.
  • If auth fails, ask the user to re-login via xhs login.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

35.26%
按下载量换算102

Claude

28.15%
按下载量换算82

Cursor

18.25%
按下载量换算53

Gemini CLI

9.97%
按下载量换算29

安全审计

Gen Agent Trust Hub

可疑

Socket

可疑

Snyk

可疑

权限和风险

操作浏览器

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

安装前确认

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

来源信息

继续浏览同类 Skills