goofish-cli 0.2.4__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. goofish_cli-0.3.0/.claude-plugin/marketplace.json +59 -0
  2. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/.gitignore +4 -0
  3. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/CHANGELOG.md +57 -1
  4. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/PKG-INFO +104 -19
  5. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/README.md +100 -16
  6. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/pyproject.toml +22 -2
  7. goofish_cli-0.3.0/skills/goofish-overview/SKILL.md +97 -0
  8. goofish_cli-0.3.0/skills/goofish-overview/references/accounts.md +43 -0
  9. goofish_cli-0.3.0/skills/goofish-overview/references/mcp-tools-index.md +84 -0
  10. goofish_cli-0.3.0/skills/goofish-overview/references/xianyu-concepts.md +97 -0
  11. goofish_cli-0.3.0/skills/goofish-publish-item/SKILL.md +165 -0
  12. goofish_cli-0.3.0/skills/goofish-publish-item/references/category-selection.md +78 -0
  13. goofish_cli-0.3.0/skills/goofish-publish-item/references/common-pitfalls.md +94 -0
  14. goofish_cli-0.3.0/skills/goofish-publish-item/references/image-checklist.md +67 -0
  15. goofish_cli-0.3.0/skills/goofish-publish-item/references/title-formula.md +91 -0
  16. goofish_cli-0.3.0/skills/goofish-reply-buyer/SKILL.md +174 -0
  17. goofish_cli-0.3.0/skills/goofish-reply-buyer/references/bargain-ladder.md +115 -0
  18. goofish_cli-0.3.0/skills/goofish-reply-buyer/references/intent-classification.md +114 -0
  19. goofish_cli-0.3.0/skills/goofish-reply-buyer/references/tone-guide.md +120 -0
  20. goofish_cli-0.3.0/skills/goofish-risk-guard/SKILL.md +118 -0
  21. goofish_cli-0.3.0/skills/goofish-risk-guard/references/external-contact-keywords.md +92 -0
  22. goofish_cli-0.3.0/skills/goofish-risk-guard/references/forbidden-words.md +103 -0
  23. goofish_cli-0.3.0/skills/goofish-risk-guard/references/publish-red-lines.md +122 -0
  24. goofish_cli-0.3.0/skills/goofish-risk-guard/references/x5sec-recovery.md +89 -0
  25. goofish_cli-0.3.0/skills/goofish-shop-diagnosis/SKILL.md +147 -0
  26. goofish_cli-0.3.0/skills/goofish-shop-diagnosis/references/diagnosis-workflow.md +119 -0
  27. goofish_cli-0.3.0/skills/goofish-shop-diagnosis/references/rank-factors.md +120 -0
  28. goofish_cli-0.3.0/skills/goofish-shop-diagnosis/references/traffic-drop-causes.md +133 -0
  29. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/cli.py +10 -1
  30. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/auth/login.py +1 -0
  31. goofish_cli-0.3.0/src/goofish_cli/commands/item/list.py +128 -0
  32. goofish_cli-0.3.0/src/goofish_cli/commands/skills/install.py +84 -0
  33. goofish_cli-0.3.0/src/goofish_cli/core/crypto.py +35 -0
  34. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/core/qr_login.py +29 -15
  35. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/core/registry.py +3 -0
  36. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/core/session.py +32 -10
  37. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/core/sign.py +5 -3
  38. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/mcp_server.py +10 -0
  39. goofish_cli-0.2.4/.env.example +0 -11
  40. goofish_cli-0.2.4/.github/ISSUE_TEMPLATE/bug_report.yml +0 -54
  41. goofish_cli-0.2.4/.github/ISSUE_TEMPLATE/feature_request.yml +0 -22
  42. goofish_cli-0.2.4/.github/pull_request_template.md +0 -26
  43. goofish_cli-0.2.4/.github/workflows/ci.yml +0 -57
  44. goofish_cli-0.2.4/.github/workflows/publish.yml +0 -42
  45. goofish_cli-0.2.4/CONTRIBUTING.md +0 -59
  46. goofish_cli-0.2.4/docs/architecture.md +0 -89
  47. goofish_cli-0.2.4/docs/compliance.md +0 -43
  48. goofish_cli-0.2.4/docs/mcp-setup.md +0 -69
  49. goofish_cli-0.2.4/examples/publish_from_folder.py +0 -70
  50. goofish_cli-0.2.4/examples/watch_to_autoreply.sh +0 -26
  51. goofish_cli-0.2.4/tests/test_auth_login.py +0 -74
  52. goofish_cli-0.2.4/tests/test_browser_cookie.py +0 -164
  53. goofish_cli-0.2.4/tests/test_guard.py +0 -46
  54. goofish_cli-0.2.4/tests/test_item_view.py +0 -24
  55. goofish_cli-0.2.4/tests/test_limiter.py +0 -29
  56. goofish_cli-0.2.4/tests/test_list_chats.py +0 -106
  57. goofish_cli-0.2.4/tests/test_mtop.py +0 -59
  58. goofish_cli-0.2.4/tests/test_publish_payload.py +0 -70
  59. goofish_cli-0.2.4/tests/test_qr_login.py +0 -129
  60. goofish_cli-0.2.4/tests/test_refresh.py +0 -122
  61. goofish_cli-0.2.4/tests/test_registry.py +0 -33
  62. goofish_cli-0.2.4/tests/test_search.py +0 -36
  63. goofish_cli-0.2.4/tests/test_session_bootstrap.py +0 -137
  64. goofish_cli-0.2.4/tests/test_sign.py +0 -29
  65. goofish_cli-0.2.4/tests/test_ws_codec.py +0 -127
  66. goofish_cli-0.2.4/uv.lock +0 -1509
  67. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/LICENSE +0 -0
  68. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/NOTICE +0 -0
  69. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/examples/README.md +0 -0
  70. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/__init__.py +0 -0
  71. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/__init__.py +0 -0
  72. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/auth/__init__.py +0 -0
  73. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/auth/reset_guard.py +0 -0
  74. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/auth/status.py +0 -0
  75. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/category/__init__.py +0 -0
  76. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/category/recommend.py +0 -0
  77. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/item/__init__.py +0 -0
  78. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/item/delete.py +0 -0
  79. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/item/get.py +0 -0
  80. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/item/publish.py +0 -0
  81. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/item/view.py +0 -0
  82. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/location/__init__.py +0 -0
  83. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/location/default.py +0 -0
  84. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/media/__init__.py +0 -0
  85. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/media/upload.py +0 -0
  86. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/message/__init__.py +0 -0
  87. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/message/history.py +0 -0
  88. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/message/list_chats.py +0 -0
  89. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/message/send.py +0 -0
  90. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/message/watch.py +0 -0
  91. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/search/__init__.py +0 -0
  92. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/commands/search/search.py +0 -0
  93. {goofish_cli-0.2.4/tests → goofish_cli-0.3.0/src/goofish_cli/commands/skills}/__init__.py +0 -0
  94. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/core/__init__.py +0 -0
  95. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/core/browser.py +0 -0
  96. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/core/browser_cookie.py +0 -0
  97. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/core/errors.py +0 -0
  98. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/core/guard.py +0 -0
  99. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/core/limiter.py +0 -0
  100. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/core/mtop.py +0 -0
  101. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/core/output.py +0 -0
  102. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/core/refresh.py +0 -0
  103. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/core/strategy.py +0 -0
  104. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/core/token.py +0 -0
  105. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/core/ws.py +0 -0
  106. {goofish_cli-0.2.4 → goofish_cli-0.3.0}/src/goofish_cli/static/goofish_js_version_2.js +0 -0
