CLI entrypoint for MedCAT commands.
Functions:
install_plugins_command
install_plugins_command(*args: str)
Source code in medcat-v2/medcat/plugins/cli.py
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 | def install_plugins_command(*args: str):
opts = [arg for arg in args if arg.startswith("--")]
plugins = [arg for arg in args if arg not in opts]
dry_run = "--dry-run" in opts
manager = PluginInstallationManager()
if not plugins:
print("Error: No plugins specified", file=sys.stderr)
return 1
results = manager.install_multiple(plugins, dry_run=dry_run)
failed = [name for name, success in results.items() if not success]
if failed:
print(f"Failed to install: {', '.join(failed)}", file=sys.stderr)
return 1
print(f"Successfully installed: {', '.join(results.keys())}")
return 0
|