fix
This commit is contained in:
58
python_core/cli/cli.py
Normal file
58
python_core/cli/cli.py
Normal file
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
MixVideo 主命令行接口
|
||||
"""
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
from python_core.cli.const import progress_reporter, console, project_root
|
||||
import typer
|
||||
|
||||
# 导入命令模块
|
||||
from python_core.cli.commands import scene_app
|
||||
|
||||
app = typer.Typer(
|
||||
name="mixvideo",
|
||||
help="""
|
||||
🎬 MixVideo - 智能视频处理平台
|
||||
|
||||
功能完整的视频处理和管理工具套件:
|
||||
• 🎯 场景检测 - 智能识别视频场景变化
|
||||
• 📤 媒体管理 - 上传、处理、组织视频文件
|
||||
• 📋 模板管理 - 视频模板导入导出
|
||||
• ⚙️ 系统管理 - 配置、状态、存储管理
|
||||
|
||||
快速开始:
|
||||
mixvideo scene detect video.mp4 # 检测场景
|
||||
mixvideo scene batch-detect /videos # 批量检测
|
||||
mixvideo scene split video.mp4 # 分割视频
|
||||
mixvideo scene info video.mp4 # 视频信息
|
||||
""",
|
||||
rich_markup_mode="rich",
|
||||
no_args_is_help=True
|
||||
)
|
||||
|
||||
# 添加场景检测命令组到主应用
|
||||
app.add_typer(scene_app, name="scene")
|
||||
|
||||
@app.command()
|
||||
def init():
|
||||
"""🚀 初始化MixVideo工作环境"""
|
||||
progress_reporter.info("🚀 初始化MixVideo环境...")
|
||||
# TODO: 实现初始化逻辑
|
||||
progress_reporter.success("✅ 初始化完成")
|
||||
|
||||
def main():
|
||||
"""主入口函数"""
|
||||
try:
|
||||
app()
|
||||
except KeyboardInterrupt:
|
||||
progress_reporter.error("\n👋 用户取消操作")
|
||||
sys.exit(0)
|
||||
except Exception as e:
|
||||
progress_reporter.error(f"\n❌ [red]程序异常: {e}[/red]")
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user