Skip to content

Commit 08680b4

Browse files
zhujian0805claude
andcommitted
feat: update shell completion to include all commands and subcommands
- Add plugin and agent commands to bash/zsh completion scripts - Include all subcommands for plugin and agent management - Update completion logic to handle new command structures - Ensure recursive completion for all CLI subcommands 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8a4a36f commit 08680b4

File tree

1 file changed

+141
-4
lines changed

1 file changed

+141
-4
lines changed

code_assistant_manager/cli/completion_commands.py

Lines changed: 141 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def _generate_bash_completion() -> str:
8282
cword=$COMP_CWORD
8383
8484
# Main commands (visible and hidden aliases)
85-
commands="launch l config cf mcp m prompt p skill s upgrade u install i uninstall un doctor d version v completion comp c --help --version --config --endpoints --debug -d"
85+
commands="launch l config cf mcp m prompt p skill s plugin pl agent ag upgrade u install i uninstall un doctor d version v completion comp c --help --version --config --endpoints --debug -d"
8686
8787
# Tool names for launch command
8888
tools="claude codex copilot gemini droid qwen codebuddy iflow qodercli zed neovate crush cursor-agent"
@@ -96,8 +96,11 @@ def _generate_bash_completion() -> str:
9696
# Prompt subcommands
9797
prompt_commands="list view create update delete sync import-live show-live import export unsync status"
9898
99-
# Skill subcommands
100-
skill_commands="list fetch view create update delete install uninstall repos add-repo remove-repo import export installed uninstall-all"
99+
# Plugin subcommands
100+
plugin_commands="marketplace list repos add-repo remove-repo install uninstall enable disable validate browse view status"
101+
102+
# Agent subcommands
103+
agent_commands="list fetch view install uninstall repos add-repo remove-repo installed uninstall-all"
101104
102105
# Global flags
103106
global_flags="--help --version --config --endpoints --debug -d"
@@ -144,6 +147,14 @@ def _generate_bash_completion() -> str:
144147
COMPREPLY=( $(compgen -W "${skill_commands}" -- ${cur}) )
145148
return 0
146149
;;
150+
plugin|pl)
151+
COMPREPLY=( $(compgen -W "${plugin_commands}" -- ${cur}) )
152+
return 0
153+
;;
154+
agent|ag)
155+
COMPREPLY=( $(compgen -W "${agent_commands}" -- ${cur}) )
156+
return 0
157+
;;
147158
upgrade|u)
148159
COMPREPLY=( $(compgen -W "all ${tools} mcp --verbose -v" -- ${cur}) )
149160
return 0
@@ -338,6 +349,50 @@ def _generate_bash_completion() -> str:
338349
;;
339350
esac
340351
;;
352+
plugin|pl)
353+
case "${COMP_WORDS[2]}" in
354+
marketplace)
355+
COMPREPLY=( $(compgen -W "add list remove rm update install uninstall --help" -- ${cur}) )
356+
return 0
357+
;;
358+
list|repos)
359+
COMPREPLY=( $(compgen -W "--help" -- ${cur}) )
360+
return 0
361+
;;
362+
add-repo|remove-repo)
363+
COMPREPLY=( $(compgen -W "--owner -o --repo -r --help" -- ${cur}) )
364+
return 0
365+
;;
366+
install|uninstall|enable|disable|validate)
367+
COMPREPLY=( $(compgen -W "--app -a --help" -- ${cur}) )
368+
return 0
369+
;;
370+
browse|view|status)
371+
COMPREPLY=( $(compgen -W "--help" -- ${cur}) )
372+
return 0
373+
;;
374+
esac
375+
;;
376+
agent|ag)
377+
case "${COMP_WORDS[2]}" in
378+
list|installed)
379+
COMPREPLY=( $(compgen -W "--app -a --help" -- ${cur}) )
380+
return 0
381+
;;
382+
fetch|repos|view)
383+
COMPREPLY=( $(compgen -W "--help" -- ${cur}) )
384+
return 0
385+
;;
386+
install|uninstall|uninstall-all)
387+
COMPREPLY=( $(compgen -W "--app -a --help" -- ${cur}) )
388+
return 0
389+
;;
390+
add-repo|remove-repo)
391+
COMPREPLY=( $(compgen -W "--owner -o --name -n --help" -- ${cur}) )
392+
return 0
393+
;;
394+
esac
395+
;;
341396
upgrade|u|install|i)
342397
case "${COMP_WORDS[2]}" in
343398
all|claude|codex|copilot|gemini|droid|qwen|codebuddy|iflow|qodercli|zed|neovate|crush|cursor-agent|mcp)
@@ -385,7 +440,7 @@ def _generate_zsh_completion() -> str:
385440
#compdef code-assistant-manager cam
386441
387442
_code_assistant_manager() {
388-
local -a commands tools mcp_server_commands config_commands prompt_commands skill_commands global_flags
443+
local -a commands tools mcp_server_commands config_commands prompt_commands skill_commands plugin_commands agent_commands global_flags
389444
local context state line
390445
391446
commands=(
@@ -399,6 +454,10 @@ def _generate_zsh_completion() -> str:
399454
'p:Alias for prompt'
400455
'skill:Skill management commands'
401456
's:Alias for skill'
457+
'plugin:Plugin management commands'
458+
'pl:Alias for plugin'
459+
'agent:Agent management commands'
460+
'ag:Alias for agent'
402461
'upgrade:Upgrade CLI tools'
403462
'u:Alias for upgrade'
404463
'install:Install CLI tools'
@@ -479,6 +538,35 @@ def _generate_zsh_completion() -> str:
479538
'uninstall-all:Uninstall all skills from an editor'
480539
)
481540
541+
plugin_commands=(
542+
'marketplace:Manage marketplaces'
543+
'list:List all plugins'
544+
'repos:List plugin repositories'
545+
'add-repo:Add a plugin repository'
546+
'remove-repo:Remove a plugin repository'
547+
'install:Install a plugin'
548+
'uninstall:Uninstall a plugin'
549+
'enable:Enable a plugin'
550+
'disable:Disable a plugin'
551+
'validate:Validate a plugin'
552+
'browse:Browse marketplace'
553+
'view:View plugin details'
554+
'status:Show plugin status'
555+
)
556+
557+
agent_commands=(
558+
'list:List all agents'
559+
'fetch:Fetch agents from repositories'
560+
'view:View a specific agent'
561+
'install:Install an agent'
562+
'uninstall:Uninstall an agent'
563+
'repos:List agent repositories'
564+
'add-repo:Add an agent repository'
565+
'remove-repo:Remove an agent repository'
566+
'installed:List installed agents'
567+
'uninstall-all:Uninstall all agents'
568+
)
569+
482570
global_flags=(
483571
'--help[Show help]'
484572
'--version[Show version]'
@@ -611,6 +699,55 @@ def _generate_zsh_completion() -> str:
611699
esac
612700
fi
613701
;;
702+
plugin|pl)
703+
if (( CURRENT == 2 )); then
704+
_describe -t plugin_commands 'plugin command' plugin_commands
705+
else
706+
case $words[2] in
707+
marketplace)
708+
_values 'option' 'add[list remove rm update install uninstall]' '--help[Show help]'
709+
;;
710+
list|repos)
711+
_values 'option' '--help[Show help]'
712+
;;
713+
add-repo|remove-repo)
714+
_values 'option' '--owner[Repository owner]' '--repo[Repository name]' '--help[Show help]'
715+
;;
716+
install|uninstall|enable|disable|validate)
717+
_values 'option' '--app[Application type]:app:(claude codebuddy)' '--help[Show help]'
718+
;;
719+
browse|view|status)
720+
_values 'option' '--help[Show help]'
721+
;;
722+
*)
723+
_values 'option' '--help[Show help]'
724+
;;
725+
esac
726+
fi
727+
;;
728+
agent|ag)
729+
if (( CURRENT == 2 )); then
730+
_describe -t agent_commands 'agent command' agent_commands
731+
else
732+
case $words[2] in
733+
list|installed)
734+
_values 'option' '--app[Application type]:app:(claude codex gemini droid qwen codebuddy)' '--help[Show help]'
735+
;;
736+
fetch|repos|view)
737+
_values 'option' '--help[Show help]'
738+
;;
739+
install|uninstall|uninstall-all)
740+
_values 'option' '--app[Application type]:app:(claude codex gemini droid qwen codebuddy)' '--help[Show help]'
741+
;;
742+
add-repo|remove-repo)
743+
_values 'option' '--owner[Repository owner]' '--name[Repository name]' '--help[Show help]'
744+
;;
745+
*)
746+
_values 'option' '--help[Show help]'
747+
;;
748+
esac
749+
fi
750+
;;
614751
upgrade|u|install|i)
615752
if (( CURRENT == 2 )); then
616753
local -a upgrade_targets

0 commit comments

Comments
 (0)