voirs_cli/commands/interactive/mod.rs
1//! Interactive mode for VoiRS CLI
2//!
3//! This module provides an interactive shell interface for real-time text-to-speech synthesis.
4//! Features include:
5//! - Command-line interface with history and tab completion
6//! - Real-time synthesis with immediate audio playback
7//! - Voice switching and parameter adjustments during session
8//! - Session state management and export capabilities
9
10pub mod commands;
11pub mod session;
12pub mod shell;
13pub mod synthesis;
14
15use crate::error::Result;
16use clap::Args;
17
18/// Interactive mode arguments
19#[derive(Args, Debug)]
20pub struct InteractiveOptions {
21 /// Initial voice to use
22 #[arg(short, long)]
23 pub voice: Option<String>,
24
25 /// Disable audio playback (synthesis only)
26 #[arg(long)]
27 pub no_audio: bool,
28
29 /// Enable debug output
30 #[arg(long)]
31 pub debug: bool,
32
33 /// Load session from file
34 #[arg(long)]
35 pub load_session: Option<std::path::PathBuf>,
36
37 /// Auto-save session changes
38 #[arg(long)]
39 pub auto_save: bool,
40}
41
42/// Run the interactive mode
43pub async fn run_interactive(options: InteractiveOptions) -> Result<()> {
44 // Initialize the interactive shell
45 let mut shell = shell::InteractiveShell::new(options).await?;
46
47 // Start the main interactive loop
48 shell.run().await
49}