-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcli.py
More file actions
98 lines (80 loc) · 3.71 KB
/
cli.py
File metadata and controls
98 lines (80 loc) · 3.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/usr/bin/env python3
"""
EncodeForge CLI
This release ships the desktop app only. Commands other than ``gui`` are placeholders
and exit with a notice; full CLI may return in a later release.
"""
import sys
import click
import logging
from pathlib import Path
# Add project root to path
sys.path.insert(0, str(Path(__file__).parent))
from app import __version__ as APP_VERSION
# Setup logging
try:
from utils.logging_config import setup_logging
setup_logging()
except ImportError:
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)
@click.group()
@click.version_option(version=APP_VERSION)
def cli():
"""EncodeForge — desktop app; CLI encode/subtitle/rename not implemented yet."""
pass
@cli.command()
@click.argument('input_path', type=click.Path(exists=True))
@click.option('--output', '-o', type=click.Path(), help='Output directory')
@click.option('--codec', '-c', default='h264', help='Video codec (h264, h265, av1)')
@click.option('--preset', '-p', default='medium', help='Encoding preset')
@click.option('--use-nvenc', is_flag=True, help='Use NVIDIA NVENC hardware acceleration')
@click.option('--use-qsv', is_flag=True, help='Use Intel Quick Sync hardware acceleration')
@click.option('--crf', type=int, default=23, help='Quality (CRF) value (0-51, lower is better)')
def encode(input_path, output, codec, preset, use_nvenc, use_qsv, crf):
"""Encode video files with FFmpeg (not available in this release — use the GUI)."""
click.echo(
click.style(f"The encode command is not implemented in v{APP_VERSION}.", fg="yellow", bold=True)
)
click.echo("Use the desktop application: python main.py or python cli.py gui")
raise SystemExit(2)
@cli.command()
@click.argument('input_path', type=click.Path(exists=True))
@click.option('--language', '-l', default='en', help='Subtitle language code')
@click.option('--generate', is_flag=True, help='Generate subtitles using Whisper AI')
@click.option('--model', default='base', help='Whisper model (tiny, base, small, medium, large)')
@click.option('--provider', help='Subtitle provider (opensubtitles, addic7ed, etc.)')
def subtitle(input_path, language, generate, model, provider):
"""Download or generate subtitles (not available in this release — use the GUI)."""
click.echo(
click.style(f"The subtitle command is not implemented in v{APP_VERSION}.", fg="yellow", bold=True)
)
click.echo("Use the desktop application: python main.py or python cli.py gui")
raise SystemExit(2)
@cli.command()
@click.argument('input_path', type=click.Path(exists=True))
@click.option('--tmdb-key', help='TMDB API key')
@click.option('--tvdb-key', help='TVDB API key')
@click.option('--pattern', help='Custom naming pattern')
@click.option('--preview', is_flag=True, help='Preview changes without renaming')
@click.option('--type', type=click.Choice(['movie', 'tv', 'anime', 'auto']), default='auto')
def rename(input_path, tmdb_key, tvdb_key, pattern, preview, type):
"""Rename media files using metadata (not available in this release — use the GUI)."""
click.echo(
click.style(f"The rename command is not implemented in v{APP_VERSION}.", fg="yellow", bold=True)
)
click.echo("Use the desktop application: python main.py or python cli.py gui")
raise SystemExit(2)
@cli.command()
def gui():
"""Launch the PySide6 GUI application"""
logger.info("Launching GUI")
click.echo("Starting EncodeForge GUI...")
# Import and run GUI
from main import main
main()
if __name__ == '__main__':
cli()