@round2ai/r2-cli 1.0.7 → 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 +60 -41
- package/dist/README.md +60 -41
- package/dist/package.json +6 -2
- 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 +6 -2
- package/skills/r2-auth/SKILL.md +33 -40
- package/skills/r2-cli/SKILL.md +37 -22
- package/skills/r2-goods/SKILL.md +52 -128
package/README.md
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
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
|
|
|
@@ -13,16 +13,15 @@ R2-CLI — 二手潮奢交易命令行工具,由 [Round2AI](https://github.com
|
|
|
13
13
|
|
|
14
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
|
-
| 店铺管理 | 查看已授权店铺(闲鱼/抖音) |
|
|
23
|
+
| 认证登录 | 扫码登录(第二回合 APP / 微信 / 支付宝)、闲鱼店铺授权、状态查询、登出(支持 Agent 两步式流程) |
|
|
24
|
+
| 商品管理 | 商品上架(4 步流程:获取店铺 → 获取仓库 → 获取选品商品 → 提交上架 + 自动轮询上架结果)、店铺查看、仓库查看、选品商品查看 |
|
|
26
25
|
|
|
27
26
|
---
|
|
28
27
|
|
|
@@ -45,10 +44,7 @@ r2-cli auth login
|
|
|
45
44
|
# 2. 查看授权店铺
|
|
46
45
|
r2-cli goods shops
|
|
47
46
|
|
|
48
|
-
# 3.
|
|
49
|
-
r2-cli goods list --status wait
|
|
50
|
-
|
|
51
|
-
# 4. 交互式上架(7 步向导)
|
|
47
|
+
# 3. 交互式上架
|
|
52
48
|
r2-cli goods up
|
|
53
49
|
```
|
|
54
50
|
|
|
@@ -88,17 +84,22 @@ r2-cli auth login poll --token <qrToken> --expire <expireTimeMs> --interval <pol
|
|
|
88
84
|
r2-cli auth status
|
|
89
85
|
```
|
|
90
86
|
|
|
91
|
-
**第 4 步 —
|
|
87
|
+
**第 4 步 — 商品上架(4 步流程)**
|
|
88
|
+
|
|
89
|
+
> Agent 获取数据后展示给用户选择,不要让用户自己提供 ID。
|
|
92
90
|
|
|
93
91
|
```bash
|
|
94
|
-
#
|
|
95
|
-
r2-cli goods
|
|
96
|
-
|
|
97
|
-
#
|
|
98
|
-
r2-cli goods
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
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
|
|
102
103
|
```
|
|
103
104
|
|
|
104
105
|
---
|
|
@@ -119,9 +120,9 @@ npx skills add http://192.168.0.99:3000/puresnake/r2-cli.git -y -g
|
|
|
119
120
|
|
|
120
121
|
| Skill | 说明 |
|
|
121
122
|
|-------|------|
|
|
122
|
-
| `r2-auth` | 认证登录:两步式扫码登录(生成二维码 →
|
|
123
|
+
| `r2-auth` | 认证登录:两步式扫码登录(生成二维码 → 轮询确认,支持第二回合 APP / 微信 / 支付宝)、状态查询、登出 |
|
|
123
124
|
| `r2-cli` | 命令概览:安装检测、认证命令、商品管理命令、命令前缀自动识别 |
|
|
124
|
-
| `r2-goods` |
|
|
125
|
+
| `r2-goods` | 商品管理:4 步上架流程(获取数据 → 展示给用户 → 用户选择 → 提交上架 + 自动轮询结果)、交互式上架、店铺/仓库/商品查看、上架查询 |
|
|
125
126
|
|
|
126
127
|
---
|
|
127
128
|
|
|
@@ -132,10 +133,13 @@ npx skills add http://192.168.0.99:3000/puresnake/r2-cli.git -y -g
|
|
|
132
133
|
| `r2-cli auth login` | 扫码登录(交互式,人类使用) |
|
|
133
134
|
| `r2-cli auth login qr` | 生成二维码 JSON(Agent 第1步) |
|
|
134
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步) |
|
|
135
139
|
| `r2-cli auth status` | 查看登录状态 |
|
|
136
140
|
| `r2-cli auth logout` | 退出登录 |
|
|
137
141
|
|
|
138
|
-
Token 存储在 `~/.r2-cli/config.json
|
|
142
|
+
Token 存储在 `~/.r2-cli/config.json`(原子写入防丢失),过期后需重新登录。内存缓存带过期检查,不会使用失效凭证。扫码登录支持两种方式:终端 unicode 二维码 + 浏览器链接(页面展示第二回合品牌,实时更新扫码状态,成功后自动关闭)。支持第二回合 APP、微信、支付宝扫码。
|
|
139
143
|
|
|
140
144
|
---
|
|
141
145
|
|
|
@@ -145,28 +149,45 @@ Token 存储在 `~/.r2-cli/config.json`,过期自动刷新。
|
|
|
145
149
|
|
|
146
150
|
| 命令 | 说明 |
|
|
147
151
|
|------|------|
|
|
148
|
-
| `r2-cli goods shops
|
|
149
|
-
| `r2-cli goods
|
|
150
|
-
| `r2-cli goods
|
|
151
|
-
| `r2-cli goods
|
|
152
|
-
| `r2-cli goods
|
|
153
|
-
| `r2-cli goods
|
|
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 推荐) |
|
|
154
170
|
|
|
155
|
-
###
|
|
171
|
+
### 其他命令
|
|
156
172
|
|
|
157
173
|
| 命令 | 说明 |
|
|
158
174
|
|------|------|
|
|
159
|
-
| `r2-cli
|
|
160
|
-
| `r2-cli goods up address` | 设置/查看发货地址 |
|
|
161
|
-
| `r2-cli goods up categories` | 获取分类树 |
|
|
162
|
-
| `r2-cli goods up props <catId>` | 获取分类属性 |
|
|
163
|
-
| `r2-cli goods up submit --data @file.json ...` | 提交上架 |
|
|
175
|
+
| `r2-cli uninstall` | 卸载 R2-CLI 并清除所有配置 |
|
|
164
176
|
|
|
165
|
-
###
|
|
177
|
+
### 开发中
|
|
178
|
+
|
|
179
|
+
> 以下命令已显示在 `--help`,执行时提示暂未实现。
|
|
166
180
|
|
|
167
181
|
| 命令 | 说明 |
|
|
168
182
|
|------|------|
|
|
169
|
-
| `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 集成 |
|
|
170
191
|
|
|
171
192
|
---
|
|
172
193
|
|
|
@@ -175,9 +196,8 @@ Token 存储在 `~/.r2-cli/config.json`,过期自动刷新。
|
|
|
175
196
|
本工具可供 AI Agent 调用以自动化操作二手潮奢交易,Agent 将以您的用户身份在授权范围内执行操作,可能导致商品误上架、价格错误等风险,请谨慎操作。
|
|
176
197
|
|
|
177
198
|
建议:
|
|
178
|
-
-
|
|
179
|
-
-
|
|
180
|
-
- Token 存储在本地 `~/.r2-cli/config.json`,注意保护
|
|
199
|
+
- Agent 提交前向用户确认关键参数(售价、店铺)
|
|
200
|
+
- Token 存储在本地 `~/.r2-cli/config.json`(原子写入,防止中断导致配置丢失),注意保护
|
|
181
201
|
|
|
182
202
|
---
|
|
183
203
|
|
|
@@ -201,7 +221,6 @@ PURESNAKE 深耕二手潮奢交易流通 6 年,累计鉴定超 400 万单,
|
|
|
201
221
|
| 协议 | MIT |
|
|
202
222
|
| 安装 | `npm install -g @round2ai/r2-cli` |
|
|
203
223
|
| 授权 | `r2-cli auth login` |
|
|
204
|
-
| 命令数 | 20+ |
|
|
205
224
|
| AI Agent Skills | 3 |
|
|
206
225
|
| 数据源 | 通过 ERP 对接各电商平台、线下 POS、自营仓储 WMS |
|
|
207
226
|
|
package/dist/README.md
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
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
|
|
|
@@ -13,16 +13,15 @@ R2-CLI — 二手潮奢交易命令行工具,由 [Round2AI](https://github.com
|
|
|
13
13
|
|
|
14
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
|
-
| 店铺管理 | 查看已授权店铺(闲鱼/抖音) |
|
|
23
|
+
| 认证登录 | 扫码登录(第二回合 APP / 微信 / 支付宝)、闲鱼店铺授权、状态查询、登出(支持 Agent 两步式流程) |
|
|
24
|
+
| 商品管理 | 商品上架(4 步流程:获取店铺 → 获取仓库 → 获取选品商品 → 提交上架 + 自动轮询上架结果)、店铺查看、仓库查看、选品商品查看 |
|
|
26
25
|
|
|
27
26
|
---
|
|
28
27
|
|
|
@@ -45,10 +44,7 @@ r2-cli auth login
|
|
|
45
44
|
# 2. 查看授权店铺
|
|
46
45
|
r2-cli goods shops
|
|
47
46
|
|
|
48
|
-
# 3.
|
|
49
|
-
r2-cli goods list --status wait
|
|
50
|
-
|
|
51
|
-
# 4. 交互式上架(7 步向导)
|
|
47
|
+
# 3. 交互式上架
|
|
52
48
|
r2-cli goods up
|
|
53
49
|
```
|
|
54
50
|
|
|
@@ -88,17 +84,22 @@ r2-cli auth login poll --token <qrToken> --expire <expireTimeMs> --interval <pol
|
|
|
88
84
|
r2-cli auth status
|
|
89
85
|
```
|
|
90
86
|
|
|
91
|
-
**第 4 步 —
|
|
87
|
+
**第 4 步 — 商品上架(4 步流程)**
|
|
88
|
+
|
|
89
|
+
> Agent 获取数据后展示给用户选择,不要让用户自己提供 ID。
|
|
92
90
|
|
|
93
91
|
```bash
|
|
94
|
-
#
|
|
95
|
-
r2-cli goods
|
|
96
|
-
|
|
97
|
-
#
|
|
98
|
-
r2-cli goods
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
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
|
|
102
103
|
```
|
|
103
104
|
|
|
104
105
|
---
|
|
@@ -119,9 +120,9 @@ npx skills add http://192.168.0.99:3000/puresnake/r2-cli.git -y -g
|
|
|
119
120
|
|
|
120
121
|
| Skill | 说明 |
|
|
121
122
|
|-------|------|
|
|
122
|
-
| `r2-auth` | 认证登录:两步式扫码登录(生成二维码 →
|
|
123
|
+
| `r2-auth` | 认证登录:两步式扫码登录(生成二维码 → 轮询确认,支持第二回合 APP / 微信 / 支付宝)、状态查询、登出 |
|
|
123
124
|
| `r2-cli` | 命令概览:安装检测、认证命令、商品管理命令、命令前缀自动识别 |
|
|
124
|
-
| `r2-goods` |
|
|
125
|
+
| `r2-goods` | 商品管理:4 步上架流程(获取数据 → 展示给用户 → 用户选择 → 提交上架 + 自动轮询结果)、交互式上架、店铺/仓库/商品查看、上架查询 |
|
|
125
126
|
|
|
126
127
|
---
|
|
127
128
|
|
|
@@ -132,10 +133,13 @@ npx skills add http://192.168.0.99:3000/puresnake/r2-cli.git -y -g
|
|
|
132
133
|
| `r2-cli auth login` | 扫码登录(交互式,人类使用) |
|
|
133
134
|
| `r2-cli auth login qr` | 生成二维码 JSON(Agent 第1步) |
|
|
134
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步) |
|
|
135
139
|
| `r2-cli auth status` | 查看登录状态 |
|
|
136
140
|
| `r2-cli auth logout` | 退出登录 |
|
|
137
141
|
|
|
138
|
-
Token 存储在 `~/.r2-cli/config.json
|
|
142
|
+
Token 存储在 `~/.r2-cli/config.json`(原子写入防丢失),过期后需重新登录。内存缓存带过期检查,不会使用失效凭证。扫码登录支持两种方式:终端 unicode 二维码 + 浏览器链接(页面展示第二回合品牌,实时更新扫码状态,成功后自动关闭)。支持第二回合 APP、微信、支付宝扫码。
|
|
139
143
|
|
|
140
144
|
---
|
|
141
145
|
|
|
@@ -145,28 +149,45 @@ Token 存储在 `~/.r2-cli/config.json`,过期自动刷新。
|
|
|
145
149
|
|
|
146
150
|
| 命令 | 说明 |
|
|
147
151
|
|------|------|
|
|
148
|
-
| `r2-cli goods shops
|
|
149
|
-
| `r2-cli goods
|
|
150
|
-
| `r2-cli goods
|
|
151
|
-
| `r2-cli goods
|
|
152
|
-
| `r2-cli goods
|
|
153
|
-
| `r2-cli goods
|
|
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 推荐) |
|
|
154
170
|
|
|
155
|
-
###
|
|
171
|
+
### 其他命令
|
|
156
172
|
|
|
157
173
|
| 命令 | 说明 |
|
|
158
174
|
|------|------|
|
|
159
|
-
| `r2-cli
|
|
160
|
-
| `r2-cli goods up address` | 设置/查看发货地址 |
|
|
161
|
-
| `r2-cli goods up categories` | 获取分类树 |
|
|
162
|
-
| `r2-cli goods up props <catId>` | 获取分类属性 |
|
|
163
|
-
| `r2-cli goods up submit --data @file.json ...` | 提交上架 |
|
|
175
|
+
| `r2-cli uninstall` | 卸载 R2-CLI 并清除所有配置 |
|
|
164
176
|
|
|
165
|
-
###
|
|
177
|
+
### 开发中
|
|
178
|
+
|
|
179
|
+
> 以下命令已显示在 `--help`,执行时提示暂未实现。
|
|
166
180
|
|
|
167
181
|
| 命令 | 说明 |
|
|
168
182
|
|------|------|
|
|
169
|
-
| `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 集成 |
|
|
170
191
|
|
|
171
192
|
---
|
|
172
193
|
|
|
@@ -175,9 +196,8 @@ Token 存储在 `~/.r2-cli/config.json`,过期自动刷新。
|
|
|
175
196
|
本工具可供 AI Agent 调用以自动化操作二手潮奢交易,Agent 将以您的用户身份在授权范围内执行操作,可能导致商品误上架、价格错误等风险,请谨慎操作。
|
|
176
197
|
|
|
177
198
|
建议:
|
|
178
|
-
-
|
|
179
|
-
-
|
|
180
|
-
- Token 存储在本地 `~/.r2-cli/config.json`,注意保护
|
|
199
|
+
- Agent 提交前向用户确认关键参数(售价、店铺)
|
|
200
|
+
- Token 存储在本地 `~/.r2-cli/config.json`(原子写入,防止中断导致配置丢失),注意保护
|
|
181
201
|
|
|
182
202
|
---
|
|
183
203
|
|
|
@@ -201,7 +221,6 @@ PURESNAKE 深耕二手潮奢交易流通 6 年,累计鉴定超 400 万单,
|
|
|
201
221
|
| 协议 | MIT |
|
|
202
222
|
| 安装 | `npm install -g @round2ai/r2-cli` |
|
|
203
223
|
| 授权 | `r2-cli auth login` |
|
|
204
|
-
| 命令数 | 20+ |
|
|
205
224
|
| AI Agent Skills | 3 |
|
|
206
225
|
| 数据源 | 通过 ERP 对接各电商平台、线下 POS、自营仓储 WMS |
|
|
207
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",
|
|
@@ -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>
|