(config_path: &str, foreground: bool)
| 652 | } |
| 653 | |
| 654 | async fn cmd_start(config_path: &str, foreground: bool) -> Result<(), Box<dyn std::error::Error>> { |
| 655 | tui::print_banner("Start"); |
| 656 | if foreground { |
| 657 | return cmd_start_inner(config_path).await; |
| 658 | } |
| 659 | |
| 660 | let path = PathBuf::from(config_path); |
| 661 | ensure_config_migrated(&path)?; |
| 662 | Config::from_file(&path) |
| 663 | .map_err(|e| format!("Failed to load configuration from '{}': {}", config_path, e))?; |
| 664 | ensure_service_config_matches(&path)?; |
| 665 | |
| 666 | tui::print_info("Config", config_path); |
| 667 | println!("Starting ClawShell via service manager..."); |
| 668 | platform::service_start()?; |
| 669 | tui::print_success("ClawShell started successfully."); |
| 670 | tui::print_info("Logs", &process::log_file_path().display().to_string()); |
| 671 | Ok(()) |
| 672 | } |
| 673 | |
| 674 | async fn cmd_start_inner(config_path: &str) -> Result<(), Box<dyn std::error::Error>> { |
| 675 | // Validate configuration |
no test coverage detected