MCPcopy
hub / github.com/MinishLab/semble / run

Function run

src/semble/installer/installer.py:181–208  ·  view source on GitHub ↗

Interactively install or uninstall semble across coding agents.

(mode: Mode)

Source from the content-addressed store, hash-verified

179
180
181def run(mode: Mode) -> None:
182 """Interactively install or uninstall semble across coding agents."""
183 install = mode == "install"
184 print(f"\n {_BOLD}{'Semble Installer' if install else 'Semble Uninstaller'}{_RESET}\n")
185
186 agent_items = [
187 (f"{a.display_name}{' (detected)' if (detected := is_detected(a)) else ''}", a, detected and install)
188 for a in sorted(AGENTS, key=lambda a: not is_detected(a))
189 ]
190 chosen_agents = _checkbox(
191 f"Select agents to {'configure' if install else 'remove configuration from'}:", agent_items
192 ) or _exit("Nothing selected. Exiting.")
193
194 max_label = max(len(i.label) for i in _INTEGRATIONS)
195 integ_items = [(f"{i.label:<{max_label}} — {i.desc}", i, True) for i in _INTEGRATIONS]
196 chosen_integrations = _checkbox(
197 f"Select integrations to {'enable' if install else 'remove'}:", integ_items
198 ) or _exit("Nothing selected. Exiting.")
199
200 _print_plan(chosen_agents, chosen_integrations)
201
202 question = "Proceed?" if install else "Remove semble configuration?"
203 if not questionary.confirm(question, default=install).ask():
204 _exit("Cancelled.")
205
206 _apply(mode, chosen_agents, chosen_integrations)
207 footer = " Restart your agents to pick up the changes." if install else ""
208 print(f" {_GREEN}Done!{_RESET}{footer}\n")

Callers 3

_cli_mainFunction · 0.90
test_run_completesFunction · 0.90
test_run_cancelsFunction · 0.90

Calls 6

is_detectedFunction · 0.90
_checkboxFunction · 0.85
_exitFunction · 0.85
_print_planFunction · 0.85
_applyFunction · 0.85
askMethod · 0.45

Tested by 2

test_run_completesFunction · 0.72
test_run_cancelsFunction · 0.72