polyv-live-cli 1.2.30 → 1.2.31-rc.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 +81 -422
- package/dist/commands/account.commands.d.ts.map +1 -1
- package/dist/commands/account.commands.js +298 -0
- package/dist/commands/account.commands.js.map +1 -1
- package/dist/commands/ai.commands.d.ts +4 -1
- package/dist/commands/ai.commands.d.ts.map +1 -1
- package/dist/commands/ai.commands.js +245 -6
- package/dist/commands/ai.commands.js.map +1 -1
- package/dist/commands/card-push.commands.d.ts +1 -0
- package/dist/commands/card-push.commands.d.ts.map +1 -1
- package/dist/commands/card-push.commands.js +66 -0
- package/dist/commands/card-push.commands.js.map +1 -1
- package/dist/commands/channel.commands.d.ts +6 -1
- package/dist/commands/channel.commands.d.ts.map +1 -1
- package/dist/commands/channel.commands.js +752 -0
- package/dist/commands/channel.commands.js.map +1 -1
- package/dist/commands/chat.commands.d.ts +10 -0
- package/dist/commands/chat.commands.d.ts.map +1 -1
- package/dist/commands/chat.commands.js +397 -0
- package/dist/commands/chat.commands.js.map +1 -1
- package/dist/commands/checkin.commands.d.ts.map +1 -1
- package/dist/commands/checkin.commands.js +34 -0
- package/dist/commands/checkin.commands.js.map +1 -1
- package/dist/commands/coupon.commands.d.ts +2 -0
- package/dist/commands/coupon.commands.d.ts.map +1 -1
- package/dist/commands/coupon.commands.js +140 -0
- package/dist/commands/coupon.commands.js.map +1 -1
- package/dist/commands/document.commands.d.ts.map +1 -1
- package/dist/commands/document.commands.js +79 -0
- package/dist/commands/document.commands.js.map +1 -1
- package/dist/commands/donate.commands.d.ts.map +1 -1
- package/dist/commands/donate.commands.js +42 -0
- package/dist/commands/donate.commands.js.map +1 -1
- package/dist/commands/index.d.ts +5 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +11 -1
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/lottery.commands.d.ts +3 -0
- package/dist/commands/lottery.commands.d.ts.map +1 -1
- package/dist/commands/lottery.commands.js +378 -1
- package/dist/commands/lottery.commands.js.map +1 -1
- package/dist/commands/monitor.commands.d.ts.map +1 -1
- package/dist/commands/monitor.commands.js +54 -0
- package/dist/commands/monitor.commands.js.map +1 -1
- package/dist/commands/platform.commands.d.ts.map +1 -1
- package/dist/commands/platform.commands.js +377 -0
- package/dist/commands/platform.commands.js.map +1 -1
- package/dist/commands/playback.commands.d.ts.map +1 -1
- package/dist/commands/playback.commands.js +115 -0
- package/dist/commands/playback.commands.js.map +1 -1
- package/dist/commands/player.commands.d.ts.map +1 -1
- package/dist/commands/player.commands.js +202 -0
- package/dist/commands/player.commands.js.map +1 -1
- package/dist/commands/product.commands.d.ts +3 -0
- package/dist/commands/product.commands.d.ts.map +1 -1
- package/dist/commands/product.commands.js +388 -0
- package/dist/commands/product.commands.js.map +1 -1
- package/dist/commands/promotion.commands.d.ts.map +1 -1
- package/dist/commands/promotion.commands.js +2 -0
- package/dist/commands/promotion.commands.js.map +1 -1
- package/dist/commands/qa.commands.d.ts +2 -0
- package/dist/commands/qa.commands.d.ts.map +1 -1
- package/dist/commands/qa.commands.js +164 -0
- package/dist/commands/qa.commands.js.map +1 -1
- package/dist/commands/questionnaire.commands.d.ts +2 -0
- package/dist/commands/questionnaire.commands.d.ts.map +1 -1
- package/dist/commands/questionnaire.commands.js +115 -0
- package/dist/commands/questionnaire.commands.js.map +1 -1
- package/dist/commands/record.commands.d.ts.map +1 -1
- package/dist/commands/record.commands.js +154 -0
- package/dist/commands/record.commands.js.map +1 -1
- package/dist/commands/session.commands.d.ts.map +1 -1
- package/dist/commands/session.commands.js +95 -0
- package/dist/commands/session.commands.js.map +1 -1
- package/dist/commands/statistics.commands.d.ts.map +1 -1
- package/dist/commands/statistics.commands.js +200 -0
- package/dist/commands/statistics.commands.js.map +1 -1
- package/dist/commands/stream.commands.d.ts.map +1 -1
- package/dist/commands/stream.commands.js +115 -0
- package/dist/commands/stream.commands.js.map +1 -1
- package/dist/commands/transmit.commands.d.ts +1 -0
- package/dist/commands/transmit.commands.d.ts.map +1 -1
- package/dist/commands/transmit.commands.js +33 -0
- package/dist/commands/transmit.commands.js.map +1 -1
- package/dist/commands/viewer.commands.d.ts.map +1 -1
- package/dist/commands/viewer.commands.js +274 -0
- package/dist/commands/viewer.commands.js.map +1 -1
- package/dist/handlers/card-push.handler.d.ts +5 -2
- package/dist/handlers/card-push.handler.d.ts.map +1 -1
- package/dist/handlers/card-push.handler.js +34 -0
- package/dist/handlers/card-push.handler.js.map +1 -1
- package/dist/handlers/channel.handler.d.ts +50 -0
- package/dist/handlers/channel.handler.d.ts.map +1 -1
- package/dist/handlers/channel.handler.js +421 -0
- package/dist/handlers/channel.handler.js.map +1 -1
- package/dist/handlers/chat.handler.d.ts +238 -1
- package/dist/handlers/chat.handler.d.ts.map +1 -1
- package/dist/handlers/chat.handler.js +379 -0
- package/dist/handlers/chat.handler.js.map +1 -1
- package/dist/handlers/checkin.handler.d.ts +4 -1
- package/dist/handlers/checkin.handler.d.ts.map +1 -1
- package/dist/handlers/checkin.handler.js +41 -0
- package/dist/handlers/checkin.handler.js.map +1 -1
- package/dist/handlers/coupon.handler.d.ts +27 -0
- package/dist/handlers/coupon.handler.d.ts.map +1 -1
- package/dist/handlers/coupon.handler.js +117 -0
- package/dist/handlers/coupon.handler.js.map +1 -1
- package/dist/handlers/document.handler.d.ts +17 -0
- package/dist/handlers/document.handler.d.ts.map +1 -1
- package/dist/handlers/document.handler.js +67 -0
- package/dist/handlers/document.handler.js.map +1 -1
- package/dist/handlers/donate.handler.d.ts +4 -1
- package/dist/handlers/donate.handler.d.ts.map +1 -1
- package/dist/handlers/donate.handler.js +44 -0
- package/dist/handlers/donate.handler.js.map +1 -1
- package/dist/handlers/lottery.handler.d.ts +29 -1
- package/dist/handlers/lottery.handler.d.ts.map +1 -1
- package/dist/handlers/lottery.handler.js +319 -2
- package/dist/handlers/lottery.handler.js.map +1 -1
- package/dist/handlers/platform.handler.d.ts +19 -2
- package/dist/handlers/platform.handler.d.ts.map +1 -1
- package/dist/handlers/platform.handler.js +183 -13
- package/dist/handlers/platform.handler.js.map +1 -1
- package/dist/handlers/playback.handler.d.ts +20 -0
- package/dist/handlers/playback.handler.d.ts.map +1 -1
- package/dist/handlers/playback.handler.js +91 -0
- package/dist/handlers/playback.handler.js.map +1 -1
- package/dist/handlers/player.handler.d.ts +22 -0
- package/dist/handlers/player.handler.d.ts.map +1 -1
- package/dist/handlers/player.handler.js +61 -0
- package/dist/handlers/player.handler.js.map +1 -1
- package/dist/handlers/product.handler.d.ts +141 -1
- package/dist/handlers/product.handler.d.ts.map +1 -1
- package/dist/handlers/product.handler.js +288 -0
- package/dist/handlers/product.handler.js.map +1 -1
- package/dist/handlers/promotion.handler.d.ts.map +1 -1
- package/dist/handlers/promotion.handler.js +2 -0
- package/dist/handlers/promotion.handler.js.map +1 -1
- package/dist/handlers/qa-questionnaire.handler.d.ts +15 -1
- package/dist/handlers/qa-questionnaire.handler.d.ts.map +1 -1
- package/dist/handlers/qa-questionnaire.handler.js +179 -0
- package/dist/handlers/qa-questionnaire.handler.js.map +1 -1
- package/dist/handlers/record.handler.d.ts +32 -0
- package/dist/handlers/record.handler.d.ts.map +1 -1
- package/dist/handlers/record.handler.js +146 -0
- package/dist/handlers/record.handler.js.map +1 -1
- package/dist/handlers/session.handler.d.ts +20 -0
- package/dist/handlers/session.handler.d.ts.map +1 -1
- package/dist/handlers/session.handler.js +68 -0
- package/dist/handlers/session.handler.js.map +1 -1
- package/dist/handlers/statistics.handler.d.ts +4 -0
- package/dist/handlers/statistics.handler.d.ts.map +1 -1
- package/dist/handlers/statistics.handler.js +11 -0
- package/dist/handlers/statistics.handler.js.map +1 -1
- package/dist/handlers/stream.handler.d.ts +73 -1
- package/dist/handlers/stream.handler.d.ts.map +1 -1
- package/dist/handlers/stream.handler.js +120 -0
- package/dist/handlers/stream.handler.js.map +1 -1
- package/dist/handlers/transmit.handler.d.ts +8 -1
- package/dist/handlers/transmit.handler.d.ts.map +1 -1
- package/dist/handlers/transmit.handler.js +26 -0
- package/dist/handlers/transmit.handler.js.map +1 -1
- package/dist/handlers/viewer.handler.d.ts +29 -1
- package/dist/handlers/viewer.handler.d.ts.map +1 -1
- package/dist/handlers/viewer.handler.js +399 -8
- package/dist/handlers/viewer.handler.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +114 -19
- package/dist/index.js.map +1 -1
- package/dist/services/ai-digital-human-service.d.ts +2 -0
- package/dist/services/ai-digital-human-service.d.ts.map +1 -1
- package/dist/services/ai-digital-human-service.js +14 -15
- package/dist/services/ai-digital-human-service.js.map +1 -1
- package/dist/services/card-push-service.d.ts +4 -1
- package/dist/services/card-push-service.d.ts.map +1 -1
- package/dist/services/card-push-service.js +34 -0
- package/dist/services/card-push-service.js.map +1 -1
- package/dist/services/channel.service.sdk.d.ts +73 -0
- package/dist/services/channel.service.sdk.d.ts.map +1 -1
- package/dist/services/channel.service.sdk.js +508 -0
- package/dist/services/channel.service.sdk.js.map +1 -1
- package/dist/services/chat.service.sdk.d.ts +170 -0
- package/dist/services/chat.service.sdk.d.ts.map +1 -1
- package/dist/services/chat.service.sdk.js +256 -0
- package/dist/services/chat.service.sdk.js.map +1 -1
- package/dist/services/checkin-service.d.ts +2 -1
- package/dist/services/checkin-service.d.ts.map +1 -1
- package/dist/services/checkin-service.js +12 -0
- package/dist/services/checkin-service.js.map +1 -1
- package/dist/services/document.service.sdk.d.ts +13 -0
- package/dist/services/document.service.sdk.d.ts.map +1 -1
- package/dist/services/document.service.sdk.js +28 -0
- package/dist/services/document.service.sdk.js.map +1 -1
- package/dist/services/lottery-service.d.ts +19 -1
- package/dist/services/lottery-service.d.ts.map +1 -1
- package/dist/services/lottery-service.js +204 -2
- package/dist/services/lottery-service.js.map +1 -1
- package/dist/services/platform-label-service.d.ts +1 -0
- package/dist/services/platform-label-service.d.ts.map +1 -1
- package/dist/services/platform-label-service.js +20 -6
- package/dist/services/platform-label-service.js.map +1 -1
- package/dist/services/platform-service.d.ts +12 -1
- package/dist/services/platform-service.d.ts.map +1 -1
- package/dist/services/platform-service.js +46 -2
- package/dist/services/platform-service.js.map +1 -1
- package/dist/services/playback.service.sdk.d.ts +27 -0
- package/dist/services/playback.service.sdk.d.ts.map +1 -1
- package/dist/services/playback.service.sdk.js +38 -2
- package/dist/services/playback.service.sdk.js.map +1 -1
- package/dist/services/player.service.sdk.d.ts +12 -0
- package/dist/services/player.service.sdk.d.ts.map +1 -1
- package/dist/services/player.service.sdk.js +36 -0
- package/dist/services/player.service.sdk.js.map +1 -1
- package/dist/services/product.service.sdk.d.ts +78 -1
- package/dist/services/product.service.sdk.d.ts.map +1 -1
- package/dist/services/product.service.sdk.js +470 -0
- package/dist/services/product.service.sdk.js.map +1 -1
- package/dist/services/promotion-service.d.ts +1 -0
- package/dist/services/promotion-service.d.ts.map +1 -1
- package/dist/services/promotion-service.js +27 -23
- package/dist/services/promotion-service.js.map +1 -1
- package/dist/services/qa-questionnaire-service.d.ts +11 -1
- package/dist/services/qa-questionnaire-service.d.ts.map +1 -1
- package/dist/services/qa-questionnaire-service.js +128 -0
- package/dist/services/qa-questionnaire-service.js.map +1 -1
- package/dist/services/record.service.sdk.d.ts +67 -0
- package/dist/services/record.service.sdk.d.ts.map +1 -1
- package/dist/services/record.service.sdk.js +60 -3
- package/dist/services/record.service.sdk.js.map +1 -1
- package/dist/services/session.service.sdk.d.ts +34 -0
- package/dist/services/session.service.sdk.d.ts.map +1 -1
- package/dist/services/session.service.sdk.js +36 -0
- package/dist/services/session.service.sdk.js.map +1 -1
- package/dist/services/statistics.service.sdk.d.ts +21 -0
- package/dist/services/statistics.service.sdk.d.ts.map +1 -1
- package/dist/services/statistics.service.sdk.js +99 -0
- package/dist/services/statistics.service.sdk.js.map +1 -1
- package/dist/services/stream.service.sdk.d.ts +19 -0
- package/dist/services/stream.service.sdk.d.ts.map +1 -1
- package/dist/services/stream.service.sdk.js +109 -0
- package/dist/services/stream.service.sdk.js.map +1 -1
- package/dist/services/transmit-service.d.ts +7 -0
- package/dist/services/transmit-service.d.ts.map +1 -1
- package/dist/services/transmit-service.js +28 -14
- package/dist/services/transmit-service.js.map +1 -1
- package/dist/services/viewer-service.d.ts +15 -1
- package/dist/services/viewer-service.d.ts.map +1 -1
- package/dist/services/viewer-service.js +118 -0
- package/dist/services/viewer-service.js.map +1 -1
- package/dist/setup/resource-handlers.js +2 -3
- package/dist/setup/resource-handlers.js.map +1 -1
- package/dist/types/auth-source.types.d.ts +2 -2
- package/dist/types/auth-source.types.js +2 -2
- package/dist/types/auth-source.types.js.map +1 -1
- package/dist/types/card-push.d.ts +15 -0
- package/dist/types/card-push.d.ts.map +1 -1
- package/dist/types/chat.d.ts +12 -0
- package/dist/types/chat.d.ts.map +1 -1
- package/dist/types/checkin.d.ts +9 -0
- package/dist/types/checkin.d.ts.map +1 -1
- package/dist/types/donate.d.ts +9 -0
- package/dist/types/donate.d.ts.map +1 -1
- package/dist/types/interaction.d.ts +87 -0
- package/dist/types/interaction.d.ts.map +1 -1
- package/dist/types/lottery.d.ts +56 -0
- package/dist/types/lottery.d.ts.map +1 -1
- package/dist/types/platform.d.ts +69 -0
- package/dist/types/platform.d.ts.map +1 -1
- package/dist/types/product.d.ts +82 -0
- package/dist/types/product.d.ts.map +1 -1
- package/dist/types/promotion.d.ts +1 -0
- package/dist/types/promotion.d.ts.map +1 -1
- package/dist/types/qa.d.ts +111 -0
- package/dist/types/qa.d.ts.map +1 -1
- package/dist/types/record.d.ts +1 -0
- package/dist/types/record.d.ts.map +1 -1
- package/dist/types/viewer.d.ts +103 -0
- package/dist/types/viewer.d.ts.map +1 -1
- package/package.json +31 -30
- package/LICENSE +0 -21
package/README.md
CHANGED
|
@@ -1,504 +1,163 @@
|
|
|
1
|
-
# PolyV Live CLI
|
|
1
|
+
# PolyV Live CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`polyv-live-cli` is an agent-friendly command line tool for managing PolyV live streaming accounts, channels, streams, products, coupons, playback, documents, sessions, chat, interaction tools, viewers, player settings, watch pages, and statistics.
|
|
4
4
|
|
|
5
|
+
The CLI is designed for both human operators and AI agents:
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
- every command exposes `--help`;
|
|
8
|
+
- most data commands support table and JSON output;
|
|
9
|
+
- account configuration can be reused across commands;
|
|
10
|
+
- destructive or state-changing commands use confirmation prompts or `--force` where supported.
|
|
7
11
|
|
|
8
|
-
|
|
9
|
-
- **频道管理**: 创建、查看、更新、删除直播频道
|
|
10
|
-
- **流控制**: 获取推流密钥、开始/停止直播、实时状态监控
|
|
11
|
-
- **认证集成**: 完整的PolyV OpenAPI认证支持
|
|
12
|
-
- **多输出格式**: 支持表格和JSON格式输出
|
|
12
|
+
## Install
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
- **TypeScript**: 完整的类型安全和智能提示
|
|
16
|
-
- **分层架构**: 清晰的命令、处理器、服务分层设计
|
|
17
|
-
- **错误处理**: 用户友好的错误消息和详细的调试信息
|
|
18
|
-
- **配置灵活**: 支持环境变量、命令行参数、配置文件
|
|
19
|
-
- **测试完备**: 80%+测试覆盖率,包含单元测试和集成测试
|
|
20
|
-
|
|
21
|
-
## 📦 安装
|
|
22
|
-
|
|
23
|
-
### 全局安装
|
|
24
|
-
```bash
|
|
25
|
-
npm install -g polyv-live-cli
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### 本地开发
|
|
29
|
-
```bash
|
|
30
|
-
git clone https://github.com/your-repo/polyv-cli.git
|
|
31
|
-
cd polyv-cli
|
|
32
|
-
npm install
|
|
33
|
-
npm run build
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## 🚀 快速开始
|
|
37
|
-
|
|
38
|
-
### 1. 配置认证信息
|
|
39
|
-
|
|
40
|
-
#### 🎯 推荐方式:交互式配置 (推荐)
|
|
41
|
-
|
|
42
|
-
使用 `config set` 命令进行一次性交互式配置,系统会安全地将认证信息保存到用户主目录:
|
|
14
|
+
Use the latest published CLI directly:
|
|
43
15
|
|
|
44
16
|
```bash
|
|
45
|
-
|
|
46
|
-
polyv-live-cli config set
|
|
17
|
+
npx --yes polyv-live-cli@latest --help
|
|
47
18
|
```
|
|
48
19
|
|
|
49
|
-
|
|
50
|
-
- PolyV App ID
|
|
51
|
-
- PolyV App Secret
|
|
52
|
-
- PolyV User ID (可选)
|
|
53
|
-
- API Base URL (可选,默认为官方API地址)
|
|
54
|
-
|
|
55
|
-
配置完成后,所有后续命令都会自动使用保存的认证信息,无需重复设置。
|
|
56
|
-
|
|
57
|
-
#### 📋 配置管理命令
|
|
20
|
+
Or install it globally:
|
|
58
21
|
|
|
59
22
|
```bash
|
|
60
|
-
|
|
61
|
-
polyv-live-cli config show
|
|
62
|
-
|
|
63
|
-
# 获取特定配置项
|
|
64
|
-
polyv-live-cli config get appId
|
|
65
|
-
|
|
66
|
-
# 设置特定配置项
|
|
67
|
-
polyv-live-cli config put appId your_new_app_id
|
|
68
|
-
|
|
69
|
-
# 删除特定配置项
|
|
70
|
-
polyv-live-cli config unset appId
|
|
71
|
-
|
|
72
|
-
# 清空所有配置
|
|
73
|
-
polyv-live-cli config clear
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
#### 🔧 其他认证方式
|
|
77
|
-
|
|
78
|
-
**方法二:环境变量**
|
|
79
|
-
```bash
|
|
80
|
-
export POLYV_APP_ID="your_app_id"
|
|
81
|
-
export POLYV_APP_SECRET="your_app_secret"
|
|
82
|
-
export POLYV_USER_ID="your_user_id" # 可选
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
**方法三:命令行参数**
|
|
86
|
-
```bash
|
|
87
|
-
polyv-live-cli --appId your_app_id --appSecret your_app_secret [command]
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
#### 🔄 认证优先级
|
|
91
|
-
|
|
92
|
-
系统会按以下优先级使用认证信息:
|
|
93
|
-
1. **命令行参数** (最高优先级)
|
|
94
|
-
2. **环境变量**
|
|
95
|
-
3. **全局配置文件** (config set 设置的内容)
|
|
96
|
-
4. **默认值** (最低优先级)
|
|
97
|
-
|
|
98
|
-
### 2. 基础使用示例
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
# 首次使用:配置认证信息
|
|
102
|
-
polyv-live-cli config set
|
|
103
|
-
|
|
104
|
-
# 查看帮助
|
|
23
|
+
npm install -g polyv-live-cli
|
|
105
24
|
polyv-live-cli --help
|
|
106
|
-
|
|
107
|
-
# 查看版本
|
|
108
|
-
polyv-live-cli --version
|
|
109
|
-
|
|
110
|
-
# 查看当前配置
|
|
111
|
-
polyv-live-cli config show
|
|
112
|
-
|
|
113
|
-
# 创建频道
|
|
114
|
-
polyv-live-cli channel create --name "我的直播间" --scene topclass
|
|
115
|
-
|
|
116
|
-
# 查看频道列表
|
|
117
|
-
polyv-live-cli channel list
|
|
118
|
-
|
|
119
|
-
# 获取推流密钥
|
|
120
|
-
polyv-live-cli stream get-key --channelId 3151318
|
|
121
|
-
|
|
122
|
-
# 开始直播
|
|
123
|
-
polyv-live-cli stream start --channelId 3151318
|
|
124
|
-
|
|
125
|
-
# 查看直播状态
|
|
126
|
-
polyv-live-cli stream status --channelId 3151318
|
|
127
|
-
|
|
128
|
-
# 停止直播
|
|
129
|
-
polyv-live-cli stream stop --channelId 3151318
|
|
130
25
|
```
|
|
131
26
|
|
|
132
|
-
|
|
27
|
+
Node.js 18 or later is required.
|
|
133
28
|
|
|
134
|
-
|
|
29
|
+
## Authentication
|
|
135
30
|
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
polyv-live-cli config set
|
|
139
|
-
```
|
|
140
|
-
启动交互式配置向导,引导用户输入认证信息并保存到全局配置文件。
|
|
31
|
+
Add an account and set it as default:
|
|
141
32
|
|
|
142
|
-
#### 显示当前配置
|
|
143
33
|
```bash
|
|
144
|
-
polyv-live-cli
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
--output <format> 输出格式: table|json (默认: table)
|
|
34
|
+
polyv-live-cli account add production --app-id <appId> --app-secret <appSecret> --user-id <userId>
|
|
35
|
+
polyv-live-cli account set-default production
|
|
36
|
+
polyv-live-cli account current
|
|
148
37
|
```
|
|
149
38
|
|
|
150
|
-
|
|
151
|
-
```bash
|
|
152
|
-
polyv-live-cli config get <key>
|
|
153
|
-
|
|
154
|
-
参数:
|
|
155
|
-
<key> 配置项名称 (appId|appSecret|userId|baseUrl)
|
|
156
|
-
```
|
|
39
|
+
Switch the current shell session to a named account:
|
|
157
40
|
|
|
158
|
-
#### 设置特定配置项
|
|
159
41
|
```bash
|
|
160
|
-
polyv-live-cli
|
|
161
|
-
|
|
162
|
-
参数:
|
|
163
|
-
<key> 配置项名称 (appId|appSecret|userId|baseUrl)
|
|
164
|
-
<value> 配置项值
|
|
42
|
+
polyv-live-cli use production
|
|
165
43
|
```
|
|
166
44
|
|
|
167
|
-
|
|
168
|
-
```bash
|
|
169
|
-
polyv-live-cli config unset <key>
|
|
170
|
-
|
|
171
|
-
参数:
|
|
172
|
-
<key> 配置项名称 (appId|appSecret|userId|baseUrl)
|
|
173
|
-
```
|
|
45
|
+
Use one account for a single command:
|
|
174
46
|
|
|
175
|
-
#### 清空所有配置
|
|
176
47
|
```bash
|
|
177
|
-
polyv-live-cli
|
|
48
|
+
polyv-live-cli channel list -a production -o json
|
|
178
49
|
```
|
|
179
|
-
删除所有保存的配置信息。
|
|
180
50
|
|
|
181
|
-
|
|
51
|
+
Or pass credentials directly when automation requires it:
|
|
182
52
|
|
|
183
|
-
#### 创建频道
|
|
184
53
|
```bash
|
|
185
|
-
polyv-live-cli channel
|
|
186
|
-
|
|
187
|
-
选项:
|
|
188
|
-
--name <string> 频道名称 (必需)
|
|
189
|
-
--scene <string> 场景类型: topclass|ppt|pure (必需)
|
|
190
|
-
--description <string> 频道描述
|
|
191
|
-
--publisher <string> 主持人名称
|
|
192
|
-
--password <string> 频道密码
|
|
193
|
-
--max-viewers <number> 最大观看人数
|
|
194
|
-
--output <format> 输出格式: table|json (默认: table)
|
|
54
|
+
polyv-live-cli channel list --appId <appId> --appSecret <appSecret> --userId <userId> -o json
|
|
195
55
|
```
|
|
196
56
|
|
|
197
|
-
|
|
198
|
-
```bash
|
|
199
|
-
polyv-live-cli channel list [options]
|
|
57
|
+
Do not print or log AppSecret. Stream keys returned by `stream get-key -o json` are also sensitive and should only be sent to trusted streaming software.
|
|
200
58
|
|
|
201
|
-
|
|
202
|
-
--page <number> 页码 (默认: 1)
|
|
203
|
-
--per-page <number> 每页数量 (默认: 20)
|
|
204
|
-
--output <format> 输出格式: table|json (默认: table)
|
|
205
|
-
```
|
|
59
|
+
## Common Flows
|
|
206
60
|
|
|
207
|
-
|
|
208
|
-
```bash
|
|
209
|
-
polyv-live-cli channel get --channelId <id> [options]
|
|
210
|
-
|
|
211
|
-
选项:
|
|
212
|
-
--channelId <string> 频道ID (必需)
|
|
213
|
-
--output <format> 输出格式: table|json (默认: table)
|
|
214
|
-
```
|
|
61
|
+
Create and inspect a channel:
|
|
215
62
|
|
|
216
|
-
#### 更新频道
|
|
217
63
|
```bash
|
|
218
|
-
polyv-live-cli channel
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
--channelId <string> 频道ID (必需)
|
|
222
|
-
--name <string> 频道名称
|
|
223
|
-
--description <string> 频道描述
|
|
224
|
-
--publisher <string> 主持人名称
|
|
225
|
-
--password <string> 频道密码
|
|
226
|
-
--max-viewers <number> 最大观看人数
|
|
227
|
-
--start-time <timestamp> 开始时间 (13位时间戳)
|
|
228
|
-
--end-time <timestamp> 结束时间 (13位时间戳)
|
|
229
|
-
--page-views <number> 累积观看数
|
|
230
|
-
--likes <number> 点赞数
|
|
231
|
-
--cover-img <url> 封面图片URL
|
|
232
|
-
--splash-img <url> 引导页图片URL
|
|
233
|
-
--output <format> 输出格式: table|json (默认: table)
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
#### 删除频道
|
|
237
|
-
```bash
|
|
238
|
-
polyv-live-cli channel delete --channelId <id>
|
|
239
|
-
|
|
240
|
-
选项:
|
|
241
|
-
--channelId <string> 频道ID (必需)
|
|
64
|
+
polyv-live-cli channel create -n "Product Launch" --scene topclass --template ppt -o json
|
|
65
|
+
polyv-live-cli channel list -P 1 -l 20 -o json
|
|
66
|
+
polyv-live-cli channel get -c <channelId> -o json
|
|
242
67
|
```
|
|
243
68
|
|
|
244
|
-
|
|
69
|
+
Check stream status and get OBS credentials:
|
|
245
70
|
|
|
246
|
-
#### 获取推流密钥
|
|
247
71
|
```bash
|
|
248
|
-
polyv-live-cli stream
|
|
249
|
-
|
|
250
|
-
选项:
|
|
251
|
-
--channelId <string> 频道ID (必需)
|
|
252
|
-
--output <format> 输出格式: table|json (默认: table)
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
#### 开始直播
|
|
256
|
-
```bash
|
|
257
|
-
polyv-live-cli stream start --channelId <id>
|
|
258
|
-
|
|
259
|
-
选项:
|
|
260
|
-
--channelId <string> 频道ID (必需)
|
|
72
|
+
polyv-live-cli stream status -c <channelId> -o json
|
|
73
|
+
polyv-live-cli stream get-key -c <channelId> -o json
|
|
261
74
|
```
|
|
262
75
|
|
|
263
|
-
|
|
264
|
-
```bash
|
|
265
|
-
polyv-live-cli stream stop --channelId <id>
|
|
266
|
-
|
|
267
|
-
选项:
|
|
268
|
-
--channelId <string> 频道ID (必需)
|
|
269
|
-
```
|
|
76
|
+
Manage products and coupons:
|
|
270
77
|
|
|
271
|
-
#### 查看流状态
|
|
272
78
|
```bash
|
|
273
|
-
polyv-live-cli
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
--
|
|
277
|
-
--
|
|
278
|
-
|
|
79
|
+
polyv-live-cli product list -c <channelId> -o json
|
|
80
|
+
polyv-live-cli coupon add --name "Full 100 minus 20" --type MAX_OUT --availableAmount 100 \
|
|
81
|
+
--receiveStart 1704067200000 --receiveEnd 1704153600000 \
|
|
82
|
+
--useTimeType RANGE --useStart 1704067200000 --useEnd 1704758400000 \
|
|
83
|
+
--condition FULL_REDUCE --full 100 --reduce 20 --limitPerPerson 1 -o json
|
|
84
|
+
polyv-live-cli coupon list -o json
|
|
279
85
|
```
|
|
280
86
|
|
|
281
|
-
|
|
87
|
+
Query playback, documents, sessions, and statistics:
|
|
282
88
|
|
|
283
|
-
### 1. 批量频道管理
|
|
284
89
|
```bash
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
# 查看所有频道
|
|
291
|
-
polyv-live-cli channel list --per-page 50 --output json
|
|
90
|
+
polyv-live-cli playback list -c <channelId> -o json
|
|
91
|
+
polyv-live-cli document list -c <channelId> -o json
|
|
92
|
+
polyv-live-cli session list -c <channelId> -o json
|
|
93
|
+
polyv-live-cli statistics view -c <channelId> --start-day 2026-06-01 --end-day 2026-06-20 -o json
|
|
292
94
|
```
|
|
293
95
|
|
|
294
|
-
|
|
295
|
-
```bash
|
|
296
|
-
#!/bin/bash
|
|
297
|
-
CHANNEL_ID="3151318"
|
|
298
|
-
|
|
299
|
-
echo "🚀 开始直播..."
|
|
300
|
-
polyv-live-cli stream start --channelId $CHANNEL_ID
|
|
301
|
-
|
|
302
|
-
echo "📡 获取推流信息..."
|
|
303
|
-
polyv-live-cli stream get-key --channelId $CHANNEL_ID
|
|
96
|
+
Preview the built-in e-commerce scene before writing data:
|
|
304
97
|
|
|
305
|
-
echo "📊 监控直播状态..."
|
|
306
|
-
polyv-live-cli stream status --channelId $CHANNEL_ID --watch
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
### 3. CI/CD集成
|
|
310
98
|
```bash
|
|
311
|
-
|
|
312
|
-
polyv-live-cli channel create \
|
|
313
|
-
--name "自动化测试频道" \
|
|
314
|
-
--scene topclass \
|
|
315
|
-
--description "CI/CD自动创建" \
|
|
316
|
-
--output json > channel_info.json
|
|
317
|
-
|
|
318
|
-
CHANNEL_ID=$(cat channel_info.json | jq -r '.channelId')
|
|
319
|
-
echo "创建的频道ID: $CHANNEL_ID"
|
|
99
|
+
polyv-live-cli setup e-commerce --dry-run -o json
|
|
320
100
|
```
|
|
321
101
|
|
|
322
|
-
##
|
|
102
|
+
## Command Groups
|
|
323
103
|
|
|
324
|
-
|
|
325
|
-
1. **命令行参数** (最高优先级)
|
|
326
|
-
2. **环境变量**
|
|
327
|
-
3. **全局配置文件** (推荐用于全局安装)
|
|
328
|
-
4. **项目配置文件**
|
|
329
|
-
5. **默认值** (最低优先级)
|
|
104
|
+
The current CLI exposes 40 top-level commands. Use top-level help first, then the deepest subcommand help before running a write operation.
|
|
330
105
|
|
|
331
|
-
### 交互式配置 (推荐)
|
|
332
106
|
```bash
|
|
333
|
-
|
|
334
|
-
polyv-live-cli
|
|
335
|
-
|
|
336
|
-
# 查看当前配置
|
|
337
|
-
polyv-live-cli config show
|
|
338
|
-
|
|
339
|
-
# 查看特定配置值
|
|
340
|
-
polyv-live-cli config get appId
|
|
341
|
-
|
|
342
|
-
# 设置特定配置值
|
|
343
|
-
polyv-live-cli config put appId your_app_id
|
|
344
|
-
|
|
345
|
-
# 清除配置
|
|
346
|
-
polyv-live-cli config clear
|
|
107
|
+
polyv-live-cli --help
|
|
108
|
+
polyv-live-cli channel --help
|
|
109
|
+
polyv-live-cli channel create --help
|
|
347
110
|
```
|
|
348
111
|
|
|
349
|
-
|
|
112
|
+
Main command families:
|
|
350
113
|
|
|
351
|
-
|
|
352
|
-
|
|
|
353
|
-
|
|
354
|
-
|
|
|
355
|
-
|
|
|
356
|
-
| `
|
|
357
|
-
| `
|
|
358
|
-
| `
|
|
359
|
-
| `
|
|
114
|
+
| Area | Commands |
|
|
115
|
+
| --- | --- |
|
|
116
|
+
| Accounts and configuration | `account`, `use`, `platform`, `global`, `user`, `group`, `partner` |
|
|
117
|
+
| Channel and stream operations | `channel`, `stream`, `monitor`, `transmit` |
|
|
118
|
+
| Marketing and commerce | `product`, `coupon`, `card-push`, `promotion` |
|
|
119
|
+
| Content and playback | `playback`, `record`, `document`, `session`, `material`, `webapp` |
|
|
120
|
+
| Interactions | `chat`, `lottery`, `checkin`, `qa`, `questionnaire`, `donate`, `interaction`, `robot` |
|
|
121
|
+
| Viewers and access control | `viewer`, `watch-condition`, `whitelist`, `custom-field`, `invite-sales` |
|
|
122
|
+
| Player, watch page, data, and AI | `player`, `web`, `statistics`, `finance`, `ai` |
|
|
123
|
+
| Workflow templates | `setup` |
|
|
360
124
|
|
|
361
|
-
##
|
|
125
|
+
## Safety
|
|
362
126
|
|
|
363
|
-
|
|
364
|
-
本工具使用PolyV官方的MD5签名认证机制:
|
|
127
|
+
Commands that create, update, delete, start, stop, push, send, merge, transcode, import, batch-update, or change global/channel settings can affect live data. Confirm the target account, channel ID, and object ID before running them. Use `--force` only after the user or operator has explicitly approved the operation.
|
|
365
128
|
|
|
366
|
-
|
|
367
|
-
2. **参数排序**: 按字典序排序参数
|
|
368
|
-
3. **字符串拼接**: 格式为 `appSecret + 排序后参数 + appSecret`
|
|
369
|
-
4. **MD5签名**: 计算MD5哈希值并转换为大写
|
|
370
|
-
5. **请求发送**: 将签名作为sign参数发送
|
|
129
|
+
For tests or release validation, prefer temporary channels and clean them up afterwards instead of mutating a long-lived configured channel.
|
|
371
130
|
|
|
372
|
-
|
|
373
|
-
- ✅ 使用环境变量存储敏感信息
|
|
374
|
-
- ✅ 敏感数据在输出中自动脱敏
|
|
375
|
-
- ✅ 不在日志中记录密钥信息
|
|
376
|
-
- ✅ 支持用户级别的权限控制
|
|
131
|
+
## Development
|
|
377
132
|
|
|
378
|
-
|
|
133
|
+
From the repository root:
|
|
379
134
|
|
|
380
|
-
### 运行测试
|
|
381
135
|
```bash
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
npm run test:unit
|
|
387
|
-
|
|
388
|
-
# 运行集成测试
|
|
389
|
-
npm run test:integration
|
|
390
|
-
|
|
391
|
-
# 查看测试覆盖率
|
|
392
|
-
npm run test:coverage
|
|
136
|
+
pnpm install
|
|
137
|
+
pnpm --filter polyv-live-cli build
|
|
138
|
+
pnpm --filter polyv-live-cli test
|
|
139
|
+
pnpm --filter polyv-live-cli test:integration
|
|
393
140
|
```
|
|
394
141
|
|
|
395
|
-
|
|
396
|
-
- **单元测试**: 80%+ 代码覆盖率
|
|
397
|
-
- **集成测试**: 核心工作流全覆盖
|
|
398
|
-
- **错误处理**: 各种异常场景测试
|
|
142
|
+
Generate API and CLI inventory reports:
|
|
399
143
|
|
|
400
|
-
## 🐛 故障排除
|
|
401
|
-
|
|
402
|
-
### 常见问题
|
|
403
|
-
|
|
404
|
-
#### 1. 认证失败
|
|
405
144
|
```bash
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
解决方案:
|
|
409
|
-
- 检查POLYV_APP_ID和POLYV_APP_SECRET环境变量
|
|
410
|
-
- 确认PolyV控制台中的应用凭据
|
|
411
|
-
- 验证网络连接和防火墙设置
|
|
145
|
+
pnpm api:inventory
|
|
146
|
+
pnpm cli:inventory
|
|
412
147
|
```
|
|
413
148
|
|
|
414
|
-
|
|
415
|
-
```bash
|
|
416
|
-
❌ 频道未找到: 频道ID 3151318 不存在
|
|
417
|
-
|
|
418
|
-
解决方案:
|
|
419
|
-
- 确认频道ID是否正确
|
|
420
|
-
- 检查账号是否有访问该频道的权限
|
|
421
|
-
- 使用 channel list 命令查看可用频道
|
|
422
|
-
```
|
|
423
|
-
|
|
424
|
-
#### 3. 推流密钥获取失败
|
|
425
|
-
```bash
|
|
426
|
-
❌ 获取推流密钥失败: 频道未在直播状态
|
|
427
|
-
|
|
428
|
-
解决方案:
|
|
429
|
-
- 使用 stream start 命令先开始直播
|
|
430
|
-
- 确认频道类型支持推流功能
|
|
431
|
-
- 检查频道配置是否正确
|
|
432
|
-
```
|
|
149
|
+
Run the local built CLI:
|
|
433
150
|
|
|
434
|
-
### 调试模式
|
|
435
151
|
```bash
|
|
436
|
-
|
|
437
|
-
DEBUG=1 polyv-live-cli [command]
|
|
438
|
-
|
|
439
|
-
# 或设置环境变量
|
|
440
|
-
export DEBUG=1
|
|
441
|
-
polyv-live-cli [command]
|
|
152
|
+
node packages/cli/dist/index.js --help
|
|
442
153
|
```
|
|
443
154
|
|
|
444
|
-
##
|
|
155
|
+
## Release
|
|
445
156
|
|
|
446
|
-
|
|
447
|
-
```
|
|
448
|
-
src/
|
|
449
|
-
├── commands/ # CLI命令定义
|
|
450
|
-
│ ├── channel.commands.ts
|
|
451
|
-
│ └── stream.commands.ts
|
|
452
|
-
├── handlers/ # 业务逻辑处理器
|
|
453
|
-
│ ├── channel.handler.ts
|
|
454
|
-
│ └── stream.handler.ts
|
|
455
|
-
├── services/ # API服务层
|
|
456
|
-
│ ├── channel.service.ts
|
|
457
|
-
│ └── stream.service.ts
|
|
458
|
-
├── types/ # TypeScript类型定义
|
|
459
|
-
│ ├── channel.ts
|
|
460
|
-
│ ├── stream.ts
|
|
461
|
-
│ └── auth.ts
|
|
462
|
-
├── utils/ # 工具函数
|
|
463
|
-
│ ├── errors.ts
|
|
464
|
-
│ ├── formatter.ts
|
|
465
|
-
│ └── signature.ts
|
|
466
|
-
└── config/ # 配置管理
|
|
467
|
-
└── manager.ts
|
|
468
|
-
```
|
|
157
|
+
Dry-run the package before publishing:
|
|
469
158
|
|
|
470
|
-
### 开发命令
|
|
471
159
|
```bash
|
|
472
|
-
|
|
473
|
-
npm run dev
|
|
474
|
-
|
|
475
|
-
# 构建项目
|
|
476
|
-
npm run build
|
|
477
|
-
|
|
478
|
-
# 代码检查
|
|
479
|
-
npm run lint
|
|
480
|
-
|
|
481
|
-
# 类型检查
|
|
482
|
-
npm run type-check
|
|
483
|
-
|
|
484
|
-
# 清理构建
|
|
485
|
-
npm run clean
|
|
160
|
+
pnpm release:cli:dry
|
|
486
161
|
```
|
|
487
162
|
|
|
488
|
-
|
|
489
|
-
1. Fork 项目仓库
|
|
490
|
-
2. 创建功能分支: `git checkout -b feature/new-feature`
|
|
491
|
-
3. 提交变更: `git commit -m 'feat: add new feature'`
|
|
492
|
-
4. 推送分支: `git push origin feature/new-feature`
|
|
493
|
-
5. 创建Pull Request
|
|
494
|
-
|
|
495
|
-
## 📄 许可证
|
|
496
|
-
|
|
497
|
-
本项目基于 [MIT License](LICENSE) 开源协议。
|
|
498
|
-
|
|
499
|
-
## 🆘 支持
|
|
500
|
-
|
|
501
|
-
### 获取帮助
|
|
502
|
-
- 📖 [PolyV官方文档](https://help.polyv.net/)
|
|
503
|
-
|
|
504
|
-
---
|
|
163
|
+
Publish only after the package version has been bumped beyond the current npm version and the build, tests, inventory checks, and `git diff --check` pass.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.commands.d.ts","sourceRoot":"","sources":["../../src/commands/account.commands.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"account.commands.d.ts","sourceRoot":"","sources":["../../src/commands/account.commands.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkjBpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoT9D"}
|