diff options
Diffstat (limited to 'makima/src/bin/makima.rs')
| -rw-r--r-- | makima/src/bin/makima.rs | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/makima/src/bin/makima.rs b/makima/src/bin/makima.rs index 67eefc6..3be6003 100644 --- a/makima/src/bin/makima.rs +++ b/makima/src/bin/makima.rs @@ -12,6 +12,7 @@ use makima::daemon::tui::{self, Action, App, ListItem, ViewType, TuiWsClient, Ws use makima::daemon::config::{DaemonConfig, RepoEntry}; use makima::daemon::db::LocalDb; use makima::daemon::error::DaemonError; +use makima::daemon::setup; use makima::daemon::task::{TaskConfig, TaskManager}; use makima::daemon::ws::{DaemonCommand, WsClient}; use tokio::process::Command; @@ -72,6 +73,54 @@ async fn run_daemon( ) -> Result<(), Box<dyn std::error::Error + Send + Sync>> { eprintln!("=== Makima Daemon Starting ==="); + // Check dependencies unless skipped + if !args.skip_setup_check { + eprintln!("[0/5] Checking dependencies..."); + let dep_result = setup::check_dependencies().await; + setup::print_dependency_summary(&dep_result); + + // Check for missing critical dependencies + if !dep_result.claude.installed { + let os = setup::OperatingSystem::detect(); + + // If npm is available, offer to install Claude Code + if dep_result.npm_available() { + eprintln!(); + if setup::read_yes_no("Would you like to install Claude Code now?") { + match setup::install_claude_with_npm().await { + Ok(()) => { + eprintln!(); + // Re-check to verify installation + let recheck = setup::check_dependencies().await; + if !recheck.claude.installed { + eprintln!("\x1b[31mClaude Code installation could not be verified.\x1b[0m"); + eprintln!("Please try installing manually and restart the daemon."); + std::process::exit(1); + } + } + Err(e) => { + eprintln!("\x1b[31mFailed to install Claude Code: {}\x1b[0m", e); + setup::print_claude_install_instructions(os, true); + std::process::exit(1); + } + } + } else { + setup::print_claude_install_instructions(os, true); + std::process::exit(1); + } + } else { + setup::print_claude_install_instructions(os, false); + std::process::exit(1); + } + } + + if !dep_result.git.installed { + let os = setup::OperatingSystem::detect(); + setup::print_git_install_instructions(os); + std::process::exit(1); + } + } + // Build a temporary CLI struct for config loading let cli = makima::daemon::cli::daemon::DaemonArgs { config: args.config, @@ -82,6 +131,7 @@ async fn run_daemon( max_tasks: args.max_tasks, log_level: args.log_level, bubblewrap: args.bubblewrap, + skip_setup_check: args.skip_setup_check, }; // Load configuration with CLI overrides |
