71 lines
1.5 KiB
Markdown
71 lines
1.5 KiB
Markdown
# xiaoli-cli-plugins
|
|
|
|
小狸 CLI 官方插件仓库,存放社区贡献的扩展插件。
|
|
|
|
## 插件列表
|
|
|
|
| 插件 | 说明 | 依赖 |
|
|
|------|------|------|
|
|
| [dglab_ws](./dglab_ws/) | DG-Lab 郊狼 3.0 WebSocket 控制 | websocket-client, qrcode(可选) |
|
|
|
|
## 安装方式
|
|
|
|
1. 将插件文件夹中的 `.py` 文件复制到 xiaoli-cli 的 `plugins/` 目录
|
|
2. 在 `plugins_config.py` 中启用对应插件
|
|
|
|
```bash
|
|
# 示例:安装 dglab_ws 插件
|
|
cp dglab_ws/dglab_ws.py /path/to/xiaoli-cli/plugins/
|
|
```
|
|
|
|
```python
|
|
# plugins_config.py
|
|
ENABLE_DGLAB_WS = True
|
|
```
|
|
|
|
## 插件目录结构
|
|
|
|
每个插件一个文件夹,包含:
|
|
|
|
```
|
|
插件名/
|
|
├── 插件名.py # 插件代码
|
|
└── README.md # 使用教程
|
|
```
|
|
|
|
## 开发插件
|
|
|
|
插件是一个独立 `.py` 文件,需包含 `Liugin` 类(兼容 `Plugin`):
|
|
|
|
```python
|
|
class Liugin:
|
|
def get_tool_info(self):
|
|
"""返回插件元信息"""
|
|
return {
|
|
"name": "插件名",
|
|
"description": "一句话描述",
|
|
"keywords": ["关键词"],
|
|
"usage": "使用说明"
|
|
}
|
|
|
|
def handle(self, args):
|
|
"""处理命令,返回结果字符串"""
|
|
return "结果"
|
|
|
|
def set_cli(self, cli):
|
|
"""可选:注册CLI斜杠命令"""
|
|
pass
|
|
|
|
def get_mcp_definition(self):
|
|
"""可选:MCP工具定义"""
|
|
return {}
|
|
|
|
def convert_mcp_args(self, arguments):
|
|
"""可选:MCP参数转CLI参数"""
|
|
return ""
|
|
```
|
|
|
|
## License
|
|
|
|
MIT
|