
Xhs Cli
Search, read, and interact with Xiaohongshu from the terminal
What You Can Do
This skill provides terminal-based access to Xiaohongshu's core features using a headless browser approach. You can search for notes, retrieve detailed post content with comments, view user profiles, and perform engagement actions—all without leaving your CLI. The headless browser method prioritizes resilience against detection compared to API-based alternatives.
Features
Query Xiaohongshu by keyword and get rich table output or raw JSON results
Retrieve full note details including comments and metadata using note IDs
Look up creator profiles by user ID and view their published notes
Like, favorite, and comment on posts directly from the terminal
Support for saved cookies, Chrome auto-detection, and QR code login
Export search and read results in machine-readable JSON format for automation
Check login status and manage authentication tokens via xhs status command
Example Output
Search Result:
$ xhs search "咖啡"
┌─────────────────────────────────────────────────┐
│ Note ID │ Title │ Author │
├─────────────────────────────────────────────────┤
│ 7a8b9c0d1e2f3g │ 咖啡品鉴指南 │ @CoffeeGeek │
│ 2f3g4h5i6j7k8l │ 手冲咖啡技巧 │ @BaristaArt │
└─────────────────────────────────────────────────┘
Note Details:
$ xhs read 7a8b9c0d1e2f3g --comments
Title: 咖啡品鉴指南
Author: @CoffeeGeek (ID: a1b2c3d4e5f6)
Description: A comprehensive guide to coffee tasting...
Likes: 2,341 | Comments: 156 | Shares: 89
Top Comments:
- "Great tips! Tried the pour-over method." — @User123
- "Where did you source these beans?" — @User456
What's Included
- SKILL.md: Complete xhs-cli installation and command reference
- Authentication guide: Cookie management, Chrome auto-detection, and QR code login instructions
- Command cheat sheet: Search, read, user profile, and engagement command syntax with options
- JSON output templates: Raw JSON response formats for search, posts, and profile data
- Example workflows: Copy-paste terminal commands for common tasks (search → read → comment)
Who It's For
- Social media researchers — Analyze trends and content from Xiaohongshu at scale via CLI automation
- Content creators — Monitor engagement metrics and manage posts from terminal-based workflows
- Data engineers — Extract and process XHS data for analytics pipelines and datasets
- Developers — Build automation scripts and integrations using XHS as a data source
- Marketing analysts — Research competitor content and audience sentiment programmatically
Best For
- Batch searching and monitoring — Automate keyword research and track trending topics across notes
- Content discovery workflows — Systematically explore user profiles and note collections
- Engagement automation — Like, favorite, and comment on content at scale from scripts
- Data extraction — Pull note metadata, comments, and user information for analysis
- Terminal-first development — Integrate XHS interactions into CI/CD pipelines and headless systems







