fix: 修复命令行工具

This commit is contained in:
root
2025-07-12 13:44:57 +08:00
parent 81035caf0e
commit 31de1e5a4d
30 changed files with 2728 additions and 1755 deletions

View File

@@ -4,14 +4,11 @@ MixVideo 主命令行接口
"""
import sys
from pathlib import Path
from typing import Optional
from python_core.cli.const import progress_reporter, console, project_root
from python_core.utils.logger import logger
import typer
# 导入命令模块
from python_core.cli.commands import scene_app
from python_core.cli.commands.jsonrpc_server import jsonrpc_app
from python_core.cli.commands import scene_detect
app = typer.Typer(
name="mixvideo",
@@ -23,38 +20,30 @@ app = typer.Typer(
• 📤 媒体管理 - 上传、处理、组织视频文件
• 📋 模板管理 - 视频模板导入导出
• ⚙️ 系统管理 - 配置、状态、存储管理
快速开始:
mixvideo scene detect video.mp4 # 检测场景
mixvideo scene batch-detect /videos # 批量检测
mixvideo scene split video.mp4 # 分割视频
mixvideo scene info video.mp4 # 视频信息
mixvideo jsonrpc start # 启动JSON-RPC服务器
""",
rich_markup_mode="rich",
no_args_is_help=True
)
# 添加命令组到主应用
app.add_typer(scene_app, name="scene")
app.add_typer(jsonrpc_app, name="jsonrpc")
app.add_typer(scene_detect, name="scene")
@app.command()
def init():
"""🚀 初始化MixVideo工作环境"""
progress_reporter.info("🚀 初始化MixVideo环境...")
logger.info("🚀 初始化MixVideo环境...")
# TODO: 实现初始化逻辑
progress_reporter.success("✅ 初始化完成")
logger.success("✅ 初始化完成")
def main():
"""主入口函数"""
try:
app()
except KeyboardInterrupt:
progress_reporter.error("\n👋 用户取消操作")
logger.error("\n👋 用户取消操作")
sys.exit(0)
except Exception as e:
progress_reporter.error(f"\n❌ [red]程序异常: {e}[/red]")
logger.error(f"\n❌ [red]程序异常: {e}[/red]")
sys.exit(1)
if __name__ == "__main__":