MCPcopy Create free account
hub / github.com/GCWing/BitFun / print_agents

Function print_agents

src/apps/cli/src/management.rs:23–67  ·  view source on GitHub ↗
(workspace: Option<&Path>)

Source from the content-addressed store, hash-verified

21}
22
23pub 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
69pub async fn print_models() -> Result<()> {
70 let config_service = ensure_global_config_service().await?;

Callers 1

run_cliFunction · 0.85

Calls 4

get_agent_registryFunction · 0.85
get_modes_infoMethod · 0.80
get_subagents_infoMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected