48 lines
1.4 KiB
Markdown
48 lines
1.4 KiB
Markdown
# 团队默认配置(team-defaults)
|
||
|
||
把团队的模型/供应商/界面偏好打包成一个可分发快照。新成员装上后一条命令
|
||
就能让自己的 harness 配置与服务端团队设置对齐,不用手工抄。
|
||
|
||
## 用法
|
||
|
||
```bash
|
||
# 下载并安装插件
|
||
python client/dsh_sync_client.py install team-defaults
|
||
|
||
# 应用到本地配置(已存在的键不会被覆盖)
|
||
python ~/.dsh/plugins/team-defaults/files/apply.py --config ~/.dsh/config.json
|
||
|
||
# 先看看会改什么
|
||
python .../apply.py --config ~/.dsh/config.json --dry-run
|
||
|
||
# 只应用模型相关
|
||
python .../apply.py --config ~/.dsh/config.json --only 'model.*' 'provider.*'
|
||
|
||
# 强制以团队值为准(覆盖本地改动)
|
||
python .../apply.py --config ~/.dsh/config.json --overwrite
|
||
```
|
||
|
||
写入前会自动在同目录留一份 `config.json.bak`。
|
||
|
||
## 更新快照
|
||
|
||
`files/defaults.json` 可以手工维护,也可以从服务端导出:
|
||
|
||
```bash
|
||
curl -H "Authorization: Bearer <token>" http://<server>:8020/v1/settings \
|
||
| python -c "import json,sys; d=json.load(sys.stdin)['settings']; \
|
||
print(json.dumps({k: v['value'] for k,v in d.items()}, indent=2, ensure_ascii=False))" \
|
||
> files/defaults.json
|
||
```
|
||
|
||
改完 `manifest.json` 里的 `version`,再发布:
|
||
|
||
```bash
|
||
bash tools/publish-plugin.sh team-defaults
|
||
```
|
||
|
||
## 安全
|
||
|
||
插件里不含任何 API Key。`provider.base_url` 只是端点地址;真实密钥按
|
||
ARCHITECTURE.md §7 留在各设备本地或走团队网关。
|