@kg-ai/kugou-skill 0.0.6 → 0.0.8

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 CHANGED
@@ -27,15 +27,15 @@ kugou-cli auth login
27
27
  ### 认证
28
28
 
29
29
  ```bash
30
- # 扫码登录(默认保存二维码图片到临时目录)
30
+ # 扫码登录(默认保存并打开二维码图片)
31
31
  kugou-cli auth login
32
32
 
33
+ # 只保存二维码图片,不打开
34
+ kugou-cli auth login --output file
35
+
33
36
  # 输出 base64 编码的二维码图片
34
37
  kugou-cli auth login --output base64
35
38
 
36
- # 打开系统图片查看器扫码
37
- kugou-cli auth login --output terminal
38
-
39
39
  # 查看登录状态
40
40
  kugou-cli auth status
41
41
 
package/SKILL.md CHANGED
@@ -22,7 +22,7 @@ description: |
22
22
 
23
23
  ### 关键注意事项
24
24
 
25
- - **登录是阻塞操作**:`kugou-cli auth login` 会持续轮询直到用户扫码确认。必须等到输出 `"status":"success"` 才能继续后续音乐操作。TUI Agent(如 OpenCode)推荐使用 `--output terminal` 模式,自动弹出系统图片查看器。`base64` 模式适合 Web 前端场景。
25
+ - **登录是阻塞操作**:`kugou-cli auth login` 会持续轮询直到用户扫码确认。必须等到输出 `"status":"success"` 才能继续后续音乐操作。默认模式会自动打开系统图片查看器供扫码。`file` 模式只保存文件不打开。`base64` 模式适合 Web 前端场景。
26
26
  - **音乐命令依赖登录**:除了 `auth`、`install`、`version`、`--help` 以外,所有 `music` 子命令都需要先登录。如果收到 `"not logged in"` 错误,引导用户执行 `kugou-cli auth login`。
27
27
  - **输出均为 JSON**:所有命令输出原始 JSON 到 stdout,错误输出到 stderr。解析 `errcode` 字段判断成功与否(`0` 为成功)。
28
28
  - **链接展示**:输出中的 `play_link` 字段,展示给用户时转为可点击格式:
@@ -43,10 +43,9 @@ description: |
43
43
  使用前需要扫码登录。登录采用轮询机制,需等待用户扫码确认。
44
44
 
45
45
  ```bash
46
- kugou-cli auth login
47
- kugou-cli auth login --output image # 默认,保存二维码图片到临时目录
46
+ kugou-cli auth login # 默认,保存二维码图片并打开图片查看器
47
+ kugou-cli auth login --output file # 只保存二维码图片,不打开
48
48
  kugou-cli auth login --output base64 # 输出 base64 图片数据(含 data:image/png;base64, 前缀)
49
- kugou-cli auth login --output terminal # 自动打开系统图片查看器扫码(推荐 TUI Agent 使用)
50
49
  ```
51
50
 
52
51
  **登录轮询流程**(`kugou-cli auth login` 内部自动处理):
@@ -59,7 +58,7 @@ kugou-cli auth login --output terminal # 自动打开系统图片查看器扫码
59
58
  5. 若超时/二维码过期输出 {"status": "failed", "message": "..."}
60
59
  ```
61
60
 
62
- > **输出模式选择建议**:`terminal` 模式会自动调用系统图片查看器弹出二维码,用户直接扫码即可,适合 OpenCode 等 TUI Agent 使用。`image` 模式保存到临时文件,需手动打开。`base64` 模式适合需要内嵌二维码图片展示的场景。
61
+ > **输出模式选择建议**:默认模式会自动打开图片查看器弹出二维码,用户直接扫码即可,适合桌面端 Agent 使用。`file` 模式只保存到临时文件,需手动打开。`base64` 模式适合需要内嵌二维码图片展示的场景。
63
62
 
64
63
  ---
65
64
 
@@ -114,18 +113,22 @@ kugou-cli auth login --output terminal # 自动打开系统图片查看器扫码
114
113
 
115
114
  ```bash
116
115
  kugou-cli auth login
117
- kugou-cli auth login --output image # 默认,保存二维码图片到临时目录
116
+ kugou-cli auth login --output file # 只保存二维码图片,不打开
118
117
  kugou-cli auth login --output base64 # 输出 base64 编码的图片数据(含 data:image/png;base64, 前缀)
119
- kugou-cli auth login --output terminal # 自动打开系统图片查看器,适合 OpenCode 等 TUI Agent
120
118
  ```
121
119
 
122
120
  **参数**:
123
121
  - `-o, --output`: 输出模式
124
- - `image` (默认): 保存二维码图片到临时目录,输出图片路径
122
+ - (默认): 保存二维码图片到临时目录并打开图片查看器,供扫码
123
+ - `file`: 只保存二维码图片到临时目录,不打开
125
124
  - `base64`: 输出 base64 编码的图片数据(含 `data:image/png;base64,` 前缀)
