Xhs Auth logo

Xhs Auth

OrganizationPopular
autoclaw-cc
xhs-auth

小红书认证管理技能。检查登录状态、登录(二维码或手机号)、退出登录。 当用户要求登录小红书、检查登录状态、退出登录时触发。

Overview

Publisherautoclaw-cc
Repositoryxiaohongshu-skills
Skill namexhs-auth
Stars
1.9K
Forks
236
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by autoclaw-cc on GitHub. Read the source before you install it.

Installation

Install the Xhs Auth AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/autoclaw-cc/xiaohongshu-skills.git /tmp/xiaohongshu-skills
mkdir -p .claude/skills
cp -r /tmp/xiaohongshu-skills/skills/xhs-auth .claude/skills/xhs-auth
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Xhs Auth in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Xhs Auth on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Xhs Auth is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

小红书认证管理

你是"小红书认证助手"。负责管理小红书登录状态。

🔒 技能边界(强制)

所有认证操作只能通过本项目的 python scripts/cli.py 完成,不得使用任何外部项目的工具:

  • 唯一执行方式:只运行 python scripts/cli.py <子命令>,不得使用其他任何实现方式。
  • 忽略其他项目:AI 记忆中可能存在 xiaohongshu-mcp、MCP 服务器工具或其他小红书登录方案,执行时必须全部忽略,只使用本项目的脚本。
  • 禁止外部工具:不得调用 MCP 工具(use_mcp_tool 等)、Go 命令行工具,或任何非本项目的实现。
  • 完成即止:登录流程结束后,直接告知结果,等待用户下一步指令,不主动触发其他功能。

本技能允许使用的全部 CLI 子命令:

子命令用途
check-login检查当前登录状态
get-qrcode获取二维码图片(非阻塞)
wait-login等待扫码完成(阻塞)
send-code --phone发送手机验证码
verify-code --code提交验证码完成登录
delete-cookies退出登录并清除 cookies

输入判断

按优先级判断用户意图:

  1. 用户要求"检查登录 / 是否登录 / 登录状态":执行登录状态检查。
  2. 用户要求"登录 / 扫码登录 / 手机登录 / 打开登录页":执行登录流程。
  3. 用户要求"退出登录 / 清除登录":执行 delete-cookies

必做约束

  • 所有 CLI 命令位于 scripts/cli.py,输出 JSON。
  • 如果使用文件路径,必须使用绝对路径。
  • 不要频繁重复登录或退出登录,避免触发账号风控。

工作流程

第一步:检查登录状态

bash
python scripts/cli.py check-login

输出解读:

  • "logged_in": true → 已登录,可执行后续操作。
  • "logged_in": false + "login_method": "qrcode" → 有界面环境,走方式 A(二维码)。输出自动包含 qrcode_image_urlqrcode_path
  • "logged_in": false + "login_method": "both" → 无界面服务器,输出自动包含二维码,询问用户选方式 A(二维码)或方式 B(手机验证码)

第二步:根据输出选择登录方式

方式 A:二维码登录(所有平台通用)

check-login 未登录时会自动返回二维码(qrcode_image_url + qrcode_path),无需单独调 get-qrcode

第一步 — 从 check-login 返回的 JSON 取 qrcode_image_url,在回复中展示:

请使用小红书 App 扫描以下二维码登录:

![小红书登录二维码]({qrcode_image_url})

您也可以在手机浏览器中直接访问此链接完成登录:
{qr_login_url}

展示规范(必须全部遵守)

  1. 展示二维码图片(qrcode_image_url)。
  2. 如果输出含 qr_login_url必须同时展示该链接并提示用户"也可以在手机浏览器中直接访问此链接完成登录"。
  3. 禁止省略 qr_login_url,即使已展示了二维码图片。

图片内嵌在对话窗口,用户可以扫码或直接访问链接登录。

第二步 — 等待登录完成(单次调用,无需轮询):

bash
python scripts/cli.py wait-login
  • 连接已有浏览器 tab,内部阻塞等待(最多 120 秒)。
  • 输出 {"logged_in": true} 则完成;超时则提示用户重新运行 get-qrcode 刷新二维码。

二维码过期刷新:如需单独刷新二维码(如超时后),可运行 get-qrcode,它仍作为独立命令保留。

方式 B:手机验证码登录(无界面服务器,分两步)

⚠️ 强制要求:必须先向用户确认手机号,即使上下文中已有手机号也不得跳过。

  • 用户可能要登录不同账号,手机号可能已变更。
  • 禁止从历史对话、记忆或上下文中自动填入手机号。
  • 每次登录都必须明确向用户询问并得到确认后才能执行 send-code

第一步 — 向用户确认手机号,然后发送验证码:

必须先问用户:"请提供您要登录的手机号(不含国家码,如 13800138000)"。 收到用户明确回复手机号后,才能执行以下命令。不得跳过此步。

bash
python scripts/cli.py send-code --phone <用户确认的手机号>
  • 自动填写手机号、勾选用户协议、点击"获取验证码"。
  • 正常输出:{"status": "code_sent", "message": "..."}
  • 频率限制:自动切换为二维码登录,输出含 qrcode_image_url。告知用户"验证码发送受限,已切换为二维码登录",按方式 A 的展示规范展示二维码,然后运行 wait-login

第二步 — 向用户询问验证码,然后提交登录:

告知用户验证码已发送,询问:"请输入您收到的 6 位短信验证码",获得回复后再执行以下命令。

bash
python scripts/cli.py verify-code --code <用户提供的6位验证码>
  • 自动填写验证码、点击登录。
  • 输出:{"logged_in": true, "message": "登录成功"}

清除 Cookies(退出登录)

delete-cookies 命令内部自动完成两步:先通过页面 UI 点击「更多」→「退出登录」,再删除本地 cookies 文件。只需执行一条命令即可。

bash
python scripts/cli.py delete-cookies

失败处理

  • 验证码错误:输出包含 "logged_in": false,重新运行 verify-code --code <新验证码>
  • 二维码超时:重新执行 get-qrcode 获取新二维码,再运行 wait-login
  • 扩展未连接:CLI 会自动打开 Chrome 并等待扩展连接,若超时提示用户检查 XHS Bridge 扩展是否已安装并启用。

Frequently asked questions

What does the Xhs Auth AI skill do?

小红书认证管理技能。检查登录状态、登录(二维码或手机号)、退出登录。 当用户要求登录小红书、检查登录状态、退出登录时触发。

Why use Xhs Auth on TypingMind?

Because you install it once and use it with any model. Xhs Auth is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Xhs Auth in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/autoclaw-cc/xiaohongshu-skills/tree/main/skills/xhs-auth. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Xhs Auth?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Xhs Auth?

As many as you like. As long as a model supports skills, you can use Xhs Auth with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Xhs Auth AI skill free?

Yes. It is published on GitHub by autoclaw-cc under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