@rainyun/cli 0.0.0-stage → 1.0.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.
Files changed (68) hide show
  1. package/README.md +132 -2
  2. package/bin/postinstall.mjs +13 -0
  3. package/bin/rainyun-cli.mjs +13 -0
  4. package/catalog/human-names.json +340 -0
  5. package/catalog/list.openapi.json +354 -0
  6. package/catalog/openapi.json +34531 -0
  7. package/catalog/product-commands.json +332 -0
  8. package/catalog/public.openapi.json +1895 -0
  9. package/docs/AGENT_GUIDE.md +64 -0
  10. package/docs/install.md +44 -0
  11. package/docs/product-lists.md +48 -0
  12. package/docs/rgp.md +77 -0
  13. package/docs/terminal-exec.md +111 -0
  14. package/examples/public-panel.json +1 -0
  15. package/examples/public-rcs-price.json +1 -0
  16. package/examples/rca-terminal-input.json +1 -0
  17. package/examples/rcs-get.json +1 -0
  18. package/examples/rcs-list.json +1 -0
  19. package/examples/rcs-reboot.json +1 -0
  20. package/examples/terminal-controls.ndjson +3 -0
  21. package/examples/terminal-input.json +1 -0
  22. package/node_modules/ws/LICENSE +20 -0
  23. package/node_modules/ws/README.md +539 -0
  24. package/node_modules/ws/browser.js +8 -0
  25. package/node_modules/ws/index.js +22 -0
  26. package/node_modules/ws/lib/buffer-util.js +142 -0
  27. package/node_modules/ws/lib/constants.js +19 -0
  28. package/node_modules/ws/lib/event-target.js +292 -0
  29. package/node_modules/ws/lib/extension.js +203 -0
  30. package/node_modules/ws/lib/limiter.js +55 -0
  31. package/node_modules/ws/lib/permessage-deflate.js +530 -0
  32. package/node_modules/ws/lib/receiver.js +751 -0
  33. package/node_modules/ws/lib/sender.js +610 -0
  34. package/node_modules/ws/lib/stream.js +161 -0
  35. package/node_modules/ws/lib/subprotocol.js +62 -0
  36. package/node_modules/ws/lib/validation.js +152 -0
  37. package/node_modules/ws/lib/websocket-server.js +565 -0
  38. package/node_modules/ws/lib/websocket.js +1471 -0
  39. package/node_modules/ws/package.json +74 -0
  40. package/node_modules/ws/wrapper.mjs +21 -0
  41. package/package.json +29 -4
  42. package/skills/rainyun-cli/SKILL.md +46 -0
  43. package/src/api/catalog.mjs +230 -0
  44. package/src/api/http.mjs +222 -0
  45. package/src/api/request.mjs +178 -0
  46. package/src/api/titles.mjs +9 -0
  47. package/src/auth/commands.mjs +192 -0
  48. package/src/auth/store.mjs +162 -0
  49. package/src/cli.mjs +154 -0
  50. package/src/commands/dispatch.mjs +128 -0
  51. package/src/commands/fields.mjs +77 -0
  52. package/src/commands/products.mjs +209 -0
  53. package/src/commands/rgs.mjs +44 -0
  54. package/src/json.mjs +81 -0
  55. package/src/output/business.mjs +188 -0
  56. package/src/output/discovery.mjs +197 -0
  57. package/src/output/examples.mjs +71 -0
  58. package/src/output/format.mjs +164 -0
  59. package/src/output/help.json +181 -0
  60. package/src/output/help.mjs +334 -0
  61. package/src/rgp/commands.mjs +251 -0
  62. package/src/rgp/input.mjs +144 -0
  63. package/src/rgp/operations.json +625 -0
  64. package/src/rgp/result.mjs +103 -0
  65. package/src/rgp/transfer.mjs +213 -0
  66. package/src/terminal/commands.mjs +155 -0
  67. package/src/terminal/session.mjs +233 -0
  68. package/src/terminal/target.mjs +155 -0
