MCPcopy Index your code
hub / github.com/AstrBotDevs/AstrBot / search

Function search

astrbot/cli/commands/cmd_plug.py:257–274  ·  view source on GitHub ↗

Search for plugins

(query: str)

Source from the content-addressed store, hash-verified

255@plug.command()
256@click.argument("query")
257def search(query: str) -> None:
258 """Search for plugins"""
259 base_path = _get_data_path()
260 plugins = build_plug_list(base_path / "plugins")
261
262 matched_plugins = [
263 p
264 for p in plugins
265 if query.lower() in p["name"].lower()
266 or query.lower() in p["desc"].lower()
267 or query.lower() in p["author"].lower()
268 ]
269
270 if not matched_plugins:
271 click.echo(f"No plugins matching '{query}' found")
272 return
273
274 display_plugins(matched_plugins, f"Search results: '{query}'", "cyan")

Callers 1

_runMethod · 0.85

Calls 3

_get_data_pathFunction · 0.85
build_plug_listFunction · 0.85
display_pluginsFunction · 0.85

Tested by

no test coverage detected