roboticus_cli/cli/admin/misc/
mechanic_text.rs1include!("mechanic_text_local.rs");
2include!("mechanic_text_gateway.rs");
3include!("mechanic_text_security.rs");
4
5pub async fn cmd_mechanic(
6 base_url: &str,
7 repair: bool,
8 json_output: bool,
9 allow_jobs: &[String],
10) -> Result<(), Box<dyn std::error::Error>> {
11 if json_output {
12 return cmd_mechanic_json(base_url, repair, allow_jobs).await;
13 }
14 let (DIM, BOLD, ACCENT, GREEN, YELLOW, RED, CYAN, RESET, MONO) = colors();
15 let (OK, ACTION, WARN, DETAIL, ERR) = icons();
16 println!(
17 "\n {BOLD}Roboticus Mechanic{RESET}{}\n",
18 if repair { " (--repair mode)" } else { "" }
19 );
20
21 let roboticus_dir = roboticus_core::home_dir().join(".roboticus");
22 let mut fixed = 0u32;
23
24 run_mechanic_text_local_preflight(&roboticus_dir, repair, &mut fixed)?;
25 run_mechanic_text_gateway_checks(base_url, &roboticus_dir, repair, allow_jobs, &mut fixed).await?;
26 run_mechanic_text_security_and_finalize(&roboticus_dir, repair, &mut fixed)?;
27 Ok(())
28}