@round2ai/r2-cli 1.0.6 → 1.0.9-beta.0
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.
- package/README.md +61 -49
- package/dist/README.md +61 -49
- package/dist/package.json +7 -3
- package/dist/pages/login.html +62 -0
- package/dist/pages/xianyu-auth.html +73 -0
- package/dist/r2-cli.js +44 -28
- package/package.json +7 -3
- package/skills/r2-auth/SKILL.md +80 -0
- package/skills/r2-auth/_meta.json +5 -0
- package/skills/r2-cli/SKILL.md +70 -0
- package/skills/r2-cli/_meta.json +5 -0
- package/skills/r2-goods/SKILL.md +106 -0
- package/skills/r2-goods/_meta.json +5 -0
package/README.md
CHANGED
|
@@ -3,31 +3,25 @@
|
|
|
3
3
|
[](https://opensource.org/licenses/MIT)
|
|
4
4
|
[](https://www.npmjs.com/package/@round2ai/r2-cli)
|
|
5
5
|
|
|
6
|
-
R2-CLI — 二手潮奢交易命令行工具,由 [Round2AI](https://github.com/Round2AI) 团队维护 — 让人类和 AI Agent
|
|
6
|
+
R2-CLI — 二手潮奢交易命令行工具,由 [Round2AI](https://github.com/Round2AI) 团队维护 — 让人类和 AI Agent 都能在终端中完成商品上架等交易操作。
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
覆盖商品上架、认证登录等核心业务域,提供 3 个 AI Agent [Skills](./skills/)。
|
|
9
9
|
|
|
10
10
|
[安装](#安装与快速开始) · [AI Agent 快速开始](#快速开始ai-agent) · [Agent Skills](#agent-skills) · [认证](#认证) · [命令](#命令参考) · [安全](#安全与风险提示)
|
|
11
11
|
|
|
12
12
|
## 为什么选 R2-CLI?
|
|
13
13
|
|
|
14
|
-
- **为 Agent 原生设计** — 3 个 Skills 开箱即用,适配 Claude Code
|
|
14
|
+
- **为 Agent 原生设计** — 3 个 Skills 开箱即用,适配 Claude Code 等主流 AI 工具,Agent 无需额外适配即可操作
|
|
15
15
|
- **AI 友好调优** — 每条命令经过 Agent 实测验证,提供结构化 JSON 输出和智能默认值,大幅提升 Agent 调用成功率
|
|
16
|
-
- **双模架构** — 交互式向导(人类友好)+
|
|
17
|
-
- **三分钟上手** —
|
|
16
|
+
- **双模架构** — 交互式向导(人类友好)+ `--json` 参数(Agent 友好),同一命令两种调用方式
|
|
17
|
+
- **三分钟上手** — 扫码登录即可使用,从安装到第一次商品上架只需三步
|
|
18
18
|
|
|
19
19
|
## 功能
|
|
20
20
|
|
|
21
21
|
| 类别 | 能力 |
|
|
22
22
|
|------|------|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
| 🏪 店铺管理 | 查看已授权店铺(闲鱼/抖音) |
|
|
26
|
-
| 📊 经营分析 | 日报/周报、自然语言查询经营数据 |
|
|
27
|
-
| 🔍 市场分析 | 市场需求热度、竞价模拟、策略建议 |
|
|
28
|
-
| 💰 价格分析 | 收货价/售卖价建议、在售商品优化 |
|
|
29
|
-
| 📦 库存履约 | 滞销预警、库龄超期、履约追踪 |
|
|
30
|
-
| 🧠 经营决策 | 补货/清仓/调价/风控建议 |
|
|
23
|
+
| 认证登录 | 扫码登录(第二回合 APP / 微信 / 支付宝)、闲鱼店铺授权、状态查询、登出(支持 Agent 两步式流程) |
|
|
24
|
+
| 商品管理 | 商品上架(4 步流程:获取店铺 → 获取仓库 → 获取选品商品 → 提交上架 + 自动轮询上架结果)、店铺查看、仓库查看、选品商品查看 |
|
|
31
25
|
|
|
32
26
|
---
|
|
33
27
|
|
|
@@ -50,10 +44,7 @@ r2-cli auth login
|
|
|
50
44
|
# 2. 查看授权店铺
|
|
51
45
|
r2-cli goods shops
|
|
52
46
|
|
|
53
|
-
# 3.
|
|
54
|
-
r2-cli goods list --status wait
|
|
55
|
-
|
|
56
|
-
# 4. 交互式上架(7 步向导)
|
|
47
|
+
# 3. 交互式上架
|
|
57
48
|
r2-cli goods up
|
|
58
49
|
```
|
|
59
50
|
|
|
@@ -93,17 +84,22 @@ r2-cli auth login poll --token <qrToken> --expire <expireTimeMs> --interval <pol
|
|
|
93
84
|
r2-cli auth status
|
|
94
85
|
```
|
|
95
86
|
|
|
96
|
-
**第 4 步 —
|
|
87
|
+
**第 4 步 — 商品上架(4 步流程)**
|
|
88
|
+
|
|
89
|
+
> Agent 获取数据后展示给用户选择,不要让用户自己提供 ID。
|
|
97
90
|
|
|
98
91
|
```bash
|
|
99
|
-
#
|
|
100
|
-
r2-cli goods
|
|
101
|
-
|
|
102
|
-
#
|
|
103
|
-
r2-cli goods
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
r2-cli goods
|
|
92
|
+
# 1. 获取店铺 → 展示 shopId/shopName/platform → 用户选择
|
|
93
|
+
r2-cli goods shops --json
|
|
94
|
+
|
|
95
|
+
# 2. 获取仓库 → 展示 stockId/stockName → 用户选择
|
|
96
|
+
r2-cli goods stocks --json
|
|
97
|
+
|
|
98
|
+
# 3. 获取选品商品 → 展示 stockGoodsId/goodsName/brand/size/salePrice → 用户选择
|
|
99
|
+
r2-cli goods list --stock-id <stockId> --json
|
|
100
|
+
|
|
101
|
+
# 4. 提交上架(自动轮询上架结果)
|
|
102
|
+
r2-cli goods up --stock-goods-id <id> --shop-id <id> --price <amount> --json
|
|
107
103
|
```
|
|
108
104
|
|
|
109
105
|
---
|
|
@@ -124,9 +120,9 @@ npx skills add http://192.168.0.99:3000/puresnake/r2-cli.git -y -g
|
|
|
124
120
|
|
|
125
121
|
| Skill | 说明 |
|
|
126
122
|
|-------|------|
|
|
127
|
-
| `r2-auth` | 认证登录:两步式扫码登录(生成二维码 →
|
|
123
|
+
| `r2-auth` | 认证登录:两步式扫码登录(生成二维码 → 轮询确认,支持第二回合 APP / 微信 / 支付宝)、状态查询、登出 |
|
|
128
124
|
| `r2-cli` | 命令概览:安装检测、认证命令、商品管理命令、命令前缀自动识别 |
|
|
129
|
-
| `r2-goods` |
|
|
125
|
+
| `r2-goods` | 商品管理:4 步上架流程(获取数据 → 展示给用户 → 用户选择 → 提交上架 + 自动轮询结果)、交互式上架、店铺/仓库/商品查看、上架查询 |
|
|
130
126
|
|
|
131
127
|
---
|
|
132
128
|
|
|
@@ -137,10 +133,13 @@ npx skills add http://192.168.0.99:3000/puresnake/r2-cli.git -y -g
|
|
|
137
133
|
| `r2-cli auth login` | 扫码登录(交互式,人类使用) |
|
|
138
134
|
| `r2-cli auth login qr` | 生成二维码 JSON(Agent 第1步) |
|
|
139
135
|
| `r2-cli auth login poll --token <>` | 轮询登录状态 JSON(Agent 第2步) |
|
|
136
|
+
| `r2-cli auth xianyu` | 闲鱼店铺授权(交互式,人类使用) |
|
|
137
|
+
| `r2-cli auth xianyu qr` | 获取授权二维码 JSON(Agent 第1步) |
|
|
138
|
+
| `r2-cli auth xianyu poll --state <>` | 轮询授权状态 JSON(Agent 第2步) |
|
|
140
139
|
| `r2-cli auth status` | 查看登录状态 |
|
|
141
140
|
| `r2-cli auth logout` | 退出登录 |
|
|
142
141
|
|
|
143
|
-
Token 存储在 `~/.r2-cli/config.json
|
|
142
|
+
Token 存储在 `~/.r2-cli/config.json`(原子写入防丢失),过期后需重新登录。内存缓存带过期检查,不会使用失效凭证。扫码登录支持两种方式:终端 unicode 二维码 + 浏览器链接(页面展示第二回合品牌,实时更新扫码状态,成功后自动关闭)。支持第二回合 APP、微信、支付宝扫码。
|
|
144
143
|
|
|
145
144
|
---
|
|
146
145
|
|
|
@@ -150,30 +149,45 @@ Token 存储在 `~/.r2-cli/config.json`,过期自动刷新。
|
|
|
150
149
|
|
|
151
150
|
| 命令 | 说明 |
|
|
152
151
|
|------|------|
|
|
153
|
-
| `r2-cli goods shops
|
|
154
|
-
| `r2-cli goods
|
|
155
|
-
| `r2-cli goods
|
|
156
|
-
| `r2-cli goods
|
|
157
|
-
| `r2-cli goods
|
|
158
|
-
| `r2-cli goods
|
|
159
|
-
|
|
160
|
-
|
|
152
|
+
| `r2-cli goods shops [--json]` | 查看所有已授权店铺(跨平台) |
|
|
153
|
+
| `r2-cli goods stocks [--json]` | 查看所有仓库 |
|
|
154
|
+
| `r2-cli goods list --stock-id <id> [--json]` | 查看仓库中的选品商品 |
|
|
155
|
+
| `r2-cli goods listing --stock-goods-id <id> --shop-id <id> [--json]` | 查询上架信息 |
|
|
156
|
+
| `r2-cli goods up` | 交互式上架(自动轮询上架结果) |
|
|
157
|
+
| `r2-cli goods up --stock-goods-id <id> --shop-id <id> --price <amount>` | Agent 直接上架(自动轮询上架结果,`--json`) |
|
|
158
|
+
| `r2-cli goods down --id <id> [--json]` | 下架商品 |
|
|
159
|
+
| `r2-cli goods price --id <id> --price <amount> [--json]` | 修改上架价格 |
|
|
160
|
+
|
|
161
|
+
### 上架参数
|
|
162
|
+
|
|
163
|
+
| 参数 | 必填 | 说明 |
|
|
164
|
+
|------|------|------|
|
|
165
|
+
| `--stock-goods-id <id>` | 是 | 库存商品 ID(来自选品商品列表的 `stockGoodsId` 字段) |
|
|
166
|
+
| `--shop-id <id>` | 是 | 第三方店铺 ID(来自店铺列表的 `shopId` 字段,不是 `id`) |
|
|
167
|
+
| `--price <amount>` | 是 | 上架价格(正数) |
|
|
168
|
+
| `-p, --platform <platform>` | 否 | 平台,默认 xianyu |
|
|
169
|
+
| `--json` | 否 | JSON 输出(Agent 推荐) |
|
|
170
|
+
|
|
171
|
+
### 其他命令
|
|
161
172
|
|
|
162
173
|
| 命令 | 说明 |
|
|
163
174
|
|------|------|
|
|
164
|
-
| `r2-cli
|
|
165
|
-
| `r2-cli goods up address` | 设置/查看发货地址 |
|
|
166
|
-
| `r2-cli goods up categories` | 获取分类树 |
|
|
167
|
-
| `r2-cli goods up props <catId>` | 获取分类属性 |
|
|
168
|
-
| `r2-cli goods up submit --data @file.json ...` | 提交上架 |
|
|
175
|
+
| `r2-cli uninstall` | 卸载 R2-CLI 并清除所有配置 |
|
|
169
176
|
|
|
170
177
|
### 开发中
|
|
171
178
|
|
|
179
|
+
> 以下命令已显示在 `--help`,执行时提示暂未实现。
|
|
180
|
+
|
|
172
181
|
| 命令 | 说明 |
|
|
173
182
|
|------|------|
|
|
174
|
-
| `r2-cli
|
|
175
|
-
| `r2-cli
|
|
176
|
-
| `r2-cli
|
|
183
|
+
| `r2-cli ingest` | ERP 数据对接 |
|
|
184
|
+
| `r2-cli ask` | 自然语言查询经营数据 |
|
|
185
|
+
| `r2-cli demand` | 市场需求热度扫描 |
|
|
186
|
+
| `r2-cli fulfillment` | 履约全链路追踪 |
|
|
187
|
+
| `r2-cli simulate` | 竞价成交模拟 |
|
|
188
|
+
| `r2-cli bidding-strategy` | 竞价策略建议 |
|
|
189
|
+
| `r2-cli decide` | 经营动作建议 |
|
|
190
|
+
| `r2-cli agent` | AI Agent 集成 |
|
|
177
191
|
|
|
178
192
|
---
|
|
179
193
|
|
|
@@ -182,9 +196,8 @@ Token 存储在 `~/.r2-cli/config.json`,过期自动刷新。
|
|
|
182
196
|
本工具可供 AI Agent 调用以自动化操作二手潮奢交易,Agent 将以您的用户身份在授权范围内执行操作,可能导致商品误上架、价格错误等风险,请谨慎操作。
|
|
183
197
|
|
|
184
198
|
建议:
|
|
185
|
-
-
|
|
186
|
-
-
|
|
187
|
-
- Token 存储在本地 `~/.r2-cli/config.json`,注意保护
|
|
199
|
+
- Agent 提交前向用户确认关键参数(售价、店铺)
|
|
200
|
+
- Token 存储在本地 `~/.r2-cli/config.json`(原子写入,防止中断导致配置丢失),注意保护
|
|
188
201
|
|
|
189
202
|
---
|
|
190
203
|
|
|
@@ -208,7 +221,6 @@ PURESNAKE 深耕二手潮奢交易流通 6 年,累计鉴定超 400 万单,
|
|
|
208
221
|
| 协议 | MIT |
|
|
209
222
|
| 安装 | `npm install -g @round2ai/r2-cli` |
|
|
210
223
|
| 授权 | `r2-cli auth login` |
|
|
211
|
-
| 命令数 | 30+ |
|
|
212
224
|
| AI Agent Skills | 3 |
|
|
213
225
|
| 数据源 | 通过 ERP 对接各电商平台、线下 POS、自营仓储 WMS |
|
|
214
226
|
|
package/dist/README.md
CHANGED
|
@@ -3,31 +3,25 @@
|
|
|
3
3
|
[](https://opensource.org/licenses/MIT)
|
|
4
4
|
[](https://www.npmjs.com/package/@round2ai/r2-cli)
|
|
5
5
|
|
|
6
|
-
R2-CLI — 二手潮奢交易命令行工具,由 [Round2AI](https://github.com/Round2AI) 团队维护 — 让人类和 AI Agent
|
|
6
|
+
R2-CLI — 二手潮奢交易命令行工具,由 [Round2AI](https://github.com/Round2AI) 团队维护 — 让人类和 AI Agent 都能在终端中完成商品上架等交易操作。
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
覆盖商品上架、认证登录等核心业务域,提供 3 个 AI Agent [Skills](./skills/)。
|
|
9
9
|
|
|
10
10
|
[安装](#安装与快速开始) · [AI Agent 快速开始](#快速开始ai-agent) · [Agent Skills](#agent-skills) · [认证](#认证) · [命令](#命令参考) · [安全](#安全与风险提示)
|
|
11
11
|
|
|
12
12
|
## 为什么选 R2-CLI?
|
|
13
13
|
|
|
14
|
-
- **为 Agent 原生设计** — 3 个 Skills 开箱即用,适配 Claude Code
|
|
14
|
+
- **为 Agent 原生设计** — 3 个 Skills 开箱即用,适配 Claude Code 等主流 AI 工具,Agent 无需额外适配即可操作
|
|
15
15
|
- **AI 友好调优** — 每条命令经过 Agent 实测验证,提供结构化 JSON 输出和智能默认值,大幅提升 Agent 调用成功率
|
|
16
|
-
- **双模架构** — 交互式向导(人类友好)+
|
|
17
|
-
- **三分钟上手** —
|
|
16
|
+
- **双模架构** — 交互式向导(人类友好)+ `--json` 参数(Agent 友好),同一命令两种调用方式
|
|
17
|
+
- **三分钟上手** — 扫码登录即可使用,从安装到第一次商品上架只需三步
|
|
18
18
|
|
|
19
19
|
## 功能
|
|
20
20
|
|
|
21
21
|
| 类别 | 能力 |
|
|
22
22
|
|------|------|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
| 🏪 店铺管理 | 查看已授权店铺(闲鱼/抖音) |
|
|
26
|
-
| 📊 经营分析 | 日报/周报、自然语言查询经营数据 |
|
|
27
|
-
| 🔍 市场分析 | 市场需求热度、竞价模拟、策略建议 |
|
|
28
|
-
| 💰 价格分析 | 收货价/售卖价建议、在售商品优化 |
|
|
29
|
-
| 📦 库存履约 | 滞销预警、库龄超期、履约追踪 |
|
|
30
|
-
| 🧠 经营决策 | 补货/清仓/调价/风控建议 |
|
|
23
|
+
| 认证登录 | 扫码登录(第二回合 APP / 微信 / 支付宝)、闲鱼店铺授权、状态查询、登出(支持 Agent 两步式流程) |
|
|
24
|
+
| 商品管理 | 商品上架(4 步流程:获取店铺 → 获取仓库 → 获取选品商品 → 提交上架 + 自动轮询上架结果)、店铺查看、仓库查看、选品商品查看 |
|
|
31
25
|
|
|
32
26
|
---
|
|
33
27
|
|
|
@@ -50,10 +44,7 @@ r2-cli auth login
|
|
|
50
44
|
# 2. 查看授权店铺
|
|
51
45
|
r2-cli goods shops
|
|
52
46
|
|
|
53
|
-
# 3.
|
|
54
|
-
r2-cli goods list --status wait
|
|
55
|
-
|
|
56
|
-
# 4. 交互式上架(7 步向导)
|
|
47
|
+
# 3. 交互式上架
|
|
57
48
|
r2-cli goods up
|
|
58
49
|
```
|
|
59
50
|
|
|
@@ -93,17 +84,22 @@ r2-cli auth login poll --token <qrToken> --expire <expireTimeMs> --interval <pol
|
|
|
93
84
|
r2-cli auth status
|
|
94
85
|
```
|
|
95
86
|
|
|
96
|
-
**第 4 步 —
|
|
87
|
+
**第 4 步 — 商品上架(4 步流程)**
|
|
88
|
+
|
|
89
|
+
> Agent 获取数据后展示给用户选择,不要让用户自己提供 ID。
|
|
97
90
|
|
|
98
91
|
```bash
|
|
99
|
-
#
|
|
100
|
-
r2-cli goods
|
|
101
|
-
|
|
102
|
-
#
|
|
103
|
-
r2-cli goods
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
r2-cli goods
|
|
92
|
+
# 1. 获取店铺 → 展示 shopId/shopName/platform → 用户选择
|
|
93
|
+
r2-cli goods shops --json
|
|
94
|
+
|
|
95
|
+
# 2. 获取仓库 → 展示 stockId/stockName → 用户选择
|
|
96
|
+
r2-cli goods stocks --json
|
|
97
|
+
|
|
98
|
+
# 3. 获取选品商品 → 展示 stockGoodsId/goodsName/brand/size/salePrice → 用户选择
|
|
99
|
+
r2-cli goods list --stock-id <stockId> --json
|
|
100
|
+
|
|
101
|
+
# 4. 提交上架(自动轮询上架结果)
|
|
102
|
+
r2-cli goods up --stock-goods-id <id> --shop-id <id> --price <amount> --json
|
|
107
103
|
```
|
|
108
104
|
|
|
109
105
|
---
|
|
@@ -124,9 +120,9 @@ npx skills add http://192.168.0.99:3000/puresnake/r2-cli.git -y -g
|
|
|
124
120
|
|
|
125
121
|
| Skill | 说明 |
|
|
126
122
|
|-------|------|
|
|
127
|
-
| `r2-auth` | 认证登录:两步式扫码登录(生成二维码 →
|
|
123
|
+
| `r2-auth` | 认证登录:两步式扫码登录(生成二维码 → 轮询确认,支持第二回合 APP / 微信 / 支付宝)、状态查询、登出 |
|
|
128
124
|
| `r2-cli` | 命令概览:安装检测、认证命令、商品管理命令、命令前缀自动识别 |
|
|
129
|
-
| `r2-goods` |
|
|
125
|
+
| `r2-goods` | 商品管理:4 步上架流程(获取数据 → 展示给用户 → 用户选择 → 提交上架 + 自动轮询结果)、交互式上架、店铺/仓库/商品查看、上架查询 |
|
|
130
126
|
|
|
131
127
|
---
|
|
132
128
|
|
|
@@ -137,10 +133,13 @@ npx skills add http://192.168.0.99:3000/puresnake/r2-cli.git -y -g
|
|
|
137
133
|
| `r2-cli auth login` | 扫码登录(交互式,人类使用) |
|
|
138
134
|
| `r2-cli auth login qr` | 生成二维码 JSON(Agent 第1步) |
|
|
139
135
|
| `r2-cli auth login poll --token <>` | 轮询登录状态 JSON(Agent 第2步) |
|
|
136
|
+
| `r2-cli auth xianyu` | 闲鱼店铺授权(交互式,人类使用) |
|
|
137
|
+
| `r2-cli auth xianyu qr` | 获取授权二维码 JSON(Agent 第1步) |
|
|
138
|
+
| `r2-cli auth xianyu poll --state <>` | 轮询授权状态 JSON(Agent 第2步) |
|
|
140
139
|
| `r2-cli auth status` | 查看登录状态 |
|
|
141
140
|
| `r2-cli auth logout` | 退出登录 |
|
|
142
141
|
|
|
143
|
-
Token 存储在 `~/.r2-cli/config.json
|
|
142
|
+
Token 存储在 `~/.r2-cli/config.json`(原子写入防丢失),过期后需重新登录。内存缓存带过期检查,不会使用失效凭证。扫码登录支持两种方式:终端 unicode 二维码 + 浏览器链接(页面展示第二回合品牌,实时更新扫码状态,成功后自动关闭)。支持第二回合 APP、微信、支付宝扫码。
|
|
144
143
|
|
|
145
144
|
---
|
|
146
145
|
|
|
@@ -150,30 +149,45 @@ Token 存储在 `~/.r2-cli/config.json`,过期自动刷新。
|
|
|
150
149
|
|
|
151
150
|
| 命令 | 说明 |
|
|
152
151
|
|------|------|
|
|
153
|
-
| `r2-cli goods shops
|
|
154
|
-
| `r2-cli goods
|
|
155
|
-
| `r2-cli goods
|
|
156
|
-
| `r2-cli goods
|
|
157
|
-
| `r2-cli goods
|
|
158
|
-
| `r2-cli goods
|
|
159
|
-
|
|
160
|
-
|
|
152
|
+
| `r2-cli goods shops [--json]` | 查看所有已授权店铺(跨平台) |
|
|
153
|
+
| `r2-cli goods stocks [--json]` | 查看所有仓库 |
|
|
154
|
+
| `r2-cli goods list --stock-id <id> [--json]` | 查看仓库中的选品商品 |
|
|
155
|
+
| `r2-cli goods listing --stock-goods-id <id> --shop-id <id> [--json]` | 查询上架信息 |
|
|
156
|
+
| `r2-cli goods up` | 交互式上架(自动轮询上架结果) |
|
|
157
|
+
| `r2-cli goods up --stock-goods-id <id> --shop-id <id> --price <amount>` | Agent 直接上架(自动轮询上架结果,`--json`) |
|
|
158
|
+
| `r2-cli goods down --id <id> [--json]` | 下架商品 |
|
|
159
|
+
| `r2-cli goods price --id <id> --price <amount> [--json]` | 修改上架价格 |
|
|
160
|
+
|
|
161
|
+
### 上架参数
|
|
162
|
+
|
|
163
|
+
| 参数 | 必填 | 说明 |
|
|
164
|
+
|------|------|------|
|
|
165
|
+
| `--stock-goods-id <id>` | 是 | 库存商品 ID(来自选品商品列表的 `stockGoodsId` 字段) |
|
|
166
|
+
| `--shop-id <id>` | 是 | 第三方店铺 ID(来自店铺列表的 `shopId` 字段,不是 `id`) |
|
|
167
|
+
| `--price <amount>` | 是 | 上架价格(正数) |
|
|
168
|
+
| `-p, --platform <platform>` | 否 | 平台,默认 xianyu |
|
|
169
|
+
| `--json` | 否 | JSON 输出(Agent 推荐) |
|
|
170
|
+
|
|
171
|
+
### 其他命令
|
|
161
172
|
|
|
162
173
|
| 命令 | 说明 |
|
|
163
174
|
|------|------|
|
|
164
|
-
| `r2-cli
|
|
165
|
-
| `r2-cli goods up address` | 设置/查看发货地址 |
|
|
166
|
-
| `r2-cli goods up categories` | 获取分类树 |
|
|
167
|
-
| `r2-cli goods up props <catId>` | 获取分类属性 |
|
|
168
|
-
| `r2-cli goods up submit --data @file.json ...` | 提交上架 |
|
|
175
|
+
| `r2-cli uninstall` | 卸载 R2-CLI 并清除所有配置 |
|
|
169
176
|
|
|
170
177
|
### 开发中
|
|
171
178
|
|
|
179
|
+
> 以下命令已显示在 `--help`,执行时提示暂未实现。
|
|
180
|
+
|
|
172
181
|
| 命令 | 说明 |
|
|
173
182
|
|------|------|
|
|
174
|
-
| `r2-cli
|
|
175
|
-
| `r2-cli
|
|
176
|
-
| `r2-cli
|
|
183
|
+
| `r2-cli ingest` | ERP 数据对接 |
|
|
184
|
+
| `r2-cli ask` | 自然语言查询经营数据 |
|
|
185
|
+
| `r2-cli demand` | 市场需求热度扫描 |
|
|
186
|
+
| `r2-cli fulfillment` | 履约全链路追踪 |
|
|
187
|
+
| `r2-cli simulate` | 竞价成交模拟 |
|
|
188
|
+
| `r2-cli bidding-strategy` | 竞价策略建议 |
|
|
189
|
+
| `r2-cli decide` | 经营动作建议 |
|
|
190
|
+
| `r2-cli agent` | AI Agent 集成 |
|
|
177
191
|
|
|
178
192
|
---
|
|
179
193
|
|
|
@@ -182,9 +196,8 @@ Token 存储在 `~/.r2-cli/config.json`,过期自动刷新。
|
|
|
182
196
|
本工具可供 AI Agent 调用以自动化操作二手潮奢交易,Agent 将以您的用户身份在授权范围内执行操作,可能导致商品误上架、价格错误等风险,请谨慎操作。
|
|
183
197
|
|
|
184
198
|
建议:
|
|
185
|
-
-
|
|
186
|
-
-
|
|
187
|
-
- Token 存储在本地 `~/.r2-cli/config.json`,注意保护
|
|
199
|
+
- Agent 提交前向用户确认关键参数(售价、店铺)
|
|
200
|
+
- Token 存储在本地 `~/.r2-cli/config.json`(原子写入,防止中断导致配置丢失),注意保护
|
|
188
201
|
|
|
189
202
|
---
|
|
190
203
|
|
|
@@ -208,7 +221,6 @@ PURESNAKE 深耕二手潮奢交易流通 6 年,累计鉴定超 400 万单,
|
|
|
208
221
|
| 协议 | MIT |
|
|
209
222
|
| 安装 | `npm install -g @round2ai/r2-cli` |
|
|
210
223
|
| 授权 | `r2-cli auth login` |
|
|
211
|
-
| 命令数 | 40+ |
|
|
212
224
|
| AI Agent Skills | 3 |
|
|
213
225
|
| 数据源 | 通过 ERP 对接各电商平台、线下 POS、自营仓储 WMS |
|
|
214
226
|
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@round2ai/r2-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9-beta.0",
|
|
4
4
|
"description": "R2-CLI,向 AI 开放二手潮奢交易全链路能力",
|
|
5
5
|
"main": "dist/r2-cli.js",
|
|
6
6
|
"type": "module",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"keywords": [
|
|
16
16
|
"round2ai",
|
|
17
|
+
"r2",
|
|
17
18
|
"r2-cli",
|
|
18
19
|
"cli",
|
|
19
20
|
"ai",
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
],
|
|
24
25
|
"files": [
|
|
25
26
|
"dist",
|
|
26
|
-
"
|
|
27
|
+
"skills",
|
|
27
28
|
"package.json",
|
|
28
29
|
"README.md"
|
|
29
30
|
],
|
|
@@ -32,7 +33,10 @@
|
|
|
32
33
|
"engines": {
|
|
33
34
|
"node": ">=18.0.0"
|
|
34
35
|
},
|
|
35
|
-
"repository":
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://github.com/Round2AI/r2-cli"
|
|
39
|
+
},
|
|
36
40
|
"dependencies": {
|
|
37
41
|
"@inquirer/prompts": "^8.4.2",
|
|
38
42
|
"chalk": "^5.3.0",
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
|
3
|
+
<title>第二回合 - 扫码登录</title>
|
|
4
|
+
<style>
|
|
5
|
+
*{box-sizing:border-box;margin:0;padding:0}
|
|
6
|
+
:root{--primary:#06d290;--primary-light:#06d2901a;--primary-dark:#06d290cc;--text:#1a1a1a;--text-muted:#8c8c8c;--bg:#f7f8fa;--card:#fff;--border:#e8e8e8;--radius:16px;--shadow:0 2px 16px #06d2901a;--success:#52c41a;--error:#ff4d4f;--info:#1890ff}
|
|
7
|
+
body{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh;font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;background:var(--bg);color:var(--text)}
|
|
8
|
+
.card{background:var(--card);border-radius:var(--radius);padding:40px 32px 32px;box-shadow:var(--shadow);border:1px solid var(--border);text-align:center;max-width:360px;width:90%;transition:all .3s ease}
|
|
9
|
+
.brand{margin-bottom:24px}
|
|
10
|
+
.brand-name{font-size:22px;font-weight:700;color:var(--text);letter-spacing:2px}
|
|
11
|
+
.brand-sub{font-size:10px;color:var(--text-muted);margin-top:4px;letter-spacing:3px;text-transform:uppercase;font-weight:500}
|
|
12
|
+
img#qr{max-width:200px;border-radius:12px;transition:all .3s ease}
|
|
13
|
+
img#qr.dimmed{opacity:.15;filter:blur(4px);transform:scale(.95)}
|
|
14
|
+
.status-text{font-size:16px;font-weight:600;color:var(--text);margin-top:16px}
|
|
15
|
+
.hint{color:var(--text-muted);font-size:13px;margin-top:6px}
|
|
16
|
+
.scan-methods{display:flex;justify-content:center;gap:8px;margin-top:20px;flex-wrap:wrap}
|
|
17
|
+
.scan-methods span{font-size:11px;font-weight:500;padding:4px 12px;border-radius:6px;border:1px solid var(--border);color:var(--text-muted);background:var(--card);transition:all .2s ease}
|
|
18
|
+
.scan-methods span:hover{border-color:var(--primary);color:var(--primary-dark)}
|
|
19
|
+
.status-icon{font-size:56px;margin-bottom:8px;animation:popIn .4s cubic-bezier(.175,.885,.32,1.275)}
|
|
20
|
+
@keyframes popIn{0%{transform:scale(0);opacity:0}100%{transform:scale(1);opacity:1}}
|
|
21
|
+
.success-bg .card{border-color:var(--success);box-shadow:0 2px 16px rgba(82,196,26,.12)}
|
|
22
|
+
.success-bg .status-text{color:var(--success)}
|
|
23
|
+
.expired-bg .card{border-color:var(--error);box-shadow:0 2px 16px rgba(255,77,79,.1)}
|
|
24
|
+
.expired-bg .status-text{color:var(--error)}
|
|
25
|
+
.scanning-bg .card{border-color:var(--info);box-shadow:0 2px 16px rgba(24,144,255,.1)}
|
|
26
|
+
.scanning-bg .status-text{color:var(--info)}
|
|
27
|
+
.pulse{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--info);animation:pulse 1.4s infinite;margin-right:6px;vertical-align:middle}
|
|
28
|
+
@keyframes pulse{0%{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}
|
|
29
|
+
.divider{display:flex;align-items:center;gap:12px;margin-top:20px;color:var(--text-muted);font-size:11px}
|
|
30
|
+
.divider::before,.divider::after{content:"";flex:1;height:1px;background:var(--border)}
|
|
31
|
+
</style></head>
|
|
32
|
+
<body>
|
|
33
|
+
<div class="card" id="app">
|
|
34
|
+
<div class="brand"><div class="brand-name">第二回合</div><div class="brand-sub">Round2AI</div></div>
|
|
35
|
+
<img id="qr" src="./qr.png" alt="第二回合 - 扫码登录"/>
|
|
36
|
+
<p class="status-text" id="statusText">请扫码登录</p>
|
|
37
|
+
<div class="divider">支持扫码方式</div>
|
|
38
|
+
<div class="scan-methods"><span>第二回合 APP</span><span>微信</span><span>支付宝</span></div>
|
|
39
|
+
<p class="hint" id="hint"></p>
|
|
40
|
+
</div>
|
|
41
|
+
<script>
|
|
42
|
+
const qr=document.getElementById("qr"),st=document.getElementById("statusText"),ht=document.getElementById("hint"),app=document.getElementById("app"),bd=document.body;
|
|
43
|
+
const states={
|
|
44
|
+
waiting:{icon:"",text:"请扫码登录",hint:"",bg:"",dim:false},
|
|
45
|
+
scanning:{icon:"",text:'<span class="pulse"></span>已扫码,请在手机上确认',hint:"等待确认中...",bg:"scanning-bg",dim:true},
|
|
46
|
+
success:{icon:"✅",text:"登录成功!",hint:"可关闭此页面",bg:"success-bg",dim:true},
|
|
47
|
+
expired:{icon:"⏰",text:"二维码已过期",hint:"请重新获取",bg:"expired-bg",dim:true}
|
|
48
|
+
};
|
|
49
|
+
function render(s){
|
|
50
|
+
const d=states[s]||states.waiting;
|
|
51
|
+
bd.className=d.bg;
|
|
52
|
+
if(d.icon){
|
|
53
|
+
qr.style.display="none";
|
|
54
|
+
app.innerHTML='<div class="brand"><div class="brand-name">第二回合</div><div class="brand-sub">Round2AI</div></div><div class="status-icon">'+d.icon+'</div><p class="status-text">'+d.text+'</p>'+(d.hint?'<p class="hint">'+d.hint+'</p>':'');
|
|
55
|
+
}else{
|
|
56
|
+
qr.style.display="";qr.classList.toggle("dimmed",d.dim);st.innerHTML=d.text;ht.textContent=d.hint;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const es=new EventSource("./events");
|
|
60
|
+
es.onmessage=function(e){try{const d=JSON.parse(e.data);if(d.status)render(d.status)}catch(ex){}};
|
|
61
|
+
es.onerror=function(){es.close()};
|
|
62
|
+
</script></body></html>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
|
3
|
+
<title>闲鱼店铺授权</title>
|
|
4
|
+
<style>
|
|
5
|
+
*{box-sizing:border-box;margin:0;padding:0}
|
|
6
|
+
:root{--primary:#FFE60F;--primary-light:#FFE60F1a;--primary-dark:#FFE60Fcc;--text:#1a1a1a;--text-muted:#8c8c8c;--bg:#f7f8fa;--card:#fff;--border:#e8e8e8;--radius:16px;--shadow:0 2px 16px #FFE60F1a;--success:#52c41a;--error:#ff4d4f;--info:#1890ff}
|
|
7
|
+
body{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh;font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;background:var(--bg);color:var(--text)}
|
|
8
|
+
.card{background:var(--card);border-radius:var(--radius);padding:40px 32px 32px;box-shadow:var(--shadow);border:1px solid var(--border);text-align:center;max-width:360px;width:90%;transition:all .3s ease}
|
|
9
|
+
.brand{margin-bottom:24px}
|
|
10
|
+
.brand-name{font-size:22px;font-weight:700;color:var(--text);letter-spacing:2px}
|
|
11
|
+
.brand-sub{font-size:10px;color:var(--text-muted);margin-top:4px;letter-spacing:3px;text-transform:uppercase;font-weight:500}
|
|
12
|
+
img#qr{max-width:200px;border-radius:12px;transition:all .3s ease}
|
|
13
|
+
img#qr.dimmed{opacity:.15;filter:blur(4px);transform:scale(.95)}
|
|
14
|
+
.status-text{font-size:16px;font-weight:600;color:var(--text);margin-top:16px}
|
|
15
|
+
.hint{color:var(--text-muted);font-size:13px;margin-top:6px}
|
|
16
|
+
.scan-methods{display:flex;justify-content:center;gap:8px;margin-top:20px;flex-wrap:wrap}
|
|
17
|
+
.scan-methods span{font-size:11px;font-weight:500;padding:4px 12px;border-radius:6px;border:1px solid var(--border);color:var(--text-muted);background:var(--card);transition:all .2s ease}
|
|
18
|
+
.scan-methods span:hover{border-color:var(--primary);color:var(--primary-dark)}
|
|
19
|
+
.auth-btn{display:inline-block;margin-top:16px;padding:10px 32px;border-radius:8px;background:var(--primary);color:#fff;font-size:14px;font-weight:600;text-decoration:none;letter-spacing:1px;transition:all .2s ease}
|
|
20
|
+
.auth-btn:hover{background:var(--primary-dark);transform:translateY(-1px);box-shadow:0 4px 12px #FFE60F33}
|
|
21
|
+
.status-icon{font-size:56px;margin-bottom:8px;animation:popIn .4s cubic-bezier(.175,.885,.32,1.275)}
|
|
22
|
+
@keyframes popIn{0%{transform:scale(0);opacity:0}100%{transform:scale(1);opacity:1}}
|
|
23
|
+
.success-bg .card{border-color:var(--success);box-shadow:0 2px 16px rgba(82,196,26,.12)}
|
|
24
|
+
.success-bg .status-text{color:var(--success)}
|
|
25
|
+
.expired-bg .card{border-color:var(--error);box-shadow:0 2px 16px rgba(255,77,79,.1)}
|
|
26
|
+
.expired-bg .status-text{color:var(--error)}
|
|
27
|
+
.scanning-bg .card{border-color:var(--info);box-shadow:0 2px 16px rgba(24,144,255,.1)}
|
|
28
|
+
.scanning-bg .status-text{color:var(--info)}
|
|
29
|
+
.pulse{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--info);animation:pulse 1.4s infinite;margin-right:6px;vertical-align:middle}
|
|
30
|
+
@keyframes pulse{0%{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}
|
|
31
|
+
.divider{display:flex;align-items:center;gap:12px;margin-top:20px;color:var(--text-muted);font-size:11px}
|
|
32
|
+
.divider::before,.divider::after{content:"";flex:1;height:1px;background:var(--border)}
|
|
33
|
+
</style></head>
|
|
34
|
+
<body>
|
|
35
|
+
<div class="card" id="app">
|
|
36
|
+
<div class="brand"><div class="brand-name">闲鱼授权</div><div class="brand-sub">Round2AI</div></div>
|
|
37
|
+
<img id="qr" src="./qr.png" alt="闲鱼店铺授权"/>
|
|
38
|
+
<p class="status-text" id="statusText">请扫码授权</p>
|
|
39
|
+
<div class="divider">支持扫码方式</div>
|
|
40
|
+
<div class="scan-methods"><span>闲鱼 APP</span><span>微信</span></div>
|
|
41
|
+
<div class="divider">或</div>
|
|
42
|
+
<a class="auth-btn" id="auth-btn" style="display:none" href="#" target="_blank">点击授权</a>
|
|
43
|
+
<p class="hint" id="hint"></p>
|
|
44
|
+
</div>
|
|
45
|
+
<script>
|
|
46
|
+
const qr=document.getElementById("qr"),st=document.getElementById("statusText"),ht=document.getElementById("hint"),app=document.getElementById("app"),bd=document.body;
|
|
47
|
+
const states={
|
|
48
|
+
waiting:{icon:"",text:"请扫码授权",hint:"",bg:"",dim:false},
|
|
49
|
+
scanning:{icon:"",text:'<span class="pulse"></span>处理中...',hint:"等待确认中...",bg:"scanning-bg",dim:true},
|
|
50
|
+
success:{icon:"✅",text:"授权成功!",hint:"可关闭此页面",bg:"success-bg",dim:true},
|
|
51
|
+
expired:{icon:"⏰",text:"二维码已过期",hint:"请重新获取",bg:"expired-bg",dim:true}
|
|
52
|
+
};
|
|
53
|
+
function render(s){
|
|
54
|
+
const d=states[s]||states.waiting;
|
|
55
|
+
bd.className=d.bg;
|
|
56
|
+
if(d.icon){
|
|
57
|
+
qr.style.display="none";
|
|
58
|
+
app.innerHTML='<div class="brand"><div class="brand-name">闲鱼授权</div><div class="brand-sub">Round2AI</div></div><div class="status-icon">'+d.icon+'</div><p class="status-text">'+d.text+'</p>'+(d.hint?'<p class="hint">'+d.hint+'</p>':'');
|
|
59
|
+
}else{
|
|
60
|
+
qr.style.display="";qr.classList.toggle("dimmed",d.dim);st.innerHTML=d.text;ht.textContent=d.hint;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
fetch("./config").then(function(r){return r.json()}).then(function(data){
|
|
64
|
+
if(data.authUrl){
|
|
65
|
+
var btn=document.getElementById("auth-btn");
|
|
66
|
+
btn.href=data.authUrl;
|
|
67
|
+
btn.style.display="";
|
|
68
|
+
}
|
|
69
|
+
}).catch(function(){});
|
|
70
|
+
const es=new EventSource("./events");
|
|
71
|
+
es.onmessage=function(e){try{const d=JSON.parse(e.data);if(d.status)render(d.status)}catch(ex){}};
|
|
72
|
+
es.onerror=function(){es.close()};
|
|
73
|
+
</script></body></html>
|