MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / select_cli

Method select_cli

core/peer_cli.py:153–164  ·  view source on GitHub ↗

Pick the best available CLI for the task type. Falls back through preference list, skipping excluded names.

(self, task_type: str, exclude: List[str] = None)

Source from the content-addressed store, hash-verified

151 return "default"
152
153 def select_cli(self, task_type: str, exclude: List[str] = None) -> Optional[PeerCLI]:
154 """
155 Pick the best available CLI for the task type.
156 Falls back through preference list, skipping excluded names.
157 """
158 exclude = exclude or []
159 available_names = {c.name for c in self.available()}
160 preference = TASK_CLI_PREFERENCE.get(task_type, TASK_CLI_PREFERENCE["default"])
161 for name in preference:
162 if name not in exclude and name in available_names:
163 return next(c for c in self.available() if c.name == name)
164 return None
165
166 def build_prompt(self, user_message: str, errors: List[str], files: List[str]) -> str:
167 """Build a context-rich, directive prompt to pass to the external CLI.

Callers 2

handle_commandFunction · 0.80
escalateFunction · 0.80

Calls 2

availableMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected