Switch the active kubeconfig context to the named cluster.
This command accepts a cluster name and automatically resolves it to the
correct kubeconfig context by checking all supported distribution prefixes
(kind-, k3d-, k3k-, admin@, vcluster-docker_, kwok-). The k3k- prefix matches
nested K3s clusters on the Kubernetes provider, and kwok- matches KWOK clusters.
If multiple distributions have contexts for the same cluster name, the
command returns an error listing the matching contexts.
The kubeconfig is resolved in the following priority order:
1. From KUBECONFIG environment variable
2. From ksail.yaml config file (if present)
3. Defaults to ~/.kube/config
When called without arguments, an interactive picker is shown
to select from available clusters. Recently-switched clusters
appear at the top of the list (up to the last 5), followed by
the remaining clusters in alphabetical order. The history is
persisted to ~/.ksail/switch-history.json.
In the picker, press '/' to enter filter mode and type to narrow
the list by keyword (case-insensitive). Press Esc to exit filter mode.
# Switch to a Vanilla (Kind) cluster named "dev"
# Switch to a cluster named "staging"
ksail cluster switch staging
# Select a cluster interactively (recent clusters shown first)
ksail cluster switch [cluster-name] [flags]
--benchmark Show per-activity benchmark output
--config string Path to config file (default: ksail.yaml found via directory traversal)