1688-product-master/CONFIG_MIGRATION.md

54 lines
937 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 配置迁移说明
## v2.0 重大变更
从 v2.0 开始,本 skill 不再使用 `.env.local` 文件,改为使用全局配置文件 `~/.openclaw/.env`
### 迁移步骤
1. **全局配置已自动创建**
```bash
~/.openclaw/.env
```
2. **删除本地 .env.local**
```bash
rm .env.local
```
3. **验证配置**
```bash
cat ~/.openclaw/.env
```
### 优势
- ✅ 一处配置,所有 skill 共享
- ✅ 更换 KEY 只需修改一个文件
- ✅ 新 skill 无需重复配置
### 配置优先级
1. 命令行参数(最高)
```bash
bun run scripts/run.ts --client-key=xxx scrape-url ...
```
2. 全局配置 `~/.openclaw/.env`
```bash
CLIENT_KEY=sk_xxx
```
3. 默认值
### 回滚到 v1.x不推荐
如果需要使用 `.env.local`
```bash
cp ~/.openclaw/.env .env.local
git checkout scripts/run.ts # 恢复旧版本
```
但建议使用新的全局配置模式。