Expand description
Command-line interface for the SubX subtitle processing tool.
This module provides the top-level CLI application structure and subcommands for AI-powered matching, subtitle format conversion, audio synchronization, encoding detection, configuration management, cache operations, and shell completion generation.
§Architecture
The CLI is built using clap
and follows a subcommand pattern:
match
- AI-powered subtitle file matching and renamingconvert
- Subtitle format conversion between standardssync
- Audio-subtitle synchronization and timing adjustmentdetect-encoding
- Character encoding detection and conversionconfig
- Configuration management and inspectioncache
- Cache inspection and dry-run managementgenerate-completion
- Shell completion script generation
§Examples
# Basic subtitle matching
subx match /path/to/videos /path/to/subtitles
# Convert SRT to ASS format
subx convert --input file.srt --output file.ass --format ass
# Detect file encoding
subx detect-encoding *.srt
Re-exports§
pub use ui::create_progress_bar;
pub use ui::display_ai_usage;
pub use ui::display_match_results;
pub use ui::print_error;
pub use ui::print_success;
pub use ui::print_warning;
Modules§
- table
- Table formatting utilities for displaying structured CLI output.
- ui
- User interface utilities and display helpers for SubX CLI.
Structs§
- Cache
Args - Command-line arguments for cache management operations.
- Cli
- Main CLI application structure defining the top-level interface.
- Config
Args - Command-line arguments for configuration management operations.
- Convert
Args - Command-line arguments for subtitle format conversion.
- Detect
Encoding Args - Command-line arguments for file encoding detection.
- Generate
Completion Args - Command-line arguments for generating shell completion scripts.
- Input
Path Handler - Universal input path processing structure for CLI commands.
- Match
Args - Arguments for AI-powered subtitle file matching and renaming.
- Sync
Args - Refactored sync command arguments supporting multiple sync methods.
Enums§
- Cache
Action - Cache management operations and subcommands.
- Commands
- Available subcommands for the SubX CLI application.
- Config
Action - Configuration management operations and subcommands.
- Output
Subtitle Format - Supported output subtitle formats for conversion operations.
- Sync
Method - Sync method enumeration (backward compatible).
- Sync
Method Arg - Synchronization method selection for CLI arguments.
- Sync
Mode - Sync mode: single file or batch
Functions§
- run
- Executes the SubX CLI application with parsed arguments.
- run_
with_ config - Run the CLI with a provided configuration service.