@@ -0,0 +1,59 @@
1
+ {
2
+ "$schema": "https://claude.ai/schemas/plugin-marketplace.json",
3
+ "name": "goofish-cli-skills",
4
+ "displayName": "goofish-cli Skills",
5
+ "description": "闲鱼(goofish.com)自动化运营的 Claude Skills 套件。配合 goofish-cli MCP server 使用,让 Agent 在发布商品 / 回复买家 / 风控预检 / 店铺诊断这些场景里上手即会。",
6
+ "version": "0.3.0",
7
+ "author": {
8
+ "name": "fancy",
9
+ "url": "https://github.com/fancyboi999"
10
+ },
11
+ "homepage": "https://github.com/fancyboi999/goofish-cli",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/fancyboi999/goofish-cli.git"
15
+ },
16
+ "license": "Apache-2.0",
17
+ "requires": {
18
+ "mcp": ["goofish"]
19
+ },
20
+ "plugins": [
21
+ {
22
+ "name": "goofish-overview",
23
+ "source": "./skills/goofish-overview",
24
+ "description": "闲鱼自动化总入口:介绍工具定位、账号模型、15 个 MCP 工具速查、风控底线,并指向其它专项 skill。"
25
+ },
26
+ {
27
+ "name": "goofish-risk-guard",
28
+ "source": "./skills/goofish-risk-guard",
29
+ "description": "发布 / 发消息 / 风控恢复三道闸门。内置违禁词表、外联词表、x5sec 恢复指引。被其它 skill 频繁引用。"
30
+ },
31
+ {
32
+ "name": "goofish-publish-item",
33
+ "source": "./skills/goofish-publish-item",
34
+ "description": "从描述 / 图片到商品发布的闭环:类目识别 → 标题 5 段式生成 → 风控扫描 → 批量传图 → 用户确认 → 调 item_publish。"
35
+ },
36
+ {
37
+ "name": "goofish-reply-buyer",
38
+ "source": "./skills/goofish-reply-buyer",
39
+ "description": "买家消息闭环:拉未读 → 意图分类 → 议价阶梯策略 → 风控扫描 → 用户确认发送。不托管发送权。"
40
+ },
41
+ {
42
+ "name": "goofish-shop-diagnosis",
43
+ "source": "./skills/goofish-shop-diagnosis",
44
+ "description": "限流 / 降权 / 曝光掉的归因诊断。search_items 买家视角搜 + item_view 历史对比 → 给嫌疑排序和修复清单。"
45
+ }
46
+ ],
47
+ "install": {
48
+ "preferredMethod": "cli",
49
+ "cli": {
50
+ "command": "uvx",
51
+ "args": ["--from", "goofish-cli", "goofish", "skills", "install"],
52
+ "description": "运行 `uvx --from goofish-cli goofish skills install` 把所有 skill 复制到 ~/.claude/skills/。"
53
+ },
54
+ "manual": {
55
+ "description": "也可以直接 clone 仓库并把 skills/ 下的任一目录拷到 ~/.claude/skills/。"
56
+ }
57
+ },
58
+ "tags": ["xianyu", "goofish", "ecommerce", "automation", "mcp", "chinese"]
59
+ }
@@ -47,3 +47,7 @@ Thumbs.db
47
47
  *.tmp.json
48
48
  /frames.jsonl
49
49
  /ws_diag*.jsonl
