Fix completion scripts: remove remaining maxclaw references
- Rewrote langcode.bash with full unified CLI support - Rewrote langcode.zsh with full unified CLI support - All commands: chat, server, tui, config, analytics, dashboard, version - Config subcommands: list, add, remove, use, active, test, export, import, search
This commit is contained in:
1 parent
eda22811ce
commit
55a31278a8
2 files changed
+128
-58
No files matched your search
+73
-45
@@ -1,8 +1,8 @@
|
||||
#compdef config_cli.py
|
||||
# Zsh completion for MaxClaw Agent CLI
|
||||
#compdef langcode
|
||||
# Zsh completion for LangCode Agent CLI
|
||||
|
||||
_maxclaw() {
|
||||
local -a commands
|
||||
_langcode() {
|
||||
local -a commands config_subcommands
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
@@ -13,39 +13,65 @@ _maxclaw() {
|
||||
case $state in
|
||||
command)
|
||||
commands=(
|
||||
'list:List all configurations'
|
||||
'search:Search configurations'
|
||||
'add:Add a new configuration'
|
||||
'remove:Remove a configuration'
|
||||
'set-active:Set active configuration'
|
||||
'active:Show active configuration'
|
||||
'test:Test connection to a configuration'
|
||||
'export:Export configurations to JSON/YAML'
|
||||
'import:Import configurations from JSON/YAML'
|
||||
'help:Show help'
|
||||
'chat:Avvia l'\''agent in modalità chat'
|
||||
'server:Avvia il web server'
|
||||
'tui:Apre TUI per gestione configurazioni'
|
||||
'config:Gestione configurazioni'
|
||||
'analytics:Mostra analytics'
|
||||
'dashboard:Mostra dashboard performance'
|
||||
'version:Mostra versione'
|
||||
)
|
||||
_describe -t commands 'MaxClaw commands' commands
|
||||
_describe -t commands 'LangCode commands' commands
|
||||
;;
|
||||
args)
|
||||
case ${line[1]} in
|
||||
search)
|
||||
_message 'search term'
|
||||
config)
|
||||
config_subcommands=(
|
||||
'list:Lista configurazioni'
|
||||
'add:Aggiungi configurazione'
|
||||
'remove:Rimuovi configurazione'
|
||||
'use:Attiva configurazione'
|
||||
'active:Mostra configurazione attiva'
|
||||
'test:Testa connessione configurazione'
|
||||
'export:Esporta configurazioni'
|
||||
'import:Importa configurazioni'
|
||||
'search:Cerca configurazioni'
|
||||
)
|
||||
_describe -t config_commands 'config commands' config_subcommands
|
||||
;;
|
||||
add)
|
||||
server)
|
||||
_arguments \
|
||||
'--non-interactive[Non-interactive mode]' \
|
||||
'--name[Configuration name]:name' \
|
||||
'--provider[Provider]:provider:(openai ollama openrouter)' \
|
||||
'--model[Model name]:model' \
|
||||
'--api-key[API key]:api_key' \
|
||||
'--base-url[Base URL]:base_url' \
|
||||
'--set-active[Set as active configuration]'
|
||||
'--port[Porta del server]:port:(8000 3000 8080 5000)' \
|
||||
'--host[Host del server]:host'
|
||||
;;
|
||||
remove|set-active|test)
|
||||
# Try to get configuration names
|
||||
local -a configs
|
||||
if (( $+commands[python3] )); then
|
||||
configs=(${(f)"$(python3 -c "
|
||||
analytics)
|
||||
_arguments \
|
||||
'--report[Genera report completo]' \
|
||||
'--clear[Cancella dati analytics]'
|
||||
;;
|
||||
dashboard)
|
||||
_arguments \
|
||||
'--clear[Cancella dati performance]'
|
||||
;;
|
||||
config)
|
||||
case ${line[2]} in
|
||||
search)
|
||||
_message 'termine di ricerca'
|
||||
;;
|
||||
add)
|
||||
_arguments \
|
||||
'--name[Nome configurazione]:name' \
|
||||
'--provider[Provider]:provider:(openai ollama openrouter anthropic google)' \
|
||||
'--model[Modello]:model' \
|
||||
'--api-key[API key]:api_key' \
|
||||
'--base-url[Base URL]:base_url' \
|
||||
'--activate[Attiva dopo la creazione]'
|
||||
;;
|
||||
remove|use|test)
|
||||
# Try to get configuration names
|
||||
local -a configs
|
||||
if (( $+commands[python3] )); then
|
||||
configs=(${(f)"$(python3 -c "
|
||||
import sys
|
||||
sys.path.insert(0, '.')
|
||||
try:
|
||||
@@ -56,24 +82,26 @@ try:
|
||||
except:
|
||||
pass
|
||||
" 2>/dev/null)"})
|
||||
fi
|
||||
if (( ${#configs} )); then
|
||||
_describe -t configurations 'configurations' configs
|
||||
else
|
||||
_message 'configuration name'
|
||||
fi
|
||||
;;
|
||||
export)
|
||||
_arguments \
|
||||
'--format[Export format]:format:(json yaml)' \
|
||||
'--output[Output filename]:filename'
|
||||
;;
|
||||
import)
|
||||
_files -g '*.json *.yaml *.yml'
|
||||
fi
|
||||
if (( ${#configs} )); then
|
||||
_describe -t configurations 'configurazioni' configs
|
||||
else
|
||||
_message 'nome configurazione'
|
||||
fi
|
||||
;;
|
||||
export)
|
||||
_arguments \
|
||||
'--format[Formato export]:format:(json yaml)' \
|
||||
'--output[File output]:filename'
|
||||
;;
|
||||
import)
|
||||
_files -g '*.json *.yaml *.yml'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_maxclaw "$@"
|
||||
_langcode "$@"
|
||||
Reference in new issue
Block a user