mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-13 20:14:34 +00:00
Merge pull request #101 from kaitranntt/dev
fix(auth): Account profile unified config fixes
This commit is contained in:
3 files changed
+18
-4
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@kaitranntt/ccs",
|
||||
"version": "5.19.0",
|
||||
"version": "5.19.0-dev.1",
|
||||
"description": "Claude Code Switch - Instant profile switching between Claude Sonnet 4.5 and GLM 4.6",
|
||||
"keywords": [
|
||||
"cli",
|
||||
|
||||
@@ -16,6 +16,7 @@ import { spawn, ChildProcess } from 'child_process';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import ProfileRegistry from './profile-registry';
|
||||
import { ProfileMetadata } from '../types';
|
||||
import { InstanceManager } from '../management/instance-manager';
|
||||
import {
|
||||
initUI,
|
||||
@@ -285,8 +286,21 @@ class AuthCommands {
|
||||
const { verbose, json } = this.parseArgs(args);
|
||||
|
||||
try {
|
||||
const profiles = this.registry.getAllProfiles();
|
||||
const defaultProfile = this.registry.getDefaultProfile();
|
||||
// Get profiles from both legacy (profiles.json) and unified config (config.yaml)
|
||||
const legacyProfiles = this.registry.getAllProfiles();
|
||||
const unifiedAccounts = this.registry.getAllAccountsUnified();
|
||||
|
||||
// Merge profiles: unified config takes precedence
|
||||
const profiles: Record<string, ProfileMetadata> = { ...legacyProfiles };
|
||||
for (const [name, account] of Object.entries(unifiedAccounts)) {
|
||||
profiles[name] = {
|
||||
type: 'account',
|
||||
created: account.created,
|
||||
last_used: account.last_used,
|
||||
};
|
||||
}
|
||||
|
||||
const defaultProfile = this.registry.getDefaultUnified() ?? this.registry.getDefaultProfile();
|
||||
const profileNames = Object.keys(profiles);
|
||||
|
||||
// JSON output mode
|
||||
|
||||
Reference in new issue
Block a user