50
+ .video-build/
51
+
52
+ # npm / ClawHub package artifacts
53
+ *.tgz
@@ -6,6 +6,61 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.3.0] - 2026-08-19
10
+
11
+ ### Added
12
+ - **Claude Skills 套件**(5 个 skill,打包进 wheel):把 goofish-cli 从"给 Agent 用的
13
+ 工具"升级成"给 Agent 的完整经验体"。Agent 在 Claude Code / Cursor 里识别到闲鱼任务
14
+ 即加载对应 skill 走 reference 知识库,不再 zero-shot 试错。
15
+ - `goofish-overview`:总入口。介绍定位、账号模型、15 个 MCP 工具速查、风控硬红线,
16
+ dispatch 到其他 4 个专项 skill。
17
+ - `goofish-risk-guard`:知识库型 skill。内置违禁词表、外联词正则、发布红线清单、
18
+ RGV587/x5sec 恢复指引。被 publish-item / reply-buyer 频繁引用。
19
+ - `goofish-publish-item`:发布闭环。类目识别 → 标题 5 段式生成 → 风控扫描 →
20
+ 批量传图 → 用户确认 → `item_publish`。强约束"不跳过用户确认"。
21
+ - `goofish-reply-buyer`:消息闭环。`message_watch/list_chats/history/send` 四件套
22
+ + 议价小刀/大刀/屠龙刀三档策略 + 意图 5 分类。不托管发送权。
23
+ - `goofish-shop-diagnosis`:限流诊断。`search_items` 买家视角搜 + `item_view`
24
+ 历史对比 → 归因清单给嫌疑排序 + 修复建议。纯读不写。
25
+ - **`goofish skills install` 命令**(`commands/skills/install.py`):把内置 skill
26
+ 复制到 `~/.claude/skills/`(或 `--dest` 指定路径)。`--list` 仅列举,`--force`
27
+ 覆盖已存在。支持 `uvx --from goofish-cli goofish skills install` 一行装机。
28
+ - **`.claude-plugin/marketplace.json`**:Claude Code Plugin Marketplace 分发清单,
29
+ 5 个 skill 均登记在 `plugins` 数组,`install.cli` 指向 `goofish skills install`。
30
+ - **wheel 打包 skills**:hatch `force-include` 把项目根 `skills/` 装进
31
+ `goofish_cli/_bundled_skills/`,运行时用 `goofish_cli.__file__` 拿包路径定位
32
+ (不依赖 namespace package 的 importlib.resources 行为,避免 py 版本差异坑)。
33
+ - **OpenClaw / ClawHub compatible bundle**:用 `.codex-plugin/plugin.json`、`.mcp.json`
34
+ 和 5 个内置 skills 组成 Codex-compatible bundle;OpenClaw 2026.6.1+ 可一次安装 MCP
35
+ server 与 skills。默认公开 13 个业务 tools,并排除登录、重置风控、长时间 watch 和
36
+ skills 安装等 4 个需要操作者控制的 tools。
37
+ - **`goofish item list`**:通过 `mtop.idle.web.xyh.item.list` 分页列出当前账号的在售和
38
+ 已下架商品,提取价格、状态、图片和文本标签;后续修复了图片图标 key 泄漏、重复商品、
39
+ 空页继续翻页和异常 `nextPage` 导致的无限循环风险。
40
+ - **OpenClaw 包验证**:检查四处版本对齐、MCP tool filter、archive 文件白名单、敏感内容,
41
+ 并通过 embedded-agent trajectory 验证实际 bundle 工具目录。
42
+
43
+ ### Changed
44
+ - `pyproject.toml` 新增 `[tool.hatch.build.targets.wheel.force-include]` 和
45
+ `[tool.hatch.build.targets.sdist]` 段。wheel 只 force-include `skills/`(运行时
46
+ `goofish skills install` 唯一需要的资源);sdist 额外带 `.claude-plugin/` 和
47
+ `README / CHANGELOG / LICENSE`,便于从源码分发时拿到完整元数据。
48
+ - skills 同时记录 OpenClaw (`goofish__*`) 和 Claude (`mcp__goofish__*`) 的 MCP tool 名。
49
+ - MCP Python SDK 约束为 `mcp>=1.2,<2`;2.0 已移除当前 server 使用的
50
+ `mcp.server.fastmcp`,未迁移前禁止 clean install 静默跨主版本。
51
+ - `goofish-cli` 在交互终端启动时明确提示它是 MCP stdio server;Typer positional metadata
52
+ 只进入 CLI wrapper,pyexecjs 的编码 workaround 也不再全局替换 `subprocess.Popen`。
53
+
54
+ ### Fixed
55
+ - 修复闲鱼登录页改版后 `auth login --qr` 必然超时:入口改为 `/login`,按 passport frame
56
+ URL 重新定位跨文档导航后的 iframe,并兼容 QR 从 `<canvas>` 改为 `<img>` 的 DOM。
57
+
58
+ ### Security
59
+ - Cookie 文件改为 Fernet 加密存储,使用机器与用户信息派生本地密钥;旧版明文 cookie
60
+ 首次读取时自动迁移为密文。
61
+ - 新增全仓库敏感标识扫描,阻止真实格式的账号、会话、发送者和消息标识进入提交与
62
+ OpenClaw/ClawHub 发布产物。
63
+
9
64
  ## [0.2.4] - 2026-04-22
10
65
 
11
66
  ### Added
@@ -127,7 +182,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
127
182
  - 本版本需要用户手动从浏览器导入 cookie(含 `unb` / `_m_h5_tk` / `x5sec`)
