# Kimi Search 插件安装与使用指南
# Kimi Search 插件安装与使用指南
## 一、安装方式
### 1. 文件夹操作
将插件压缩包解压到本地目录:
```other
# 创建插件目录
mkdir -p /tmp/openclaw_plugin
# 解压插件(假设压缩包名为 kimi-search.zip)
unzip kimi-search.zip -d /tmp/openclaw_plugin/kimi-search
```
**注意**:路径可以自定义,但后续安装命令需要对应修改。
### 2. 插件安装命令
使用 OpenClaw CLI 安装本地插件:
```other
openclaw plugins install -l /tmp/openclaw_plugin/kimi-search
```
安装成功后,会显示插件信息。
### 3. Key 配置方法
**关键**:API Key 必须通过 **LaunchAgent 环境变量** 配置,不能放在 openclaw.json 中。
**步骤**:
1. 打开 LaunchAgent 配置文件:
```other
open ~/Library/LaunchAgents/ai.openclaw.gateway.plist
```
1. 在 `EnvironmentVariables` 段落中添加:
```xml
KIMI_PLUGIN_API_KEY
sk-kimi-你的API密钥
```
1. 重启 Gateway 使配置生效:
```other
openclaw gateway stop
launchctl unload ~/Library/LaunchAgents/ai.openclaw.gateway.plist
launchctl load ~/Library/LaunchAgents/ai.openclaw.gateway.plist
```
**验证 Key 是否加载**:
```other
launchctl getenv KIMI_PLUGIN_API_KEY
```
---
## 二、使用方式
### 搜索参数配置
工具名称:`kimi_search`
**参数说明**:
| 参数 | 类型 | 必填 | 范围 | 默认值 | 说明 |
| --------------- | ------- | -- | ---------- | ----- | -------- |
| query | string | 是 | \- | \- | 搜索关键词 |
| limit | integer | 否 | 1-20 | 5 | 返回结果数量 |
| include_content | boolean | 否 | true/false | false | 是否包含页面全文 |
**使用示例**:
```json
{
"query": "OpenClaw 最新功能",
"limit": 5,
"include_content": false
}
```
**参数详解**:
- **query**: 搜索关键词,支持中文和英文
- **limit**: 控制返回结果数量,建议 3-10 条,太多会消耗大量 token
- **include_content**: 设为 true 时会抓取每个搜索结果的页面全文,信息更完整但 token 消耗大
**调用方式**(作为大模型参考):
```
新喀里多尼亚 旅游攻略
5
true
```