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
//! TUI - Terminal User Interface Command
//!
//! # File
//! `crates/axonml-cli/src/commands/tui.rs`
//!
//! # Author
//! Andrew Jewell Sr - AutomataNexus
//!
//! # Updated
//! March 8, 2026
//!
//! # Disclaimer
//! Use at own risk. This software is provided "as is", without warranty of any
//! kind, express or implied. The author and AutomataNexus shall not be held
//! liable for any damages arising from the use of this software.
use crate::cli::TuiArgs;
use crate::error::CliResult;
use colored::Colorize;
use std::path::PathBuf;
// =============================================================================
// TUI Command Execution
// =============================================================================
/// Execute the tui command
pub fn execute(args: TuiArgs) -> CliResult<()> {
println!("{} {}", "Axonml TUI".cyan().bold(), "v0.1.0".dimmed());
println!();
// Convert paths
let model_path = args.model.map(PathBuf::from);
let data_path = args.data.map(PathBuf::from);
// Validate paths if provided
if let Some(ref path) = model_path {
if !path.exists() {
eprintln!(
"{} Model file not found: {}",
"warning:".yellow().bold(),
path.display()
);
}
}
if let Some(ref path) = data_path {
if !path.exists() {
eprintln!(
"{} Dataset path not found: {}",
"warning:".yellow().bold(),
path.display()
);
}
}
// Launch the TUI
println!("{}", "Starting terminal user interface...".dimmed());
println!("{}", "Press 'q' to quit, '?' for help".dimmed());
println!();
// Run the TUI application
axonml_tui::run(model_path, data_path)
.map_err(|e| crate::error::CliError::Other(format!("TUI error: {}", e)))?;
println!();
println!("{}", "TUI session ended.".green());
Ok(())
}