MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / switch

Method switch

crates/chat-cli/src/cli/agent/mod.rs:478–486  ·  view source on GitHub ↗
(&mut self, name: &str)

Source from the content-addressed store, hash-verified

476 }
477
478 pub fn switch(&mut self, name: &str) -> eyre::Result<&Agent> {
479 if !self.agents.contains_key(name) {
480 eyre::bail!("No agent with name {name} found");
481 }
482 self.active_idx = name.to_string();
483 self.agents
484 .get(name)
485 .ok_or(eyre::eyre!("No agent with name {name} found"))
486 }
487
488 /// This function does a number of things in the following order:
489 /// 1. Migrates old profiles if applicable

Callers 9

newMethod · 0.80
get_test_agentsFunction · 0.80
swap_agentMethod · 0.80
test_switchFunction · 0.80
executeMethod · 0.80
create_agentFunction · 0.80

Calls 2

to_stringMethod · 0.80
getMethod · 0.45