refactor(config): 统一配置存储为 ~/.mytoolkit/config.json (keys.*)

- Config 类改用 config.json + keys.* 格式,废弃 env.json (自动迁移)
- 新增 resolve_key() / write_key_to_mytoolkit() 共享工具函数
- env CLI 文本更新 (vars → keys)
- 更新 CLAUDE.md / README.md 配置描述
This commit is contained in:
Zhengshou Lai
2026-07-06 21:11:23 +08:00
parent 1ee5a31ccf
commit 321dc57e30
4 changed files with 164 additions and 68 deletions
+2 -2
View File
@@ -115,7 +115,7 @@ All user-level config lives under `~/.mytoolkit/` (override with `$MYTOOLKIT_HOM
| File | Owner | Purpose |
|------|-------|---------|
| `env.json` | `mytoolkit env` | API keys, paths, feishu credentials (flat key/value) |
| `config.json` | `mytoolkit env` | API keys, paths, feishu credentials (keys.* namespace) |
| `mail.json` | `mytoolkit mail` | IMAP/SMTP server settings |
| `templates.json` | `mytoolkit templates` | Pointer to external template root |
@@ -131,7 +131,7 @@ mytoolkit env export # print MYCLI_FOO=... export statements
eval "$(mytoolkit env export)" # load into current shell
```
Legacy `bin/config.json` (in the source dir) is auto-migrated to `~/.mytoolkit/env.json` on first run after upgrade.
Legacy `~/.mytoolkit/env.json` is auto-migrated into `~/.mytoolkit/config.json` (keys.* format) on first load after upgrade.
## Uninstall