feat(cliproxy): refactor config loading and enhance base settings support

- Introduce `BaseConfigLoader` for centralized configuration management
- Add `base-agy.settings.json` configuration
- Refactor `ConfigGenerator` to utilize new loading patterns
- Update help command with improved documentation
- Clean up lint violations file
- Enhance postinstall script
This commit is contained in:
kaitranntt committed 2025-11-28 20:43:11 -05:00
1 parent 50d32ca7da
commit e54d401656
16 files changed
+262 -111

No files matched your search

+12 -1
View File
@@ -121,6 +121,8 @@ function createConfigFiles() {
// This gives users control over when to modify their Claude configuration
// Create config.json if missing
// NOTE: gemini/codex profiles NOT included - they are added on-demand when user
// runs `ccs gemini` or `ccs codex` for first time (requires OAuth auth first)
const configPath = path.join(ccsDir, 'config.json');
if (!fs.existsSync(configPath)) {
const config = {
@@ -145,12 +147,17 @@ function createConfigFiles() {
if (!config.profiles) {
config.profiles = {};
}
let configUpdated = false;
if (!config.profiles.glmt) {
config.profiles.glmt = '~/.ccs/glmt.settings.json';
configUpdated = true;
}
// NOTE: gemini/codex profiles added on-demand, not during migration
if (configUpdated) {
const tmpPath = `${configPath}.tmp`;
fs.writeFileSync(tmpPath, JSON.stringify(config, null, 2) + '\n', 'utf8');
fs.renameSync(tmpPath, configPath);
console.log('[OK] Updated config with GLMT profile');
console.log('[OK] Updated config with glmt profile');
} else {
console.log('[OK] Config exists: ~/.ccs/config.json (preserved)');
}
@@ -299,6 +306,10 @@ function createConfigFiles() {
console.log('[OK] Kimi profile exists: ~/.ccs/kimi.settings.json (preserved)');
}
// NOTE: gemini.settings.json and codex.settings.json are NOT created during install
// They are created on-demand when user runs `ccs gemini` or `ccs codex` for the first time
// This prevents confusion - users need to run `--auth` first anyway
// Migrate existing Kimi configs to remove deprecated model fields (v4.1.2)
// Kimi API changed - model fields now cause 401 errors
if (fs.existsSync(kimiSettingsPath)) {