v0.1.28
What's Changed in v0.1.28
⚠️ 本次发布包含破坏性更新,请先阅读下方 Breaking Changes。
💥 Breaking Changes
1. <alias> 现在始终必填
旧版 cc-switch add --from-file foo.json 会把文件名当作 alias 自动推导。现在 alias 必须显式提供。
- cc-switch add --from-file foo.json
+ cc-switch add foo --from-file foo.json # 显式 alias
+ cc-switch add foo --from-file # 或:从默认路径导入如果没传 alias,会得到 clap 的明确报错(不会静默使用错误的别名)。
2. -j 短选项已删除
请改用完整的 --from-file。
- cc-switch add foo -j ./config.json
+ cc-switch add foo --from-file ./config.json3. 文件名推导 alias 的逻辑被移除
之前的"自动用文件名当别名"已经彻底删除(与 codex add 行为统一)。
✨ Highlights
--from-file 现在支持不带路径,自动从工具默认配置导入
| 命令 | 行为 |
|---|---|
cc-switch add work --from-file |
读 ~/.claude/settings.json |
cc-switch add work --from-file <path> |
读指定文件 |
cc-switch codex add work --from-file |
读 ~/.codex/auth.json |
cc-switch codex add work --from-file <path> |
读指定文件 |
🛠 Error Messages
错误提示按来源分支,避免误导:
- 裸
--from-file(默认路径缺失)→Default Claude config not found at: ... Run \claude` once...` - 显式路径不存在 →
Config file not found: <path>(不会再让用户误以为要claude login)
📦 Other
- crate 描述与 keywords 更新,反映对 codex 的支持。
- CLAUDE.md / README.md / README_EN.md / docs/codex.md / docs/codex_EN.md 示例全部按新语义改写。
New Features
- feat(codex): codex add --from-file accepts optional path (
f5140f4) - feat(cli): claude --from-file accepts optional path, alias required (
0681e7b) - feat(codex): add default_codex_auth_path read-only helper (
68b5632)
Other Changes
- docs(codex): localize inline comments in Chinese codex doc (
e9a261d) - docs: --from-file accepts optional path; default = tool's settings file (
e030ed9) - test(integration): lock in settings.json shape parsed by --from-file (
0123fe6) - fix(cli): branch from-file not-found message by source (
87df8a9) - refactor(claude): require explicit alias when using --from-file (
f9a1ae2) - refactor(claude): drop filename-as-alias derivation from from-file (
4fcb728) - test(codex): replace vacuous no-mkdir test with deterministic check (
6778b45)
Full Changelog: v0.1.27...v0.1.28