feat: 添加 /plugin 插件市场命令

功能:
- /plugin list - 列出可用插件(自动同步远程源)
- /plugin search <关键词> - 搜索插件
- /plugin info <插件码> - 查看插件详情
- /plugin install <插件码|URL> - 安装插件(自动下载、启用、动态加载)
- /plugin remove <名称> - 卸载插件
- /plugin update <插件码> - 更新插件
- /plugin add-source <URL> - 添加远程插件源

文件:
- xcli_core/plugin_market.py - PluginMarketMixin 核心逻辑
- plugin_registry.json - 本地插件码注册表
- xcli_core/cli_core.py - 集成 PluginMarketMixin
- HELP.md - 添加插件市场文档
This commit is contained in:
xiaoli-cli bot committed 2026-04-30 02:37:05 +08:00
1 parent 0d27f2b774
commit 6f13d41c11
4 files changed
+646 -1

No files matched your search

+10 -1
View File
@@ -18,10 +18,11 @@ from .cli_tools import ToolMixin
from .cli_code_exec import CodeExecMixin
from .cli_display import DisplayMixin
from .cli_history import HistoryMixin
from .plugin_market import PluginMarketMixin
from .notification import notify_task_complete, get_notification_manager
class AICLI(BaseAICLI, ClawliMixin, ToolMixin, CodeExecMixin, DisplayMixin, HistoryMixin):
class AICLI(BaseAICLI, ClawliMixin, ToolMixin, CodeExecMixin, DisplayMixin, HistoryMixin, PluginMarketMixin):
"""AI CLI主程序 - 组合所有 Mixin"""
# ── 深度思考处理 ──
@@ -1018,6 +1019,7 @@ multi 操作支持一次修改多处:
print(f"{Fore.GREEN}输入 '/chat list' 查看所有已保存的聊天记录{Style.RESET_ALL}")
print(f"{Fore.GREEN}输入 '/chat open <名称>' 加载聊天记录{Style.RESET_ALL}")
print(f"{Fore.GREEN}输入 '/remote' 查看远程连接帮助{Style.RESET_ALL}")
print(f"{Fore.GREEN}输入 '/plugin' 管理插件市场 (安装/卸载/搜索){Style.RESET_ALL}")
current_engine_name = getattr(self.current_engine, 'name', '未设置') if self.current_engine else '未设置'
print(f"{Fore.GREEN}当前使用的AI引擎: {current_engine_name}{Style.RESET_ALL}")
loaded_engines = list(self.engines.keys())
@@ -1162,6 +1164,13 @@ multi 操作支持一次修改多处:
print(f"{Fore.RED}未知的聊天命令.可用命令: save, list, open{Style.RESET_ALL}")
continue
if user_input.startswith('/plugin'):
plugin_args = user_input[7:].strip()
result = self.handle_plugin_command(plugin_args)
if result:
print(result)
continue
if user_input.startswith('/remote'):
remote_command = user_input[7:].strip()
self._handle_remote_command(remote_command)