Some checks failed
CI/CD / lint (pull_request) Failing after 11s
CI/CD / test (pull_request) Failing after 11s
CI/CD / typecheck (pull_request) Failing after 22s
CI/CD / build (pull_request) Has been skipped
CI/CD / publish-rpm (pull_request) Has been skipped
CI/CD / publish-deb (pull_request) Has been skipped
Add `labctl provision register` to re-add machines to installed state without reprovisioning (e.g. after bastion state loss). Full stack: protocol type, bastion API + WS handler, labd route, CLI command. Add `labctl app k3s kubeconfig <target>` to fetch kubeconfig from a k3s node via SSH, rewrite server URL, and merge into ~/.kube/config. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
134 lines
4.4 KiB
Bash
134 lines
4.4 KiB
Bash
# labctl bash completions -- auto-generated by scripts/generate-completions.ts
|
|
# DO NOT EDIT MANUALLY -- run: pnpm completions:generate
|
|
|
|
_labctl() {
|
|
local cur prev words cword
|
|
_init_completion || return
|
|
|
|
local top_commands="version init provision config login doctor app roles"
|
|
|
|
# Extract the subcommand chain (skip options and their values)
|
|
local -a subcmd_chain=()
|
|
local i skip_next=false
|
|
for ((i=1; i < cword; i++)); do
|
|
if $skip_next; then skip_next=false; continue; fi
|
|
case "${words[i]}" in
|
|
-*) ;; # skip options
|
|
*) subcmd_chain+=("${words[i]}") ;;
|
|
esac
|
|
done
|
|
|
|
local chain_len=${#subcmd_chain[@]}
|
|
local chain_str="${subcmd_chain[*]}"
|
|
|
|
case "$chain_str" in
|
|
"init bastion standalone start")
|
|
COMPREPLY=($(compgen -W "--port --dir --domain --dhcp-mode --fedora --arch --timezone --locale --skip-dnsmasq --skip-artifacts --foreground -h --help" -- "$cur"))
|
|
return ;;
|
|
"init bastion standalone stop")
|
|
COMPREPLY=($(compgen -W "--dir -h --help" -- "$cur"))
|
|
return ;;
|
|
"init bastion standalone status")
|
|
COMPREPLY=($(compgen -W "-h --help" -- "$cur"))
|
|
return ;;
|
|
"init bastion standalone")
|
|
COMPREPLY=($(compgen -W "start stop status -h --help" -- "$cur"))
|
|
return ;;
|
|
"app labcontroller deploy")
|
|
COMPREPLY=($(compgen -W "--user --crdb-replicas -h --help" -- "$cur"))
|
|
return ;;
|
|
"app labcontroller status")
|
|
COMPREPLY=($(compgen -W "--user -h --help" -- "$cur"))
|
|
return ;;
|
|
"app k3s install")
|
|
COMPREPLY=($(compgen -W "--role --user --k3s-server --k3s-token -h --help" -- "$cur"))
|
|
return ;;
|
|
"app k3s health")
|
|
COMPREPLY=($(compgen -W "--user -h --help" -- "$cur"))
|
|
return ;;
|
|
"app k3s list")
|
|
COMPREPLY=($(compgen -W "--user -h --help" -- "$cur"))
|
|
return ;;
|
|
"app k3s kubeconfig")
|
|
COMPREPLY=($(compgen -W "--user --context --print -h --help" -- "$cur"))
|
|
return ;;
|
|
"init bastion")
|
|
COMPREPLY=($(compgen -W "standalone -h --help" -- "$cur"))
|
|
return ;;
|
|
"provision list")
|
|
COMPREPLY=($(compgen -W "-h --help" -- "$cur"))
|
|
return ;;
|
|
"provision install")
|
|
COMPREPLY=($(compgen -W "--role --os --disk -h --help" -- "$cur"))
|
|
return ;;
|
|
"provision reprovision")
|
|
COMPREPLY=($(compgen -W "--role --os --disk -h --help" -- "$cur"))
|
|
return ;;
|
|
"provision debug")
|
|
COMPREPLY=($(compgen -W "--pxe-boot -h --help" -- "$cur"))
|
|
return ;;
|
|
"provision forget")
|
|
COMPREPLY=($(compgen -W "-h --help" -- "$cur"))
|
|
return ;;
|
|
"provision register")
|
|
COMPREPLY=($(compgen -W "--role --ip -h --help" -- "$cur"))
|
|
return ;;
|
|
"provision logs")
|
|
COMPREPLY=($(compgen -W "-f --follow -h --help" -- "$cur"))
|
|
return ;;
|
|
"provision makeiso")
|
|
COMPREPLY=($(compgen -W "--arch --local --out -h --help" -- "$cur"))
|
|
return ;;
|
|
"config list")
|
|
COMPREPLY=($(compgen -W "-h --help" -- "$cur"))
|
|
return ;;
|
|
"config get")
|
|
COMPREPLY=($(compgen -W "-h --help" -- "$cur"))
|
|
return ;;
|
|
"config set")
|
|
COMPREPLY=($(compgen -W "-h --help" -- "$cur"))
|
|
return ;;
|
|
"config path")
|
|
COMPREPLY=($(compgen -W "-h --help" -- "$cur"))
|
|
return ;;
|
|
"app labcontroller")
|
|
COMPREPLY=($(compgen -W "deploy status -h --help" -- "$cur"))
|
|
return ;;
|
|
"app k3s")
|
|
COMPREPLY=($(compgen -W "install health list kubeconfig -h --help" -- "$cur"))
|
|
return ;;
|
|
"version")
|
|
COMPREPLY=($(compgen -W "-h --help" -- "$cur"))
|
|
return ;;
|
|
"init")
|
|
COMPREPLY=($(compgen -W "bastion -h --help" -- "$cur"))
|
|
return ;;
|
|
"provision")
|
|
COMPREPLY=($(compgen -W "list install reprovision debug forget register logs makeiso -h --help" -- "$cur"))
|
|
return ;;
|
|
"config")
|
|
COMPREPLY=($(compgen -W "list get set path -h --help" -- "$cur"))
|
|
return ;;
|
|
"login")
|
|
COMPREPLY=($(compgen -W "--server -h --help" -- "$cur"))
|
|
return ;;
|
|
"doctor")
|
|
COMPREPLY=($(compgen -W "--json -h --help" -- "$cur"))
|
|
return ;;
|
|
"app")
|
|
COMPREPLY=($(compgen -W "labcontroller k3s -h --help" -- "$cur"))
|
|
return ;;
|
|
"roles")
|
|
COMPREPLY=($(compgen -W "-h --help" -- "$cur"))
|
|
return ;;
|
|
"")
|
|
COMPREPLY=($(compgen -W "$top_commands -h --help -v --version" -- "$cur"))
|
|
return ;;
|
|
*)
|
|
COMPREPLY=($(compgen -W "-h --help" -- "$cur"))
|
|
return ;;
|
|
esac
|
|
}
|
|
|
|
complete -F _labctl labctl
|