About xianyu-skills
xianyu-skills is a skill for operating a user’s logged-in Xianyu account in Chrome through Xianyu Bridge and a Python CLI. It routes tasks across account, listing, browsing, interaction, and product-operations skills, with confirmation steps for actions that change account state.
Key features
- 01Chrome account checks and login
- 02Publish listings with descriptions, prices, and images
- 03Search listings and inspect item details
- 04Read messages and perform account interactions
- 05Route tasks to focused sub-skills
Use cases
- 01Check which Xianyu account is logged in
- 02Prepare and publish a product listing
- 03Search listings and review item data
- 04Review messages or send an authorized reply
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ donggeai/ xianyu-skills --skill xianyu-skillsAfter installing, type/xianyu-skillsin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
README.mdpyproject.tomluv.lockextension/popup.jsmanifest.jsonpopup.htmlcontent.jsbackground.jsscripts/run_lock.pycli.pybridge_server.pyscripts/xianyu/__init__.pyerrors.pyinteract.pybridge.pyproduct_ops.pyprofile.pymessages.pylogin.pyitem_detail.pypublish.pysearch.pyurls.pyselectors.pyDetails
From the project READMExianyu-skills
使用本项目自带的 Xianyu Bridge 扩展和 Python CLI 操作用户已登录的 Chrome 闲鱼账号。整体策略:能力完整暴露,文档层提醒确认和合理频率,CLI 层不硬编码阉割功能。
技能边界
- 所有闲鱼操作只通过本目录的
python scripts/cli.py <command>完成。 - 不要改用 Codex Chrome 插件、Playwright CLI、外部 MCP 或其他浏览器自动化方案来替代 Xianyu Bridge。
- 命令输出为 JSON;向用户汇报时提取关键字段,不要倾倒整段页面文本。
- 发布、私信、收藏、想要等外部动作会改变账号状态,用户未明确授权时先确认。
- 不要读取、导出或展示 cookies、密码、手机号验证码等敏感信息。
子技能路由
按用户意图选择最小必要子 Skill:
- 登录、检查账号、确认当前账号:
skills/xianyu-auth/SKILL.md - 发布商品、上传商品图、填写/确认发布表单:
skills/xianyu-publish/SKILL.md - 搜索商品、查看详情、查看我的商品、读取商品数据:
skills/xianyu-explore/SKILL.md - 查看消息、打开聊天、发送消息、收藏、我想要:
skills/xianyu-interact/SKILL.md - 竞品分析、价格带分析、流量复盘、发布测试、咨询辅助:
skills/xianyu-product-ops/SKILL.md
通用流程
- 进入
.agents/skills/xianyu-skills。 - 使用
.venv/Scripts/python.exe或已安装websockets的 Python 环境运行 CLI。 - 先执行
check-login;未登录时执行login,让用户在 Chrome 里完成登录。 - 根据任务调用对应子 Skill 的命令。
- 对高影响动作,优先采用“先填表/生成草稿 -> 用户确认 -> 点击发布/发送”的分步模式。
常用命令
python scripts/cli.py check-login
python scripts/cli.py fill-publish --description-file D:/abs/desc.txt --price 29.9 --images D:/abs/pic.png
python scripts/cli.py click-publish
python scripts/cli.py publish --description-file D:/abs/desc.txt --price 29.9 --images D:/abs/pic.png
python scripts/cli.py search-items --keyword "PPT代做" --limit 20
python scripts/cli.py get-item-detail --item-id ITEM_ID
python scripts/cli.py list-my-items
python scripts/cli.py list-messages
python scripts/cli.py analyze-competitors --keyword "PPT代做" --limit 10
环境准备
- 运行
uv sync安装依赖,或使用已有 Python 环境安装requests websockets。 - Chrome 打开
chrome://extensions/。 - 开启开发者模式,加载本目录的
extension/。 - 确认扩展名为
Xianyu Bridge,默认 Bridge 地址为ws://localhost:9444。
失败处理
No module named websockets:使用.venv/Scripts/python.exe,或先运行uv sync。- Bridge 连接超时:确认
scripts/bridge_server.py正在运行,Chrome 扩展已启用。 - 扩展无响应:在
chrome://extensions/重新加载Xianyu Bridge。 - 上传图片失败:确认图片是本地绝对路径、文件存在、格式为平台可接受图片。
- 页面提示分类不支持:发布命令默认使用
--category auto-safe,会按页面提示尝试相邻可发布分类。 - 发布后商品消失或收到处罚通知:向用户说明平台审核/风控提示,并建议检查闲鱼消息与商品状态。
Comments
Markdown supported