@round2ai/r2-cli 1.0.10 → 1.0.12-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.
@@ -1,70 +0,0 @@
1
- ---
2
- name: r2-cli
3
- description: R2-CLI 二手潮奢交易 CLI 工具。用于认证登录、商品上架/下架/改价、查看店铺/仓库/选品商品/上架列表。Agent 获取数据后展示给用户选择,完成 4 步上架流程。触发词:r2-cli、登录、上架、下架、改价、商品、goods、auth、shops、stocks、listing。
4
- ---
5
-
6
- # R2-CLI Skill
7
-
8
- 二手潮奢交易命令行工具,由 Round2AI 团队维护。覆盖商品上架、认证登录等核心业务域。
9
-
10
- ## 安装
11
-
12
- ```bash
13
- npm install -g @round2ai/r2-cli@latest
14
- ```
15
-
16
- ## 命令前缀自动检测
17
-
18
- 首次使用时检测一次,后续所有命令使用检测到的前缀:
19
-
20
- 1. 项目目录有 `package.json`(name 含 r2-cli)→ `npm run dev --`
21
- 2. 存在 `dist/r2-cli.js` → `node dist/r2-cli.js`
22
- 3. `r2-cli --version` 成功 → `r2-cli`
23
-
24
- > 部分平台 npm 会拦截 `--help` 等 flag,改用 `npx tsx src/entrypoints/r2-cli.tsx --help`。
25
-
26
- ## 前置条件
27
-
28
- - 先登录:`r2-cli auth login`(支持第二回合 APP / 微信 / 支付宝扫码)
29
- - 检查状态:`r2-cli auth status`
30
-
31
- 所有 `--json` 命令输出 `{ success: false, error: "..." }` 格式错误,检查 `success` 判断成败。
32
-
33
- ## 认证命令
34
-
35
- | 命令 | 说明 |
36
- |------|------|
37
- | `r2-cli auth login` | 扫码登录(自动打开浏览器,人类使用) |
38
- | `r2-cli auth login --json` | 扫码登录(自动打开浏览器 + JSON 输出,Agent 推荐) |
39
- | `r2-cli auth login poll --token <>` | 手动轮询登录状态(备选方案,不推荐) |
40
- | `r2-cli auth xianyu` | 闲鱼店铺授权(自动打开浏览器,人类使用) |
41
- | `r2-cli auth xianyu --json` | 闲鱼店铺授权(自动打开浏览器 + JSON 输出,Agent 推荐) |
42
- | `r2-cli auth xianyu poll --state <>` | 手动轮询授权状态(备选方案,不推荐) |
43
- | `r2-cli auth status` | 查看登录状态 |
44
- | `r2-cli auth logout` | 退出登录 |
45
-
46
- > 认证登录的详细 Agent 操作流程见 **r2-auth** skill。
47
-
48
- ## 商品管理命令
49
-
50
- | 命令 | 说明 |
51
- |------|------|
52
- | `r2-cli goods shops [--json]` | 查看所有已授权店铺(跨平台) |
53
- | `r2-cli goods stocks [--json]` | 查看所有仓库 |
54
- | `r2-cli goods list [--stock-id <id>] [--stock-goods-id <id>] [--json]` | 查看选品商品(两个过滤参数均为可选,支持 `--page` 和 `--size`) |
55
- | `r2-cli goods listing [--json]` | 查询上架列表(支持 `--id` / `--shop-id` / `--stock-goods-id` / `--stock-id` / `--status` / `--platform` 过滤) |
56
- | `r2-cli goods up` | 交互式上架(自动轮询上架结果) |
57
- | `r2-cli goods up --stock-goods-id <id> --shop-id <id> --price <amount> --json` | Agent 直接上架(自动轮询上架结果) |
58
- | `r2-cli goods down --id <id> [--json]` | 下架商品(也可用 `--stock-goods-id <id> --shop-id <id>`) |
59
- | `r2-cli goods price --id <id> --price <amount> [--json]` | 修改上架价格(也可用 `--stock-goods-id <id> --shop-id <id>`) |
60
-
61
- ## Agent 上架 4 步流程
62
-
63
- **核心原则:Agent 获取数据后展示给用户选择,不要让用户自己提供 ID。**
64
-
65
- 1. `r2-cli goods shops --json` → 展示店铺(`shopId`、`shopName`、`platform`)→ 用户选择
66
- 2. `r2-cli goods stocks --json` → 展示仓库(`stockId`、`stockName`)→ 用户选择
67
- 3. `r2-cli goods list --stock-id <id> --json` → 展示商品(`stockGoodsId`、`goodsName`、`brand`、`size`、`salePrice`)→ 用户选择(也可用 `--stock-goods-id <id>` 查询单个商品)
68
- 4. `r2-cli goods up --stock-goods-id <id> --shop-id <id> --price <amount> --json` → 提交上架(自动轮询结果)
69
-
70
- > 完整流程、参数说明和注意事项见 **r2-goods** skill。
File without changes