From a98f4a54278f9f8d9e4b30ccccc900514c08b32f Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Wed, 11 Feb 2026 11:02:34 +0700 Subject: [PATCH] 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" --- scripts/completion/ccs.fish | 1 + scripts/completion/ccs.ps1 | 2 +- scripts/completion/ccs.zsh | 4 ++++ src/commands/env-command.ts | 11 ++++++++++- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/scripts/completion/ccs.fish b/scripts/completion/ccs.fish index 5f81c5d0..ea58c2d7 100644 --- a/scripts/completion/ccs.fish +++ b/scripts/completion/ccs.fish @@ -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' diff --git a/scripts/completion/ccs.ps1 b/scripts/completion/ccs.ps1 index daad20d3..500cf988 100644 --- a/scripts/completion/ccs.ps1 +++ b/scripts/completion/ccs.ps1 @@ -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') diff --git a/scripts/completion/ccs.zsh b/scripts/completion/ccs.zsh index 3ae11d32..fb4f9f36 100644 --- a/scripts/completion/ccs.zsh +++ b/scripts/completion/ccs.zsh @@ -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 diff --git a/src/commands/env-command.ts b/src/commands/env-command.ts index e461c32e..d652f1b0 100644 --- a/src/commands/env-command.ts +++ b/src/commands/env-command.ts @@ -111,7 +111,16 @@ function resolveSettingsProfile(profileName: string): Record | 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;