128
183
  - 遇到 `RGV587_ERROR` 风控时,需在浏览器完成滑块验证并**重新导出**带 `x5sec` 的 cookie
129
184
 
130
- [Unreleased]: https://github.com/fancyboi999/goofish-cli/compare/v0.2.4...HEAD
185
+ [Unreleased]: https://github.com/fancyboi999/goofish-cli/compare/v0.3.0...HEAD
186
+ [0.3.0]: https://github.com/fancyboi999/goofish-cli/compare/v0.2.4...v0.3.0
131
187
  [0.2.4]: https://github.com/fancyboi999/goofish-cli/compare/v0.2.3...v0.2.4
132
188
  [0.2.3]: https://github.com/fancyboi999/goofish-cli/compare/v0.2.2...v0.2.3
133
189
  [0.2.2]: https://github.com/fancyboi999/goofish-cli/compare/v0.2.1...v0.2.2
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: goofish-cli
3
- Version: 0.2.4
3
+ Version: 0.3.0
4
4
  Summary: 闲鱼 CLI — 支持 MCP,未来支持 Claude Skills。为 AI Agent 提供闲鱼自动化基础能力。
5
5
  Project-URL: Homepage, https://github.com/fancyboi999/goofish-cli
6
6
  Project-URL: Repository, https://github.com/fancyboi999/goofish-cli
@@ -19,8 +19,9 @@ Classifier: Programming Language :: Python :: 3.12
19
19
  Classifier: Topic :: Internet :: WWW/HTTP
20
20
  Requires-Python: >=3.11
21
21
  Requires-Dist: browser-cookie3>=0.20
22
+ Requires-Dist: cryptography>=41.0
22
23
  Requires-Dist: loguru>=0.7
23
- Requires-Dist: mcp>=1.2
24
+ Requires-Dist: mcp<2,>=1.2
24
25
  Requires-Dist: playwright>=1.58.0
25
26
  Requires-Dist: pydantic>=2.6
26
27
  Requires-Dist: pyexecjs>=1.5
@@ -54,12 +55,29 @@ Description-Content-Type: text/markdown
54
55
 
55
56
  </div>
56
57
 
58
+ <p align="center">
59
+ <a href="media/goofish-cli-promo.mp4">
60
+ <img src="media/goofish-cli-promo.gif" alt="goofish-cli 演示" width="760">
61
+ </a>
62
+ <br>
63
+ <em>▶️ 点击查看带终端音效 + 配乐的高清 MP4(46s)</em>
64
+ </p>
65
+
66
+ <!--
67
+ 想在 README 里内嵌「带声音的播放器」?GitHub 上唯一的办法:
68
+ 1. 打开本仓库任意 issue / PR 评论框(或 Releases 编辑页)
69
+ 2. 把 media/goofish-cli-promo.mp4 拖进去,等它生成 https://github.com/user-attachments/assets/xxxx 链接
70
+ 3. 把那串链接单独一行粘进这里,GitHub 会自动渲染成带声音的播放器
71
+ (提交进仓库的 mp4 用 <video> 标签会被 GitHub 过滤,不渲染)
72
+ -->
73
+
57
74
  `goofish-cli` 把闲鱼(Xianyu/Goofish)的核心运营能力抽成一套结构化命令,
58
- **同一份定义**同时输出给三种消费者:
75
+ **同一份定义**同时输出给四种消费者:
59
76
 
60
77
  - 👨‍💻 **人类**:`goofish item get 12345 --format table`
61
78
  - 🤖 **AI Agent(Claude Code / Cursor / Codex)**:`uvx goofish-cli` → 自动注册成 MCP tool
62
- - 🧩 **Claude Skills**(规划中):`skills/` 目录直接放进 Agent
79
+ - 🧩 **Claude Skills**(v0.3):5 个内置 skill,`goofish skills install` 一行装到 `~/.claude/skills/`
80
+ - **OpenClaw**:ClawHub bundle 一次安装 MCP server + 5 个 skills
63
81
 
