← Back to registry

xiaohongshu-cli knowledge

Search, read, and interact with Xiaohongshu (小红书) from your terminal

xhs is a full-featured CLI for Xiaohongshu (小红书) via reverse-engineered API. Search notes, read posts, interact with content, and even publish — all from the terminal.

Features

Install

uv: uv tool install xiaohongshu-cli
pipx: pipx install xiaohongshu-cli

Commands

CommandSyntaxDescription
login xhs login Authenticate via browser cookies or QR code
search xhs search <keyword> Search notes by keyword
read xhs read <index> Read a post from the last listing
feed xhs feed Browse recommendation feed
hot xhs hot -c <category> Browse hot posts by category
like xhs like <index> Like a post from the last listing
post xhs post --title <title> --body <text> --images <img> Publish an image post

Links

Agent Usage Example

Use cases:

Example workflow:

xhs search '咖啡推荐' --json | jq '.[].title'