← Back to registry

xhs-cli knowledge

小红书命令行工具 — 搜索、阅读、点赞、收藏、评论,全在终端完成

xhs is a CLI for Xiaohongshu (小红书) using Camoufox anti-fingerprint browser. Search, read, like, favorite, comment, and publish — all from the terminal.

Features

Install

uv: uv tool install xhs-cli
pipx: pipx install xhs-cli

Commands

CommandSyntaxDescription
login xhs login Authenticate via Chrome cookies or QR code
search xhs search <keyword> Search notes by keyword
read xhs read <note_id> --comments Read a post with comments
like xhs like <note_id> Like a post
favorite xhs favorite <note_id> Bookmark a post
comment xhs comment <note_id> <text> Comment on a post
post xhs post <title> --image <img> --content <text> Publish an image post

Links

Agent Usage Example

Use cases:

Example workflow:

xhs search 'coffee' --json | jq '.[].title'