(workspace: Option<&Path>)
| 21 | } |
| 22 | |
| 23 | pub async fn print_agents(workspace: Option<&Path>) -> Result<()> { |
| 24 | let registry = get_agent_registry(); |
| 25 | let modes = registry.get_modes_info().await; |
| 26 | let subagents = registry.get_subagents_info(workspace).await; |
| 27 | |
| 28 | println!("Agent modes"); |
| 29 | println!(); |
| 30 | if modes.is_empty() { |
| 31 | println!("No agent modes found."); |
| 32 | } else { |
| 33 | for agent in modes { |
| 34 | println!( |
| 35 | "- {}: {} (tools: {}, readonly: {}, review: {})", |
| 36 | agent.id, agent.name, agent.tool_count, agent.is_readonly, agent.is_review |
| 37 | ); |
| 38 | if !agent.description.is_empty() { |
| 39 | println!(" {}", agent.description); |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | println!(); |
| 45 | println!("Subagents"); |
| 46 | println!(); |
| 47 | if subagents.is_empty() { |
| 48 | println!("No subagents found for the current workspace."); |
| 49 | } else { |
| 50 | for agent in subagents { |
| 51 | println!( |
| 52 | "- {}: {} (tools: {}, enabled: {}, readonly: {}, review: {})", |
| 53 | agent.id, |
| 54 | agent.name, |
| 55 | agent.tool_count, |
| 56 | agent.effective_enabled, |
| 57 | agent.is_readonly, |
| 58 | agent.is_review |
| 59 | ); |
| 60 | if !agent.description.is_empty() { |
| 61 | println!(" {}", agent.description); |
| 62 | } |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | Ok(()) |
| 67 | } |
| 68 | |
| 69 | pub async fn print_models() -> Result<()> { |
| 70 | let config_service = ensure_global_config_service().await?; |
no test coverage detected