MCPcopy
hub / github.com/AstrBotDevs/AstrBot / list

Function list

astrbot/cli/commands/cmd_plug.py:108–143  ·  view source on GitHub ↗

List plugins

(all: bool)

Source from the content-addressed store, hash-verified

106@plug.command()
107@click.option("--all", "-a", is_flag=True, help="List uninstalled plugins")
108def list(all: bool) -> None:
109 """List plugins"""
110 base_path = _get_data_path()
111 plugins = build_plug_list(base_path / "plugins")
112
113 # Unpublished plugins
114 not_published_plugins = [
115 p for p in plugins if p["status"] == PluginStatus.NOT_PUBLISHED
116 ]
117 if not_published_plugins:
118 display_plugins(not_published_plugins, "Unpublished Plugins", "red")
119
120 # Plugins needing update
121 need_update_plugins = [
122 p for p in plugins if p["status"] == PluginStatus.NEED_UPDATE
123 ]
124 if need_update_plugins:
125 display_plugins(need_update_plugins, "Plugins Needing Update", "yellow")
126
127 # Installed plugins
128 installed_plugins = [p for p in plugins if p["status"] == PluginStatus.INSTALLED]
129 if installed_plugins:
130 display_plugins(installed_plugins, "Installed Plugins", "green")
131
132 # Uninstalled plugins
133 not_installed_plugins = [
134 p for p in plugins if p["status"] == PluginStatus.NOT_INSTALLED
135 ]
136 if not_installed_plugins and all:
137 display_plugins(not_installed_plugins, "Uninstalled Plugins", "blue")
138
139 if (
140 not any([not_published_plugins, need_update_plugins, installed_plugins])
141 and not all
142 ):
143 click.echo("No plugins installed")
144
145
146@plug.command()

Callers 15

call_local_llm_toolFunction · 0.50
_resolve_pathMethod · 0.50
stop_allMethod · 0.50
flushMethod · 0.50
linesMethod · 0.50

Calls 3

_get_data_pathFunction · 0.85
build_plug_listFunction · 0.85
display_pluginsFunction · 0.85

Tested by

no test coverage detected