@@ -0,0 +1,625 @@
1
+ [
2
+ {
3
+ "operation_id": "backup.create",
4
+ "method": "POST",
5
+ "path": "/backup/",
6
+ "summary": "创建面板备份,返回异步任务",
7
+ "fields": [
8
+ {
9
+ "name": "tag",
10
+ "in": "body",
11
+ "type": "string",
12
+ "required": true,
13
+ "description": "备份标签"
14
+ }
15
+ ],
16
+ "requires_yes": false,
17
+ "async": true
18
+ },
19
+ {
20
+ "operation_id": "backup.delete",
21
+ "method": "DELETE",
22
+ "path": "/backup/",
23
+ "summary": "删除备份,不可撤销",
24
+ "fields": [
25
+ {
26
+ "name": "tag",
27
+ "in": "query",
28
+ "type": "string",
29
+ "required": true,
30
+ "description": "备份标签"
31
+ }
32
+ ],
33
+ "requires_yes": false,
34
+ "async": false
35
+ },
36
+ {
37
+ "operation_id": "backup.download",
38
+ "method": "GET",
39
+ "path": "/backup/download",
40
+ "summary": "下载备份到新的本地文件,不输出授权路径",
41
+ "fields": [
42
+ {
43
+ "name": "tag",
44
+ "in": "query",
45
+ "type": "string",
46
+ "required": true,
47
+ "description": "备份标签"
48
+ }
49
+ ],
50
+ "requires_yes": false,
51
+ "async": false,
52
+ "transfer": "download"
53
+ },
54
+ {
55
+ "operation_id": "backup.list",
56
+ "method": "GET",
57
+ "path": "/backup/",
58
+ "summary": "列出面板备份",
59
+ "fields": [
60
+ {
61
+ "name": "type",
62
+ "in": "query",
63
+ "type": "string",
64
+ "required": false,
65
+ "description": "仅app,默认app"
66
+ }
67
+ ],
68
+ "requires_yes": false,
69
+ "async": false
70
+ },
71
+ {
72
+ "operation_id": "backup.restore",
73
+ "method": "POST",
74
+ "path": "/backup/restore",
75
+ "summary": "停机状态还原备份,覆盖现有数据,包括backup目录",
76
+ "fields": [
77
+ {
78
+ "name": "tag",
79
+ "in": "body",
80
+ "type": "string",
81
+ "required": true,
82
+ "description": "备份标签"
83
+ }
84
+ ],
85
+ "requires_yes": false,
86
+ "async": true
87
+ },
88
+ {
89
+ "operation_id": "config.read",
90
+ "method": "GET",
91
+ "path": "/file_manage/edit",
92
+ "summary": "读取配置文件原文;不加载网页可视化 schema,也不猜测配置格式",
93
+ "fields": [
94
+ {
95
+ "name": "path",
96
+ "in": "query",
97
+ "type": "string",
98
+ "required": true,
99
+ "description": "远端绝对文件路径"
100
+ }
101
+ ],
102
+ "requires_yes": false,
103
+ "async": false
104
+ },
105
+ {
106
+ "operation_id": "config.write",
107
+ "method": "POST",
108
+ "path": "/file_manage/save",
109
+ "summary": "保存配置文件完整 UTF-8 原文;不加载可视化 schema,不自动重启,无原子冲突检测",
110
+ "fields": [
111
+ {
112
+ "name": "path",
113
+ "in": "body",
114
+ "type": "string",
115
+ "required": true,
116
+ "description": "远端绝对文件路径"
117
+ },
118
+ {
119
+ "name": "content",
120
+ "in": "body",
121
+ "type": "string",
122
+ "required": true,
123
+ "description": "完整 UTF-8 原文(允许空串);也可由 --source 提供,二者不可混用"
124
+ }
125
+ ],
126
+ "requires_yes": false,
127
+ "async": false
128
+ },
129
+ {
130
+ "operation_id": "cron.create",
131
+ "method": "POST",
132
+ "path": "/cron/",
133
+ "summary": "创建计划任务;不提供非原子编辑",
134
+ "fields": [
135
+ {
136
+ "name": "name",
137
+ "in": "body",
138
+ "type": "string",
139
+ "required": true,
140
+ "description": "任务名称,1–32 字符"
141
+ },
142
+ {
143
+ "name": "cron_expression",
144
+ "in": "body",
145
+ "type": "string",
146
+ "required": true,
147
+ "description": "例如 0 0 0 * * *;由服务端解释"
148
+ },
149
+ {
150
+ "name": "type",
151
+ "in": "body",
152
+ "type": "string",
153
+ "required": true,
154
+ "description": "shell/backup_app/restart_app/start_app/stop_app"
155
+ },
156
+ {
157
+ "name": "is_enable",
158
+ "in": "body",
159
+ "type": "boolean",
160
+ "required": true,
161
+ "description": "显式决定是否启用"
162
+ },
163
+ {
164
+ "name": "logs_limit",
165
+ "in": "body",
166
+ "type": "integer",
167
+ "required": false,
168
+ "description": "1–7,默认7"
169
+ },
170
+ {
171
+ "name": "shell_content",
172
+ "in": "body",
173
+ "type": "string",
174
+ "required": false,
175
+ "description": "shell 类型必填,原样发送"
176
+ },
177
+ {
178
+ "name": "execute_method",
179
+ "in": "body",
180
+ "type": "string",
181
+ "required": false,
182
+ "description": "shell 类型仅支持 attach,默认attach"
183
+ },
184
+ {
185
+ "name": "backup_keep_count",
186
+ "in": "body",
187
+ "type": "integer",
188
+ "required": false,
189
+ "description": "backup_app 类型保留数量1–30,默认2"
190
+ }
191
+ ],
192
+ "requires_yes": false,
193
+ "async": false
194
+ },
195
+ {
196
+ "operation_id": "cron.delete",
197
+ "method": "DELETE",
198
+ "path": "/cron/",
199
+ "summary": "删除指定计划任务",
200
+ "fields": [
201
+ {
202
+ "name": "uuid",
203
+ "in": "query",
204
+ "type": "string",
205
+ "required": true,
206
+ "description": "计划任务编号,不按名称猜测"
207
+ }
208
+ ],
209
+ "requires_yes": false,
210
+ "async": false
211
+ },
212
+ {
213
+ "operation_id": "cron.list",
214
+ "method": "GET",
215
+ "path": "/cron/",
216
+ "summary": "列出计划任务",
217
+ "fields": [],
218
+ "requires_yes": false,
219
+ "async": false
220
+ },
221
+ {
222
+ "operation_id": "cron.logs",
223
+ "method": "GET",
224
+ "path": "/cron/logs",
225
+ "summary": "读取指定计划任务日志",
226
+ "fields": [
227
+ {
228
+ "name": "uuid",
229
+ "in": "query",
230
+ "type": "string",
231
+ "required": true,
232
+ "description": "计划任务编号,不按名称猜测"
233
+ }
234
+ ],
235
+ "requires_yes": false,
236
+ "async": false
237
+ },
238
+ {
239
+ "operation_id": "cron.run",
240
+ "method": "POST",
241
+ "path": "/cron/run",
242
+ "summary": "立即请求运行计划任务,不代表任务已经完成",
243
+ "fields": [
244
+ {
245
+ "name": "uuid",
246
+ "in": "body",
247
+ "type": "string",
248
+ "required": true,
249
+ "description": "计划任务编号"
250
+ }
251
+ ],
252
+ "requires_yes": false,
253
+ "async": false
254
+ },
255
+ {
256
+ "operation_id": "cron.toggle",
257
+ "method": "POST",
258
+ "path": "/cron/toggle",
259
+ "summary": "显式启用或禁用计划任务",
260
+ "fields": [
261
+ {
262
+ "name": "uuid",
263
+ "in": "body",
264
+ "type": "string",
265
+ "required": true,
266
+ "description": "计划任务编号"
267
+ },
268
+ {
269
+ "name": "is_enable",
270
+ "in": "body",
271
+ "type": "boolean",
272
+ "required": true,
273
+ "description": "目标启用状态"
274
+ }
275
+ ],
276
+ "requires_yes": false,
277
+ "async": false
278
+ },
279
+ {
280
+ "operation_id": "file.chmod",
281
+ "method": "POST",
282
+ "path": "/file_manage/chmod",
283
+ "summary": "修改文件权限",
284
+ "fields": [
285
+ {
286
+ "name": "path",
287
+ "in": "body",
288
+ "type": "string",
289
+ "required": true,
290
+ "description": "远端绝对文件路径"
291
+ },
292
+ {
293
+ "name": "mode",
294
+ "in": "body",
295
+ "type": "string",
296
+ "required": true,
297
+ "description": "3 或 4 位八进制权限字符串,例如 644 或 0755"
298
+ },
299
+ {
300
+ "name": "recursive",
301
+ "in": "body",
302
+ "type": "boolean",
303
+ "required": false,
304
+ "description": "是否递归修改目录,默认 false"
305
+ }
306
+ ],
307
+ "requires_yes": false,
308
+ "async": false
309
+ },
310
+ {
311
+ "operation_id": "file.copy",
312
+ "method": "POST",
313
+ "path": "/file_manage/copy",
314
+ "summary": "提交复制任务;用 task.wait 跟踪完成",
315
+ "fields": [
316
+ {
317
+ "name": "old_path",
318
+ "in": "body",
319
+ "type": "string",
320
+ "required": true,
321
+ "description": "原远端绝对路径"
322
+ },
323
+ {
324
+ "name": "new_path",
325
+ "in": "body",
326
+ "type": "string",
327
+ "required": true,
328
+ "description": "目标远端绝对路径"
329
+ }
330
+ ],
331
+ "requires_yes": false,
332
+ "async": true
333
+ },
334
+ {
335
+ "operation_id": "file.delete",
336
+ "method": "DELETE",
337
+ "path": "/file_manage/delete",
338
+ "summary": "提交文件或目录删除任务",
339
+ "fields": [
340
+ {
341
+ "name": "path",
342
+ "in": "query",
343
+ "type": "string",
344
+ "required": true,
345
+ "description": "远端绝对文件路径"
346
+ }
347
+ ],
348
+ "requires_yes": false,
349
+ "async": true
350
+ },
351
+ {
352
+ "operation_id": "file.download",
353
+ "method": "GET",
354
+ "path": "/file_manage/download",
355
+ "summary": "取得下载授权并保存到 --output;不覆盖已有本地文件",
356
+ "fields": [
357
+ {
358
+ "name": "path",
359
+ "in": "query",
360
+ "type": "string",
361
+ "required": true,
362
+ "description": "远端绝对文件路径"
363
+ }
364
+ ],
365
+ "requires_yes": false,
366
+ "async": false,
367
+ "transfer": "download"
368
+ },
369
+ {
370
+ "operation_id": "file.exists",
371
+ "method": "POST",
372
+ "path": "/file_manage/exists",
373
+ "summary": "检查文件存在性;返回路径到布尔值的映射",
374
+ "fields": [
375
+ {
376
+ "name": "paths",
377
+ "in": "body",
378
+ "type": "array",
379
+ "required": true,
380
+ "description": "非空远端绝对路径字符串数组"
381
+ }
382
+ ],
383
+ "requires_yes": false,
384
+ "async": false
385
+ },
386
+ {
387
+ "operation_id": "file.list",
388
+ "method": "GET",
389
+ "path": "/file_manage/list",
390
+ "summary": "列出目录文件,返回完整数组;不进行本地伪分页",
391
+ "fields": [
392
+ {
393
+ "name": "path",
394
+ "in": "query",
395
+ "type": "string",
396
+ "required": true,
397
+ "description": "远端绝对文件路径"
398
+ },
399
+ {
400
+ "name": "show_hide",
401
+ "in": "query",
402
+ "type": "boolean",
403
+ "required": false,
404
+ "description": "是否显示隐藏文件,默认 false"
405
+ }
406
+ ],
407
+ "requires_yes": false,
408
+ "async": false
409
+ },
410
+ {
411
+ "operation_id": "file.mkdir",
412
+ "method": "POST",
413
+ "path": "/file_manage/mkdir",
414
+ "summary": "创建目录",
415
+ "fields": [
416
+ {
417
+ "name": "paths",
418
+ "in": "body",
419
+ "type": "array",
420
+ "required": true,
421
+ "description": "非空远端绝对路径字符串数组"
422
+ }
423
+ ],
424
+ "requires_yes": false,
425
+ "async": false
426
+ },
427
+ {
428
+ "operation_id": "file.move",
429
+ "method": "PUT",
430
+ "path": "/file_manage/move",
431
+ "summary": "移动或重命名文件/目录",
432
+ "fields": [
433
+ {
434
+ "name": "old_path",
435
+ "in": "body",
436
+ "type": "string",
437
+ "required": true,
438
+ "description": "原远端绝对路径"
439
+ },
440
+ {
441
+ "name": "new_path",
442
+ "in": "body",
443
+ "type": "string",
444
+ "required": true,
445
+ "description": "目标远端绝对路径"
446
+ }
447
+ ],
448
+ "requires_yes": false,
449
+ "async": false
450
+ },
451
+ {
452
+ "operation_id": "file.read",
453
+ "method": "GET",
454
+ "path": "/file_manage/edit",
455
+ "summary": "读取可编辑文件;response.data.can_edit 表示可编辑,response.data.data 为原文",
456
+ "fields": [
457
+ {
458
+ "name": "path",
459
+ "in": "query",
460
+ "type": "string",
461
+ "required": true,
462
+ "description": "远端绝对文件路径"
463
+ }
464
+ ],
465
+ "requires_yes": false,
466
+ "async": false
467
+ },
468
+ {
469
+ "operation_id": "file.unzip",
470
+ "method": "POST",
471
+ "path": "/file_manage/unzip",
472
+ "summary": "提交解压任务",
473
+ "fields": [
474
+ {
475
+ "name": "dst_path",
476
+ "in": "body",
477
+ "type": "string",
478
+ "required": true,
479
+ "description": "目标目录绝对路径"
480
+ },
481
+ {
482
+ "name": "zip_file_path",
483
+ "in": "body",
484
+ "type": "string",
485
+ "required": true,
486
+ "description": "压缩文件绝对路径"
487
+ }
488
+ ],
489
+ "requires_yes": false,
490
+ "async": true
491
+ },
492
+ {
493
+ "operation_id": "file.upload",
494
+ "method": "POST",
495
+ "path": "/file_manage/tus_upload/",
496
+ "summary": "通过 tus 上传 --source;不自动重试或续传",
497
+ "fields": [
498
+ {
499
+ "name": "path_with_file_name",
500
+ "in": "body",
501
+ "type": "string",
502
+ "required": true,
503
+ "description": "含完整文件名的远端绝对路径"
504
+ }
505
+ ],
506
+ "requires_yes": false,
507
+ "async": false,
508
+ "transfer": "upload"
509
+ },
510
+ {
511
+ "operation_id": "file.write",
512
+ "method": "POST",
513
+ "path": "/file_manage/save",
514
+ "summary": "保存完整原文;覆盖远端文件,不保证并发修改冲突检测",
515
+ "fields": [
516
+ {
517
+ "name": "path",
518
+ "in": "body",
519
+ "type": "string",
520
+ "required": true,
521
+ "description": "远端绝对文件路径"
522
+ },
523
+ {
524
+ "name": "content",
525
+ "in": "body",
526
+ "type": "string",
527
+ "required": true,
528
+ "description": "完整 UTF-8 原文(允许空串);也可由 --source 提供,二者不可混用"
529
+ }
530
+ ],
531
+ "requires_yes": false,
532
+ "async": false
533
+ },
534
+ {
535
+ "operation_id": "file.zip",
536
+ "method": "POST",
537
+ "path": "/file_manage/zip",
538
+ "summary": "提交压缩任务",
539
+ "fields": [
540
+ {
541
+ "name": "dst_path",
542
+ "in": "body",
543
+ "type": "string",
544
+ "required": true,
545
+ "description": "目标目录绝对路径"
546
+ },
547
+ {
548
+ "name": "paths",
549
+ "in": "body",
550
+ "type": "array",
551
+ "required": true,
552
+ "description": "非空远端绝对路径字符串数组"
553
+ },
554
+ {
555
+ "name": "zip_file_name",
556
+ "in": "body",
557
+ "type": "string",
558
+ "required": true,
559
+ "description": "压缩文件名称,不能包含路径分隔符"
560
+ }
561
+ ],
562
+ "requires_yes": false,
563
+ "async": true
564
+ },
565
+ {
566
+ "operation_id": "status",
567
+ "method": "GET",
568
+ "path": "/status",
569
+ "summary": "读取容器状态,不自动修复或断言健康",
570
+ "fields": [],
571
+ "requires_yes": false,
572
+ "async": false
573
+ },
574
+ {
575
+ "operation_id": "task.get",
576
+ "method": "GET",
577
+ "path": "/tasks",
578
+ "summary": "查询明确任务ID",
579
+ "fields": [
580
+ {
581
+ "name": "id",
582
+ "in": "query",
583
+ "type": "string",
584
+ "required": true,
585
+ "description": "明确的异步任务 ID"
586
+ }
587
+ ],
588
+ "requires_yes": false,
589
+ "async": false
590
+ },
591
+ {
592
+ "operation_id": "task.list",
593
+ "method": "GET",
594
+ "path": "/tasks",
595
+ "summary": "列出异步任务,不自动认领",
596
+ "fields": [
597
+ {
598
+ "name": "type",
599
+ "in": "query",
600
+ "type": "string",
601
+ "required": false,
602
+ "description": "backup/restore/zip/unzip/delete/copy"
603
+ }
604
+ ],
605
+ "requires_yes": false,
606
+ "async": false
607
+ },
608
+ {
609
+ "operation_id": "task.wait",
610
+ "method": "GET",
611
+ "path": "/tasks",
612
+ "summary": "等待明确任务ID,超时不取消远端任务",
613
+ "fields": [
614
+ {
615
+ "name": "id",
616
+ "in": "query",
617
+ "type": "string",
618
+ "required": true,
619
+ "description": "明确的异步任务 ID"
620
+ }
621
+ ],
622
+ "requires_yes": false,
623
+ "async": false
624
+ }
625
+ ]