yuanflow-cli 0.1.37 → 0.1.39

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/src/cli.js CHANGED
@@ -20,6 +20,7 @@ import { collectComments } from './comment-collector.js';
20
20
  import { getKnowledgeDocs, navigateKnowledge } from './knowledge-tools.js';
21
21
  import { copyObject, signedUrl, tempUpload } from './oss-tools.js';
22
22
  import { runBrowserCommand } from './browser-tools.js';
23
+ import { runVideoCommand } from './video-tools.js';
23
24
  import {
24
25
  getWorkDetail,
25
26
  getWorkDownload,
@@ -86,6 +87,11 @@ export async function main(argv) {
86
87
  return;
87
88
  }
88
89
 
90
+ if (command === 'video') {
91
+ await handleVideo(rest);
92
+ return;
93
+ }
94
+
89
95
  if (command === 'schema') {
90
96
  await handleSchema(rest);
91
97
  return;
@@ -396,6 +402,16 @@ async function handleBrowser(args) {
396
402
  });
397
403
  }
398
404
 
405
+ async function handleVideo(args) {
406
+ const { positionals, options } = parseOptions(args);
407
+ const [action = 'init'] = positionals;
408
+ const result = await runVideoCommand({ action, options });
409
+ await outputResult(result, options, {
410
+ command: `video ${action}`,
411
+ meta: { kind: 'video-editing' },
412
+ });
413
+ }
414
+
399
415
  async function handleGeneratedCommand(platform, args) {
400
416
  if (!getPlatforms().includes(platform)) {
401
417
  throw new Error(`未知平台:${platform}。可用平台:${getPlatforms().join(', ')}`);
@@ -567,11 +583,16 @@ function printHelp() {
567
583
  yuanflow-cli oss signed-url --key path/to/file.png --ttl-seconds 1800 --format agent-json
568
584
  yuanflow-cli browser profile-path --platform douyin --account main --format agent-json
569
585
  yuanflow-cli browser task-plan --platform xiaohongshu --task publish --account main --format agent-json
586
+ yuanflow-cli video init --input "D:\\素材" --primary-audio "D:\\素材\\口播.mp3" --broll "D:\\素材\\画面.mp4" --format agent-json
587
+ yuanflow-cli video strategy --project "D:\\素材\\yuanflow-video-edit" --template-type talking_head --rules-file "D:\\规则\\logic.json,D:\\规则\\template.json,D:\\规则\\cli.json" --format agent-json
588
+ yuanflow-cli video timeline --project "D:\\素材\\yuanflow-video-edit" --fps 1 --format agent-json
589
+ yuanflow-cli video plan --project "D:\\素材\\yuanflow-video-edit" --timeline-plan "D:\\素材\\yuanflow-video-edit\\timeline_plan.agent.json" --format agent-json
570
590
  yuanflow-cli list douyin
571
591
 
572
592
  说明:
573
593
  社媒请求调用 Yuan API 的 /social/*path;知识库和 OSS 原子能力调用 /api/* 或 /atomic/*。
574
594
  browser 命令是自媒体平台专用浏览器自动化协议,只返回受控 profile/cookie/任务路径与执行计划,不用于普通网页搜索。
595
+ video 命令是视频智能剪辑基础链路:规则库策略快照、主音频+B-roll、1秒1帧抽帧、Agent 生成 timeline_plan/EDL、CLI 校验和渲染。
575
596
  需要鉴权的请求都会使用 Authorization: Bearer <token>。
576
597
  token 优先级:--token > YUANCHUANG_API_TOKEN > 本地 config.token。
577
598
  YuanFlow 主程序内使用时,token 由主程序认证系统注入,不需要手动配置。