@skills-store/rednote
v0.1.16
Published
Xiaohongshu automation CLI for Skills Router
Readme
@skills-store/rednote
A Xiaohongshu (RED) automation CLI for browser session management, login, search, feed detail lookup, profile lookup, and note interactions such as like, collect, and commenting through interact.
Install
Install globally
npm install -g @skills-store/rednote
bun add -g @skills-store/rednoteAfter global installation, use the rednote executable:
rednote <command> [...args]Recommended command order
For most tasks, run commands in this order:
1. env
2. browser list or browser create
3. browser connect
4. login or check-login
5. status
6. home, search, get-feed-detail, get-profile, or interactQuick start
rednote env
rednote browser create --name seller-main --browser chrome --port 9222
rednote browser connect --instance seller-main
rednote login
rednote status
rednote search --keyword 护肤
rednote interact --url "https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy" --like --collect --comment "写得真好"Commands
browser
rednote browser list
rednote browser create --name seller-main --browser chrome --port 9222
rednote browser connect --instance seller-main
rednote browser connect --browser edge --user-data-dir /tmp/edge-profile --port 9223
rednote browser remove --name seller-mainUse browser for browser setup, reusable profiles, and instance management.
env
rednote env
rednote env --format jsonUse env first when checking installation, runtime info, or storage paths.
status
rednote statusUse status to confirm whether an instance exists, is running, and appears logged in.
check-login
rednote check-loginUse check-login when you only want to verify whether the session is still valid.
login
rednote loginUse login after browser connect if the instance is not authenticated yet.
home
rednote home --format md --saveUse home when you want the current home feed and optionally want to save it to disk.
The terminal output always uses the compact summary format below, even when --format json is selected:
id=<database nanoid>
title=<post title>
like=<liked count>
id=...
title=...
like=...Captured home feed posts are upserted into ~/.skills-router/rednote/main.db (the same path returned by rednote env). They are stored in the rednote_posts table, and the printed id is that table's nanoid(16) primary key.
search
rednote search --keyword 护肤
rednote search --keyword 护肤 --format json --save ./output/search.jsonlUse search for keyword-based note lookup.
The terminal output always uses the compact summary format below, even when --format json is selected:
id=<database nanoid>
title=<post title>
like=<liked count>Captured search results are also upserted into ~/.skills-router/rednote/main.db in the rednote_posts table. The printed id can be passed directly to get-feed-detail --id.
get-feed-detail
rednote get-feed-detail --id <nanoid>
rednote get-feed-detail --url "https://www.xiaohongshu.com/explore/xxx?xsec_token=yyy"Use get-feed-detail when you already have a Xiaohongshu note URL, or when you have a database id returned by home or search. With --id, the CLI looks up the saved URL from ~/.skills-router/rednote/main.db and then navigates with that raw URL.
Captured note details and comments are also upserted into ~/.skills-router/rednote/main.db in rednote_post_details and rednote_post_comments.
get-profile
rednote get-profile --id USER_IDUse get-profile when you want author or account profile information.
interact
rednote interact --id <nanoid> --like --collect
rednote interact --id <nanoid> --like --collect --comment "写得真好"Use interact when you want the single entrypoint for note operations such as like, collect, and comment in one command. Use --comment TEXT for replies; there is no standalone comment command.
Important flags
--instance NAMEselects the browser instance for account-scoped commands.--format jsonis best for scripting.--format mdis best for direct reading.--saveis useful forhomeandsearchwhen you want the raw post array written to disk.--keywordis required forsearch.homeandsearchalways printid/title/likesummaries to stdout;--format jsononly changes the saved file payload.get-feed-detailaccepts either--url URLor--id ID.--idis required forget-profile.--urlis required forinteract; at least one of--like,--collect, or--comment TEXTmust be provided.- replies are sent with
interact --comment TEXT.
Storage
The CLI stores browser instances and metadata under:
~/.skills-router/rednote/instancesInspect the current environment and resolved paths with:
rednote envTroubleshooting
If a command fails, check these in order:
- the instance name is correct
- the browser instance was created or connected
- login was completed for that instance
- the required flag such as
--keyword,--url, or--idwas provided
Repository
- Homepage: https://github.com/skills-router/skills-store/tree/main/packages/rednote-cli
- Issues: https://github.com/skills-router/skills-store/issues
License
MIT
