Context Commands¶
The context command allows you to view, switch, and manage Kubernetes contexts. These commands work without requiring cluster access, as they only interact with your kubeconfig file.
Usage¶
Available Commands¶
Show Current Context¶
Shows details about the current context including: - Context name - Cluster - User - Namespace (if set)List Contexts¶
Lists all available contexts with their details. The current context is marked with an asterisk (). Output includes: - Context name - Cluster name - User - Namespace (if set) - Active status ()Switch Context¶
Direct switch:
Switch to a specific context directly.Interactive switch:
Opens an interactive menu to select and switch contexts. Features: - Shows current context with "(current)" suffix - Uses colored output for better visibility - Shows 10 contexts at a time - Uses emoji indicators for selectionInteractive Mode Features¶
The interactive mode provides: 1. List of all available contexts 2. Current context highlighted 3. Arrow key navigation 4. Enter to select context
Example output:
Output¶
The output includes: - Context name - Cluster name - User - Namespace (if set) - Active status (*)
Example output when showing current context:
Related Commands¶
- Namespace: Manage namespace selection