fix(env): sync CLIProxy profiles across all shell completions and improve error messages

- Add profile name completions to fish env subcommand
- Add iflow, kiro, ghcp, claude to zsh proxy_profiles and PS1 cliproxyProfiles
- Distinguish non-API profile type error from "profile not found"
This commit is contained in:
Tam Nhu Tran
2026-02-11 11:02:34 +07:00
parent 6d9351dcbc
commit a98f4a5427
4 changed files with 16 additions and 2 deletions
+1
View File
@@ -173,6 +173,7 @@ complete -c ccs -n '__fish_seen_subcommand_from update' -s h -l help -d 'Show he
complete -c ccs -n '__fish_seen_subcommand_from doctor' -s h -l help -d 'Show help for doctor command'
# env command completions
complete -c ccs -n '__fish_seen_subcommand_from env; and not __fish_seen_argument -l format -l shell' -a 'gemini codex agy qwen iflow kiro ghcp claude' -d '[proxy] CLIProxy profile'
complete -c ccs -n '__fish_seen_subcommand_from env' -l format -d 'Output format'
complete -c ccs -n '__fish_seen_subcommand_from env; and __fish_seen_argument -l format' -a 'openai anthropic raw' -d 'Format'
complete -c ccs -n '__fish_seen_subcommand_from env' -l shell -d 'Shell syntax'
+1 -1
View File
@@ -13,7 +13,7 @@ Register-ArgumentCompleter -CommandName ccs -ScriptBlock {
param($commandName, $wordToComplete, $commandAst, $fakeBoundParameters)
$commands = @('auth', 'api', 'cliproxy', 'doctor', 'env', 'sync', 'update', '--help', '--version', '--shell-completion', '-h', '-v', '-sc')
$cliproxyProfiles = @('gemini', 'codex', 'agy', 'qwen')
$cliproxyProfiles = @('gemini', 'codex', 'agy', 'qwen', 'iflow', 'kiro', 'ghcp', 'claude')
$authCommands = @('create', 'list', 'show', 'remove', 'default', '--help', '-h')
$apiCommands = @('create', 'list', 'remove', '--help', '-h')
$cliproxyCommands = @('create', 'list', 'remove', '--install', '--latest', '--help', '-h')
+4
View File
@@ -45,6 +45,10 @@ _ccs() {
'codex:OpenAI Codex (OAuth)'
'agy:Antigravity (OAuth)'
'qwen:Qwen Code (OAuth)'
'iflow:iFlow (OAuth)'
'kiro:Kiro (OAuth)'
'ghcp:GitHub Copilot (OAuth)'
'claude:Claude Direct (OAuth)'
)
# Define known settings profiles with descriptions
+10 -1
View File
@@ -111,7 +111,16 @@ function resolveSettingsProfile(profileName: string): Record<string, string> | n
const profileConfig = config.profiles?.[profileName];
if (!profileConfig) return null;
if (profileConfig.type === 'api' && profileConfig.settings) {
if (profileConfig.type !== 'api') {
console.error(
fail(
`Profile '${profileName}' is type '${profileConfig.type}', not a settings-based API profile.`
)
);
process.exit(1);
}
if (profileConfig.settings) {
const settingsPath = expandPath(profileConfig.settings);
const env = loadSettingsFromFile(settingsPath);
if (Object.keys(env).length > 0) return env;