126
- - `terminal`: 自动打开系统图片查看器显示二维码,适合 OpenCode 等 TUI Agent 使用。用户无需手动打开文件,系统会自动弹出二维码窗口供扫码。
127
125
 
128
- **输出示例** (image 模式):
126
+ **输出示例** (默认模式 - 保存并打开):
127
+ ```json
128
+ {"qrcode": "xxx", "qrcode_img_path": "C:\\Users\\xxx\\AppData\\Local\\Temp\\kugou-qrcode.png", "status": "waiting"}
129
+ ```
130
+
131
+ **输出示例** (file 模式):
129
132
  ```json
130
133
  {"qrcode": "xxx", "qrcode_img_path": "/tmp/kugou-qrcode.png", "status": "waiting"}
131
134
  ```
@@ -137,11 +140,6 @@ kugou-cli auth login --output terminal # 自动打开系统图片查看器,适
137
140
 
138
141
  > **base64 二维码展示指导**:`qrcode_base64` 已包含 `data:image/png;base64,` 前缀,可直接作为 `<img>` 标签的 `src` 属性,或通过 Markdown `![QR](data:image/png;base64,...)` 展示。
139
142
 
140
- **输出示例** (terminal 模式):
141
- ```json
142
- {"qrcode": "xxx", "qrcode_img_path": "C:\\Users\\xxx\\AppData\\Local\\Temp\\kugou-qrcode.png", "status": "waiting"}
143
- ```
144
-
145
143
  **轮询过程中的状态输出**:
146
144
  - `{"status": "waiting", ...}` — 等待扫码
147
145
  - `{"status": "scanned", "nickname": "...", ...}` — 已扫码,等待用户在手机上确认
@@ -257,8 +255,18 @@ kugou-cli music recent --page 1 --size 20
257
255
 
258
256
  ```bash
259
257
  kugou-cli music stats
258
+ kugou-cli music stats --date-type 1 --date 20260501
260
259
  ```
261
260
 
261
+ **AI 引导**:如果用户不指定查询范围,默认按月查询(`--date-type 2`),日期设为当月第一天。例如当前日期是 2025-06-15,默认查询 2025年6月1日 的数据。
262
+
263
+ **参数**:
264
+ - `--date-type`: 日期类型,0=日、1=周、2=月,默认 0
265
+ - `--date`: 查询日期,YYYYMMDD 格式,如 "20260501"
266
+ - 日类型:每天日期,如 "20260501"
267
+ - 周类型:必须是周一日期,如 "20260505"(周一)
268
+ - 月类型:必须是月份第一天,如 "20260501"(5月1日)
269
+
262
270
  **输出示例**:
263
271
  ```json
264
272
  {
@@ -276,18 +284,18 @@ kugou-cli music stats
276
284
  "last_listen_total": 387,
277
285
  "rank_song": [
278
286
  {
279
- "song_info": {"song_name": "晴天", "mix_song_id": "xxx", "artist_name": "周杰伦", "play_link": "https://..."},
287
+ "song_info": {"name": "晴天", "mix_song_id": "8888", "cover": "https://xxx.jpg", "singer_name": "周杰伦", "hash": "abcdef123456"},
280
288
  "count": 50
281
289
  }
282
290
  ],
283
291
  "rank_singer": [
284
- {"singer_id": 123, "name": "周杰伦", "avatar": "https://...", "total": 120}
292
+ {"singer_id": 123, "name": "周杰伦", "avatar": "https://xxx.jpg", "total": 120}
285
293
  ],
286
294
  "rank_style": [
287
295
  {"style": "流行", "total": 200, "count": 80}
288
296
  ],
289
297
  "rank_language": [
290
- {"language": "国语", "total": 180, "count": 70}
298
+ {"language": "华语", "total": 400, "count": 150}
291
299
  ]
292
300
  },
293
301
  "status": 1
@@ -295,9 +303,12 @@ kugou-cli music stats
295
303
  ```
296
304
 
297
305
  **关键字段**:
298
- - `listen_duration`: 累计听歌时长(秒)
299
- - `listen_total`: 累计听歌数量
300
- - `clocks`: 每个小时的听歌时长分布(`clock`: 0-23,`listen_duration`: 秒)
306
+ - `listen_duration`: 今日/周/月听歌时长(秒)
307
+ - `clocks`: 时段打卡统计(`clock`: 时段标识,`listen_duration`: 秒)
308
+ - `accumulate_listen_days`: 累计听歌天数
309
+ - `continue_listen_days`: 连续听歌天数
310
+ - `listen_total`: 累计听歌次数
311
+ - `last_listen_total`: 昨日听歌次数
301
312
  - `rank_song`: 播放最多的歌曲排行(`count` 为播放次数)
302
313
  - `rank_singer`: 播放最多的歌手排行
303
314
  - `rank_style`: 曲风分布统计
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kg-ai/kugou-skill",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "Kugou Skill CLI",
5
5
  "main": "index.js",
6
6
  "bin": {