64
82
  > 架构思想来自 [opencli](https://github.com/jackwener/opencli) 的 single-registry 设计。
65
83
 
@@ -67,7 +85,7 @@ Description-Content-Type: text/markdown
67
85
 
68
86
  ## ✨ 核心特性
69
87
 
70
- - 🔐 **13 个命令覆盖核心链路**:发布、下架、查询、图片上传、AI 类目识别、默认地址、IM 收发 + 会话列表
88
+ - 🔐 **17 个命令覆盖核心链路**:发布、下架、查询、图片上传、AI 类目识别、默认地址、IM 收发 + 会话列表、skills 安装
71
89
  - 📡 **真·实时 IM**:WebSocket 长连 + 自动重连 + **三类事件分类输出**
72
90
  - `event=message`(收到消息)· `event=read`(已读回执)· `event=new_msg`(轻量通知)
73
91
  - 🛡 **内置风控护栏**:令牌桶限流(1 写/分钟)+ RGV587 自动熔断
@@ -88,7 +106,7 @@ goofish auth login ~/Downloads/goofish-cookies.json
88
106
 
89
107
  # 3. 验证登录态
90
108
  goofish auth status
91
- # → {"unb":"2214350705775","tracknick":"xy575986224572","nick":"...","valid":true}
109
+ # → {"unb":"<masked-unb>","tracknick":"<masked-tracknick>","nick":"...","valid":true}
92
110
 
93
111
  # 4. 干活
94
112
  goofish item get 1045171414271
@@ -98,6 +116,71 @@ goofish message send <cid> <toid> --text "在的" # 发消息
98
116
 
99
117
  ---
100
118
 
119
+ ## 🧩 Claude Skills(v0.3 新增)
120
+
121
+ v0.3 起内置 5 个 Claude Skill,装完之后 Claude Code / Cursor 里的 Agent 在识别到
122
+ 闲鱼任务就会自动加载对应 skill 的知识库,**不再靠 zero-shot 试错**。
123
+
124
+ ```bash
125
+ # 装到 ~/.claude/skills/(默认)
126
+ goofish skills install
127
+
128
+ # 或者只看有哪些 skill,不拷贝
129
+ goofish skills install --list
130
+
131
+ # 或者装到自定义目录 + 覆盖已有的
132
+ goofish skills install --dest ./skills --force
133
+ ```
134
+
135
+ ### 5 个 skill 分工
136
+
137
+ | Skill | 什么时候激活 | 核心能力 |
138
+ |---|---|---|
139
+ | `goofish-overview` | 用户首次提闲鱼 / 问这工具能干啥 | 总入口,dispatch 到其他 4 个 skill |
140
+ | `goofish-publish-item` | 发商品 / 上架 / 挂闲置 | 类目识别 → 标题 5 段式 → 风控扫描 → 图片检查 → 确认发布 |
141
+ | `goofish-reply-buyer` | 回消息 / 看未读 / 议价 | 拉未读 → 意图 5 分类 → 议价三档(小刀/大刀/屠龙刀)→ 用户确认发送 |
142
+ | `goofish-risk-guard` | 发布前 / 发送前 / 被限流了 | 违禁词表、外联词正则、发布红线、x5sec 恢复指引(被其他 skill 频繁引用) |
143
+ | `goofish-shop-diagnosis` | 店铺没流量 / 曝光掉了 | 买家视角搜索 + 历史对比 → 归因清单 + 修复建议(纯读不写) |
144
+
145
+ skill 的源文件在仓库的 `skills/` 目录下(每个 skill 一个子目录,含 `SKILL.md`
146
+ + `references/*.md` 知识库)。也可以走 Claude Code Plugin Marketplace 安装:
147
+
148
+ ```bash
149
+ claude /plugin marketplace add fancyboi999/goofish-cli
150
+ ```
151
+
152
+ ---
153
+
154
+ ## OpenClaw / ClawHub
155
+
156
+ OpenClaw `2026.6.1` 及以上可把本仓库作为 compatible bundle 加载。ClawHub 发布后:
157
+
158
+ ```bash
159
+ openclaw plugins install clawhub:openclaw-goofish
160
+
161
+ # 登录态由用户在终端初始化,不交给 Agent 覆盖
162
+ uvx --from goofish-cli==0.3.0 goofish auth login --qr
163
+
164
+ openclaw plugins inspect goofish --json
165
+ openclaw gateway restart
166
+ ```
167
+
168
+ 本地开发无需发布:
169
+
170
+ ```bash
171
+ openclaw plugins install -l .
172
+ openclaw plugins inspect goofish --json
173
+ ```
174
+
175
+ 重启后新会话会获得 5 个 skills,以及 `goofish__auth_status`、
176
+ `goofish__item_get` 等 MCP tools。bundle 默认不暴露需要操作者执行或会长期阻塞的
177
+ `auth_login`、`auth_reset_guard`、`message_watch`、`skills_install`。
178
+
179
+ 运行 MCP server 需要 PATH 中有 [`uv`](https://docs.astral.sh/uv/)。完整说明见
180
+ [MCP 接入指南](./docs/mcp-setup.md)。
181
+
182
+ ---
183
+
101
184
  ## 📟 命令详略与真实输出
102
185
 
103
186
  <details open>
@@ -132,8 +215,8 @@ $ goofish list-commands --format table
132
215
 
133
216
  ```json
134
217
  {
135
- "unb": "2214350705775",
136
- "tracknick": "xy575986224572",
218
+ "unb": "<masked-unb>",
219
+ "tracknick": "<masked-tracknick>",
137
220
  "nick": "闲鱼用户昵称",
138
221
  "valid": true,
139
222
  "h5_token_exp": "2026-04-21T20:30:00+08:00"
@@ -151,10 +234,10 @@ $ goofish message watch
151
234
  实时输出(小号给主号发 3 条 + 主号读了所有消息):
152
235
 
153
236
  ```jsonl
154
- {"event":"message","cid":"60585751957","send_user_id":"2215266653893","send_user_name":"小号昵称","send_message":"测试消息1"}
155
- {"event":"message","cid":"60585751957","send_user_id":"2215266653893","send_user_name":"小号昵称","send_message":"测试消息2"}
156
- {"event":"message","cid":"60585751957","send_user_id":"2215266653893","send_user_name":"小号昵称","send_message":"测试消息3"}
157
- {"event":"read","cid":"60585751957","msg_ids":["4077151826249.PNM","4066820235744.PNM","4066826134477.PNM"],"status":1,"ts":"1776770953455"}
237
+ {"event":"message","cid":"<masked-cid>","send_user_id":"<masked-user-id>","send_user_name":"小号昵称","send_message":"测试消息1"}
238
+ {"event":"message","cid":"<masked-cid>","send_user_id":"<masked-user-id>","send_user_name":"小号昵称","send_message":"测试消息2"}
239
+ {"event":"message","cid":"<masked-cid>","send_user_id":"<masked-user-id>","send_user_name":"小号昵称","send_message":"测试消息3"}
240
+ {"event":"read","cid":"<masked-cid>","msg_ids":["<masked-msg-id-1>","<masked-msg-id-2>","<masked-msg-id-3>"],"status":1,"ts":"<masked-timestamp>"}
158
241
  ```
159
242
 
160
243
  | 事件 | 字段 |
@@ -170,12 +253,12 @@ $ goofish message watch
170
253
  <summary><b><code>goofish message send</code></b> — 主动发消息</summary>
171
254
 
172
255
  ```bash
173
- $ goofish message send 60585751957 2215266653893 \
256
+ $ goofish message send <masked-cid> <masked-user-id> \
174
257
  --text "在的 claude 测试成功 ✅" --item-id 1045171414271
175
258
  ```
176
259
 
177
260
  ```json
178
- {"ok": true, "mid": "1061776769407570", "cid": "60585751957"}
261
+ {"ok": true, "mid": "<masked-message-id>", "cid": "<masked-cid>"}
179
262
  ```
180
263
  </details>
181
264
 
@@ -246,10 +329,12 @@ Claude 会自动把全部命令看成 tool:`goofish_item_get` / `goofish_item_
246
329
  - [x] v0.1:12 个命令 + MCP + IM 三类事件
247
330
  - [x] v0.2:`goofish message list-chats`(会话列表 + sessionType 分类:1 真人 / 3 系统 / 6 互动 / 23 通知;`--watch-secs` 支持合并 WS `ackDiff(pts=0)` 历史推送补齐 h5 接口漏掉的会话)
248
331
  - [x] v0.2:浏览器自动化链路(吸纳 [OpenCLI](https://github.com/jackwener/opencli) 精华)—— Playwright + 系统 Chrome 驱动 `goofish search items` / `goofish item view`,抗风控 & 完整字段
249
- - [ ] v0.2:`goofish message create-chat`(主动与陌生用户建会话)
250
- - [ ] v0.2:Claude Skills 包装(`skills/` 目录)
251
- - [ ] v0.3:`goofish order`(订单状态查询 / 发货)
252
- - [ ] v0.3:支持发视频消息
332
+ - [x] v0.2.3 / v0.2.4:session 自动续命(passport 快速进入)+ `auth login --qr` 扫码兜底
333
+ - [x] v0.3:Claude Skills 包装(5 个 skill:overview / risk-guard / publish-item / reply-buyer / shop-diagnosis)+ `goofish skills install`
334
+ - [ ] v0.4:`goofish message create-chat`(主动与陌生用户建会话)
335
+ - [ ] v0.4:`goofish order`(订单状态查询 / 发货)
336
+ - [ ] v0.4:历史数据落盘(SQLite / JSONL),给 shop-diagnosis 做时序归因
337
+ - [ ] v0.5:支持发视频消息
253
338
 
254
339
  ---
255
340
 
@@ -15,12 +15,29 @@
15
15
 
16
16
  </div>
17
17
 
18
+ <p align="center">
19
+ <a href="media/goofish-cli-promo.mp4">
20
+ <img src="media/goofish-cli-promo.gif" alt="goofish-cli 演示" width="760">
21
+ </a>
22
+ <br>
23
+ <em>▶️ 点击查看带终端音效 + 配乐的高清 MP4(46s)</em>
24
+ </p>
25
+
26
+ <!--
27
+ 想在 README 里内嵌「带声音的播放器」?GitHub 上唯一的办法:
28
+ 1. 打开本仓库任意 issue / PR 评论框(或 Releases 编辑页)
29
+ 2. 把 media/goofish-cli-promo.mp4 拖进去,等它生成 https://github.com/user-attachments/assets/xxxx 链接
30
+ 3. 把那串链接单独一行粘进这里,GitHub 会自动渲染成带声音的播放器
31
+ (提交进仓库的 mp4 用 <video> 标签会被 GitHub 过滤,不渲染)
32
+ -->
33
+
18
34
  `goofish-cli` 把闲鱼(Xianyu/Goofish)的核心运营能力抽成一套结构化命令,
19
- **同一份定义**同时输出给三种消费者:
35
+ **同一份定义**同时输出给四种消费者:
20
36
 
21
37
  - 👨‍💻 **人类**:`goofish item get 12345 --format table`
22
38
  - 🤖 **AI Agent(Claude Code / Cursor / Codex)**:`uvx goofish-cli` → 自动注册成 MCP tool
23
- - 🧩 **Claude Skills**(规划中):`skills/` 目录直接放进 Agent
39
+ - 🧩 **Claude Skills**(v0.3):5 个内置 skill,`goofish skills install` 一行装到 `~/.claude/skills/`
40
+ - **OpenClaw**:ClawHub bundle 一次安装 MCP server + 5 个 skills
24
41
 
25
42
  > 架构思想来自 [opencli](https://github.com/jackwener/opencli) 的 single-registry 设计。
26
43
 
@@ -28,7 +45,7 @@
28
45
 
29
46
  ## ✨ 核心特性
30
47
 
31
- - 🔐 **13 个命令覆盖核心链路**:发布、下架、查询、图片上传、AI 类目识别、默认地址、IM 收发 + 会话列表
48
+ - 🔐 **17 个命令覆盖核心链路**:发布、下架、查询、图片上传、AI 类目识别、默认地址、IM 收发 + 会话列表、skills 安装
32
49
  - 📡 **真·实时 IM**:WebSocket 长连 + 自动重连 + **三类事件分类输出**
33
50
  - `event=message`(收到消息)· `event=read`(已读回执)· `event=new_msg`(轻量通知)
34
51
  - 🛡 **内置风控护栏**:令牌桶限流(1 写/分钟)+ RGV587 自动熔断
@@ -49,7 +66,7 @@ goofish auth login ~/Downloads/goofish-cookies.json
49
66
 
50
67
  # 3. 验证登录态
51
68
  goofish auth status
52
- # → {"unb":"2214350705775","tracknick":"xy575986224572","nick":"...","valid":true}
69
+ # → {"unb":"<masked-unb>","tracknick":"<masked-tracknick>","nick":"...","valid":true}
53
70
 
54
71
  # 4. 干活
55
72
  goofish item get 1045171414271
@@ -59,6 +76,71 @@ goofish message send <cid> <toid> --text "在的" # 发消息
59
76
 
60
77
  ---
61
78
 
79
+ ## 🧩 Claude Skills(v0.3 新增)
80
+
81
+ v0.3 起内置 5 个 Claude Skill,装完之后 Claude Code / Cursor 里的 Agent 在识别到
82
+ 闲鱼任务就会自动加载对应 skill 的知识库,**不再靠 zero-shot 试错**。
83
+
84
+ ```bash
85
+ # 装到 ~/.claude/skills/(默认)
86
+ goofish skills install
87
+
88
+ # 或者只看有哪些 skill,不拷贝
89
+ goofish skills install --list
90
+
91
+ # 或者装到自定义目录 + 覆盖已有的
92
+ goofish skills install --dest ./skills --force
93
+ ```
94
+
95
+ ### 5 个 skill 分工
96
+
97
+ | Skill | 什么时候激活 | 核心能力 |
98
+ |---|---|---|
99
+ | `goofish-overview` | 用户首次提闲鱼 / 问这工具能干啥 | 总入口,dispatch 到其他 4 个 skill |
100
+ | `goofish-publish-item` | 发商品 / 上架 / 挂闲置 | 类目识别 → 标题 5 段式 → 风控扫描 → 图片检查 → 确认发布 |
101
+ | `goofish-reply-buyer` | 回消息 / 看未读 / 议价 | 拉未读 → 意图 5 分类 → 议价三档(小刀/大刀/屠龙刀)→ 用户确认发送 |
102
+ | `goofish-risk-guard` | 发布前 / 发送前 / 被限流了 | 违禁词表、外联词正则、发布红线、x5sec 恢复指引(被其他 skill 频繁引用) |
103
+ | `goofish-shop-diagnosis` | 店铺没流量 / 曝光掉了 | 买家视角搜索 + 历史对比 → 归因清单 + 修复建议(纯读不写) |
104
+
105
+ skill 的源文件在仓库的 `skills/` 目录下(每个 skill 一个子目录,含 `SKILL.md`
106
+ + `references/*.md` 知识库)。也可以走 Claude Code Plugin Marketplace 安装:
107
+
108
+ ```bash
109
+ claude /plugin marketplace add fancyboi999/goofish-cli
110
+ ```
111
+
112
+ ---
113
+
114
+ ## OpenClaw / ClawHub
115
+
116
+ OpenClaw `2026.6.1` 及以上可把本仓库作为 compatible bundle 加载。ClawHub 发布后:
117
+
118
+ ```bash
119
+ openclaw plugins install clawhub:openclaw-goofish
120
+
121
+ # 登录态由用户在终端初始化,不交给 Agent 覆盖
122
+ uvx --from goofish-cli==0.3.0 goofish auth login --qr
123
+
124
+ openclaw plugins inspect goofish --json
125
+ openclaw gateway restart
126
+ ```
127
+
128
+ 本地开发无需发布:
129
+
130
+ ```bash
131
+ openclaw plugins install -l .
132
+ openclaw plugins inspect goofish --json
133
+ ```
134
+
135
+ 重启后新会话会获得 5 个 skills,以及 `goofish__auth_status`、
136
+ `goofish__item_get` 等 MCP tools。bundle 默认不暴露需要操作者执行或会长期阻塞的
137
+ `auth_login`、`auth_reset_guard`、`message_watch`、`skills_install`。
138
+
139
+ 运行 MCP server 需要 PATH 中有 [`uv`](https://docs.astral.sh/uv/)。完整说明见
140
+ [MCP 接入指南](./docs/mcp-setup.md)。
141
+
142
+ ---
143
+
62
144
  ## 📟 命令详略与真实输出
63
145
 
64
146
  <details open>
@@ -93,8 +175,8 @@ $ goofish list-commands --format table
93
175
 
94
176
  ```json
95
177
  {
96
- "unb": "2214350705775",
97
- "tracknick": "xy575986224572",
178
+ "unb": "<masked-unb>",
179
+ "tracknick": "<masked-tracknick>",
98
180
  "nick": "闲鱼用户昵称",
99
181
  "valid": true,
100
182
  "h5_token_exp": "2026-04-21T20:30:00+08:00"
@@ -112,10 +194,10 @@ $ goofish message watch
112
194
  实时输出(小号给主号发 3 条 + 主号读了所有消息):
113
195
 
114
196
  ```jsonl
115
- {"event":"message","cid":"60585751957","send_user_id":"2215266653893","send_user_name":"小号昵称","send_message":"测试消息1"}
116
- {"event":"message","cid":"60585751957","send_user_id":"2215266653893","send_user_name":"小号昵称","send_message":"测试消息2"}
117
- {"event":"message","cid":"60585751957","send_user_id":"2215266653893","send_user_name":"小号昵称","send_message":"测试消息3"}
118
- {"event":"read","cid":"60585751957","msg_ids":["4077151826249.PNM","4066820235744.PNM","4066826134477.PNM"],"status":1,"ts":"1776770953455"}
197
+ {"event":"message","cid":"<masked-cid>","send_user_id":"<masked-user-id>","send_user_name":"小号昵称","send_message":"测试消息1"}
198
+ {"event":"message","cid":"<masked-cid>","send_user_id":"<masked-user-id>","send_user_name":"小号昵称","send_message":"测试消息2"}
199
+ {"event":"message","cid":"<masked-cid>","send_user_id":"<masked-user-id>","send_user_name":"小号昵称","send_message":"测试消息3"}
200
+ {"event":"read","cid":"<masked-cid>","msg_ids":["<masked-msg-id-1>","<masked-msg-id-2>","<masked-msg-id-3>"],"status":1,"ts":"<masked-timestamp>"}
119
201
  ```
120
202
 
121
203
  | 事件 | 字段 |
@@ -131,12 +213,12 @@ $ goofish message watch
131
213
  <summary><b><code>goofish message send</code></b> — 主动发消息</summary>
132
214
 
133
215
  ```bash
134
- $ goofish message send 60585751957 2215266653893 \
216
+ $ goofish message send <masked-cid> <masked-user-id> \
135
217
  --text "在的 claude 测试成功 ✅" --item-id 1045171414271
136
218
  ```
137
219
 
138
220
  ```json
139
- {"ok": true, "mid": "1061776769407570", "cid": "60585751957"}
221
+ {"ok": true, "mid": "<masked-message-id>", "cid": "<masked-cid>"}
140
222
  ```
141
223
  </details>
142
224
 
@@ -207,10 +289,12 @@ Claude 会自动把全部命令看成 tool:`goofish_item_get` / `goofish_item_
207
289
  - [x] v0.1:12 个命令 + MCP + IM 三类事件
208
290
  - [x] v0.2:`goofish message list-chats`(会话列表 + sessionType 分类:1 真人 / 3 系统 / 6 互动 / 23 通知;`--watch-secs` 支持合并 WS `ackDiff(pts=0)` 历史推送补齐 h5 接口漏掉的会话)
209
291
  - [x] v0.2:浏览器自动化链路(吸纳 [OpenCLI](https://github.com/jackwener/opencli) 精华)—— Playwright + 系统 Chrome 驱动 `goofish search items` / `goofish item view`,抗风控 & 完整字段
210
- - [ ] v0.2:`goofish message create-chat`(主动与陌生用户建会话)
211
- - [ ] v0.2:Claude Skills 包装(`skills/` 目录)
212
- - [ ] v0.3:`goofish order`(订单状态查询 / 发货)
213
- - [ ] v0.3:支持发视频消息
292
+ - [x] v0.2.3 / v0.2.4:session 自动续命(passport 快速进入)+ `auth login --qr` 扫码兜底
293
+ - [x] v0.3:Claude Skills 包装(5 个 skill:overview / risk-guard / publish-item / reply-buyer / shop-diagnosis)+ `goofish skills install`
294
+ - [ ] v0.4:`goofish message create-chat`(主动与陌生用户建会话)
295
+ - [ ] v0.4:`goofish order`(订单状态查询 / 发货)
296
+ - [ ] v0.4:历史数据落盘(SQLite / JSONL),给 shop-diagnosis 做时序归因
297
+ - [ ] v0.5:支持发视频消息
214
298
 
215
299
  ---
216
300
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "goofish-cli"
7
- version = "0.2.4"
7
+ version = "0.3.0"
8
8
  description = "闲鱼 CLI — 支持 MCP,未来支持 Claude Skills。为 AI Agent 提供闲鱼自动化基础能力。"
9
9
  readme = "README.md"
10
10
  license = { text = "Apache-2.0" }
@@ -28,10 +28,13 @@ dependencies = [
28
28
  "rich>=13.7",
29
29
  "pyyaml>=6.0",
30
30
  "tenacity>=8.2",
31
- "mcp>=1.2",
31
+ # v2 renames FastMCP to MCPServer and requires a server migration.
32
+ # Keep the existing FastMCP implementation on the maintained v1 line for now.
33
+ "mcp>=1.2,<2",
32
34
  "websockets>=13",
33
35
  "browser-cookie3>=0.20",
34
36
  "playwright>=1.58.0",
37
+ "cryptography>=41.0",
35
38
  ]
36
39
 
37
40
  [project.optional-dependencies]
@@ -63,6 +66,23 @@ Changelog = "https://github.com/fancyboi999/goofish-cli/blob/main/CHANGELOG.md"
63
66
  [tool.hatch.build.targets.wheel]
64
67
  packages = ["src/goofish_cli"]
65
68
 
69
+ # 内置 Claude Skills:把项目根 `skills/` 收进 wheel 的 `goofish_cli/_bundled_skills/`,
70
+ # 让 `goofish skills install` 能按包内路径定位到它(当前实现用 `goofish_cli.__file__`
71
+ # 拼子路径,不依赖 importlib.resources,避免 namespace package 在不同 py 版本上的行为差异)。
72
+ [tool.hatch.build.targets.wheel.force-include]
73
+ "skills" = "src/goofish_cli/_bundled_skills"
74
+
75
+ [tool.hatch.build.targets.sdist]
76
+ include = [
77
+ "src/",
78
+ "skills/",
79
+ ".claude-plugin/",
80
+ "README.md",
81
+ "CHANGELOG.md",
82
+ "LICENSE",
83
+ "pyproject.toml",
84
+ ]
85
+
66
86
  [tool.ruff]
67
87
  line-length = 100
68
88
  target-version = "py311"