feat: add base configuration support#1
Merged
Conversation
- Add base.json for shared settings across providers - Merge base config with provider-specific config on switch - New commands: cc-use base, cc-use base show, cc-use base rm - Show merged config in 'cc-use show' when base exists - Display base status in 'cc-use ls'
- 11 tests covering merge_json function - Tests for simple/nested/deep object merging - Tests for edge cases (empty, null, primitive override) - Tests for realistic Claude settings scenario - Tests for path functions
- lint.yml: triggered on PR to main/develop - cargo fmt --check for code formatting - cargo clippy -- -D warnings for linting - build.yml: triggered on push to main - cargo build --release - cargo test Also apply cargo fmt to all source files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
功能说明
实现 base 配置功能,支持配置继承和合并。
使用方式
工作原理
~/.cc-use/base.json存放公共配置(如 API Key、权限等)qwen.json)只写差异化内容示例
变更文件
src/config.rs- 添加 base 配置路径、加载、合并逻辑src/commands/base.rs- 新增 base 子命令处理src/cli.rs- 添加 Base 子命令定义src/main.rs- 处理 Base 命令路由src/commands/show.rs- 显示合并后的配置src/commands/list.rs- 显示 base 配置状态README.md- 更新文档