Module cli

Module cli 

Source
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 renaming
  • convert - Subtitle format conversion between standards
  • sync - Audio-subtitle synchronization and timing adjustment
  • detect-encoding - Character encoding detection and conversion
  • config - Configuration management and inspection
  • cache - Cache inspection and dry-run management
  • generate-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§

CacheArgs
Command-line arguments for cache management operations.
Cli
Main CLI application structure defining the top-level interface.
ConfigArgs
Command-line arguments for configuration management operations.
ConvertArgs
Command-line arguments for subtitle format conversion.
DetectEncodingArgs
Command-line arguments for file encoding detection.
GenerateCompletionArgs
Command-line arguments for generating shell completion scripts.
InputPathHandler
Universal input path processing structure for CLI commands.
MatchArgs
Arguments for AI-powered subtitle file matching and renaming.
SyncArgs
Refactored sync command arguments supporting multiple sync methods.

Enums§

CacheAction
Cache management operations and subcommands.
Commands
Available subcommands for the SubX CLI application.
ConfigAction
Configuration management operations and subcommands.
OutputSubtitleFormat
Supported output subtitle formats for conversion operations.
SyncMethod
Sync method enumeration (backward compatible).
SyncMethodArg
Synchronization method selection for CLI arguments.
SyncMode
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.