59 lines
1.7 KiB
Python
59 lines
1.7 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
MixVideo 主命令行接口
|
|
"""
|
|
|
|
import sys
|
|
from python_core.utils.logger import logger
|
|
import typer
|
|
|
|
# 导入命令模块
|
|
from python_core.cli.commands import scene_detect
|
|
from python_core.cli.commands.template import template_app
|
|
from python_core.cli.commands.resource_category import resource_category_app
|
|
from python_core.cli.commands.auth import auth_app
|
|
|
|
app = typer.Typer(
|
|
name="mixvideo",
|
|
help="""
|
|
🎬 MixVideo - 智能视频处理平台
|
|
|
|
功能完整的视频处理和管理工具套件:
|
|
• 🎯 场景检测 - 智能识别视频场景变化
|
|
• 📋 模板管理 - 视频模板批量导入、列表查看、详情获取
|
|
• 🏷️ 分类管理 - 资源分类创建、更新、删除、搜索
|
|
• 👤 用户认证 - 用户注册、登录、JWT token管理
|
|
• 📤 媒体管理 - 上传、处理、组织视频文件
|
|
• ⚙️ 系统管理 - 配置、状态、存储管理
|
|
""",
|
|
rich_markup_mode="rich",
|
|
no_args_is_help=True
|
|
)
|
|
|
|
# 添加命令组到主应用
|
|
app.add_typer(scene_detect, name="scene")
|
|
app.add_typer(template_app, name="template")
|
|
app.add_typer(resource_category_app, name="resource-category")
|
|
app.add_typer(auth_app, name="auth")
|
|
|
|
@app.command()
|
|
def init():
|
|
"""🚀 初始化MixVideo工作环境"""
|
|
logger.info("🚀 初始化MixVideo环境...")
|
|
# TODO: 实现初始化逻辑
|
|
logger.success("✅ 初始化完成")
|
|
|
|
def main():
|
|
"""主入口函数"""
|
|
try:
|
|
app()
|
|
except KeyboardInterrupt:
|
|
logger.error("\n👋 用户取消操作")
|
|
sys.exit(0)
|
|
except Exception as e:
|
|
logger.error(f"\n❌ [red]程序异常: {e}[/red]")
|
|
sys.exit(1)
|
|
|
|
if __name__ == "__main__":
|
|
main()
|