| 49 | |
| 50 | impl Command for AgentStatus { |
| 51 | fn run(&self) -> CliResult<()> { |
| 52 | let repo_root = find_repository_root()?; |
| 53 | |
| 54 | let registry = AgentRegistry::with_defaults(); |
| 55 | |
| 56 | // Installed agents |
| 57 | |
| 58 | println!("Agent Integration Status"); |
| 59 | println!("======================="); |
| 60 | println!(); |
| 61 | |
| 62 | let installed = registry.installed(&repo_root); |
| 63 | let detected = registry.detect(&repo_root); |
| 64 | |
| 65 | if installed.is_empty() { |
| 66 | println!(" Hooks: not installed"); |
| 67 | println!(); |
| 68 | if !detected.is_empty() { |
| 69 | println!( |
| 70 | " Detected agent{}: {}", |
| 71 | if detected.len() == 1 { "" } else { "s" }, |
| 72 | detected.join(", "), |
| 73 | ); |
| 74 | println!(); |
| 75 | println!(" Run 'atomic agent enable' to start recording agent turns."); |
| 76 | } else { |
| 77 | println!(" No agents detected in this repository."); |
| 78 | println!( |
| 79 | " Create a .claude/ directory (or similar) and run 'atomic agent enable'." |
| 80 | ); |
| 81 | } |
| 82 | println!(); |
| 83 | return Ok(()); |
| 84 | } |
| 85 | |
| 86 | // Show installed agents |
| 87 | for agent_name in &installed { |
| 88 | if let Some(agent) = registry.get(agent_name) { |
| 89 | println!(" ✓ {} — hooks installed", agent.display_name()); |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | // Show detected but not installed agents |
| 94 | for agent_name in &detected { |
| 95 | if !installed.contains(agent_name) { |
| 96 | if let Some(agent) = registry.get(agent_name) { |
| 97 | println!( |
| 98 | " ○ {} — detected but hooks not installed", |
| 99 | agent.display_name() |
| 100 | ); |
| 101 | } |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | println!(); |
| 106 | |
| 107 | // Sessions |
| 108 | |