⎈ v1.5.0 · AI-Powered

Switch Kubernetes
contexts instantly

A blazing-fast interactive TUI for navigating Kubernetes contexts. Fuzzy search, pins, aliases, groups, history — now with AI natural language switching. Available for macOS and Linux.

Install with Homebrew View on GitHub →
ksw — interactive context switcher
current eks-payments-dev
 
──────────────────────────────────────────
 
42/42 ↑↓ navigate · enter select · ctrl+p pin
ksw ai — natural language context switching

Quick Start

Install in seconds

Available via Homebrew. No dependencies to manage manually.

1 brew tap YonierGomez/ksw
2 brew install ksw
3 ksw

To upgrade: brew upgrade ksw

Or install with a single command (macOS & Linux):

curl -sL https://raw.githubusercontent.com/YonierGomez/ksw/main/install.sh | bash

Detects your OS and architecture automatically.  ·  All releases →

Why ksw?

Everything you need

Available for macOS and Linux (amd64 & arm64). Designed for engineers who manage dozens of Kubernetes clusters daily.

🔍

Fuzzy Search

Type any part of a context name and instantly filter results with intelligent fuzzy matching and scoring.

Short-name Switching

Use ksw payments-dev instead of the full ARN. ksw resolves it automatically.

🏷️

Aliases

Create memorable shortcuts for your most-used contexts. ksw @prod gets you there instantly.

📌

Pin Favorites

Pin your most-used contexts to always appear at the top. Use Ctrl+P in the TUI to pin/unpin instantly.

🗂️

Groups

Organize contexts into named groups. ksw group use payments opens the TUI filtered to only your payments contexts.

⏮️

Previous Context

ksw - switches back to the last context instantly — like cd - in bash.

🕐

History

ksw history shows your last 10 contexts. Jump to any entry with ksw history 3.

🟢

Active Context Highlight

Your current context is always highlighted in green in the list, so you never lose track of where you are.

📜

Smart Scroll

Navigate hundreds of contexts with keyboard shortcuts. The cursor always stays visible on screen.

🛠️

Non-interactive Mode

Use ksw -l to list contexts in scripts and CI pipelines without launching the TUI.

🤖 AI-Powered

Your clusters, your language

Stop memorizing ARNs and commands. Just tell ksw what you need in plain language.

🧠

Natural Language

Switch contexts, create groups, pin favorites, list aliases — describe it in your own words and the AI executes it. No syntax to memorize.

💬

Conversational Memory

The AI remembers your last 10 interactions. Say "go back to the previous one" or "same but in qa" and it understands the context.

Multi-Action

Execute multiple tasks in a single prompt. "List my pins and groups" runs both commands and returns combined results.

🔌

Multi-Provider

Works with OpenAI, Claude (Anthropic), Gemini (Google) and AWS Bedrock. Use the model you already have access to.

📊

Smart Formatting

Ask for tables, summaries, or any custom format. The AI builds the response from your actual state — not canned output.

Interactive Chat

ksw ai chat opens a full-screen conversational TUI. Multi-turn dialogue with your clusters — type, get answers, keep going.

🔒

Full State Awareness

The AI knows your current context, all groups, pins, aliases and history. It gives personalized, accurate answers every time.

☁️

EKS Kubeconfig Sync

ksw eks kubeconfig reads your AWS profiles, discovers EKS clusters in parallel, and adds missing ones to kubeconfig automatically. Filter by profile with --profile.

How to use it

From interactive navigation to AI natural language, ksw fits every workflow.

🤖 AI — natural language
$ ksw ai "switch to payments dev"
✔ Switched to arn:.../eks-payments-dev
$ ksw ai "pin orders dev and create a group called backend"
✔ Pinned ★ arn:.../eks-orders-dev
✔ Group 'fintech' created (4 contexts)
$ ksw ai "go back to the previous one"
✔ Switched to arn:.../eks-billing-qa
$ ksw ai "list my pins and groups as a table"
🤖 AI builds a formatted table from your current state
$ ksw ai chat # Interactive conversational mode (multi-turn)
$ ksw ai config # Setup wizard: provider, model, credentials
Interactive mode
$ ksw
# Opens the interactive TUI
# Type to fuzzy-search contexts
# ↑↓ navigate · Ctrl+P pin · Ctrl+H short
Direct switch by short name
$ ksw payments-dev
✔ Switched to arn:aws:eks:.../eks-payments-dev
 
$ ksw payments
✗ Ambiguous: eks-payments-dev, eks-payments-qa...
Previous context
$ ksw payments-dev
✔ Switched to arn:.../eks-payments-dev
$ ksw -
✔ Switched to arn:.../eks-payments-qa
$ ksw -
✔ Switched to arn:.../eks-payments-dev
History
$ ksw history
1 eks-payments-dev ●
2 eks-payments-qa
3 eks-orders-pdn
$ ksw history 3
✔ Switched to arn:.../eks-orders-pdn
Aliases
$ ksw alias prod eks-payments-dev
✔ Alias @prod → arn:.../eks-payments-dev
$ ksw @prod
✔ Switched to arn:.../eks-payments-dev @prod
Pin favorites
$ ksw pin payments-dev
✔ Pinned ★ arn:.../eks-payments-dev
$ ksw pin ls
★ arn:.../eks-payments-dev
$ ksw pin rm payments-dev
✔ Unpinned arn:.../eks-payments-dev
Groups
$ ksw group add payments \
eks-payments-dev eks-payments-qa
✔ Group payments — added 2 context(s)
$ ksw group use payments
# TUI filtered to payments group
$ ksw group ls
payments (2 contexts)
List contexts
$ ksw -l
▸ arn:.../eks-payments-dev ●
arn:.../eks-payments-qa
arn:.../eks-payments-pdn
arn:.../eks-orders-dev