⎈ v1.9.0 · AI-Powered · AWS SSO

Switch Kubernetes
contexts instantly

Blazing-fast TUI for Kubernetes contexts with AI natural language, EKS kubeconfig sync, and AWS SSO management. 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 trust yoniergomez/ksw
3 brew install ksw
4 ksw

Homebrew 6+ requires you to trust third-party taps once before installing from them (brew trust).

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.

🖼️

11 Cluster Views

List, kubectx-style, columns, grouped, tree, region, matrix, cards, grid and split. Press Ctrl+V to pick one — it is remembered.

🚦

Environment & Profile Aware

dev / qa / pdn / prod / sbx / lab detected from the name, production in red, plus the AWS profile and account of the selected cluster.

↔️

Short or Full Names

Ctrl+H toggles eks-payments-dev ↔ the full ARN in every view. Ctrl+A/Ctrl+E jump to top/bottom.

📋

Sync Reports

After a sync you see exactly which accounts and clusters were added: profile, account ID and cluster, grouped per account.

🧹

Retired Accounts Cleanup

Accounts that disappeared from AWS SSO are detected, and you can remove their profiles and kubeconfig clusters — with confirmation and a backup.

🛡️

Reliable Sync

Exact-ARN matching, the right SSO token per session, automatic retries on transient AWS CLI errors and a progress bar that tells the truth.

Your clusters, your layout

11 views one keystroke away. Environment-aware, with the AWS profile of every account — all derived locally from your kubeconfig.

cards — one card per app
╭─ payments ──────────────────── ● ● ● ╮
│ ❯ DEV eks-payments-dev pay-dev │
│ QA eks-payments-qa pay-qa │
│ PDN eks-payments-pdn pay-pdn │
╰──────────────────────────────────────╯
╭─ orders ────────────────────── ● ● ○ ╮
│ DEV eks-orders-dev ord-dev │
│ QA eks-orders-qa ord-qa │
│ PDN · none │
╰──────────────────────────────────────╯
tree — fold with Space
▾ payments 3
├─ eks-payments-dev DEV
├─ eks-payments-qa QA
└─ eks-payments-pdn PDN ★
▾ orders 2
├─ ❯ eks-orders-dev DEV
└─ eks-orders-qa QA
▸ billing 3
matrix — apps × environments
APP DEV QA PDN
❯ payments [●] ● ●
orders ● ● ·
billing ● · ·
checkout ● ● ●
● cluster ◉ current ★ pinned [ ] selected
kubectx — fzf style
eks-billing-dev
eks-checkout-qa
eks-orders-dev
> eks-payments-dev ← cursor
eks-payments-qa ← current
eks-payments-pdn
42/42 ──────── ^h names · ^v views
> pay█
columns — env tabs + profile
current eks-orders-dev
profile pay-dev · account 111122223333 · us-east-1
arn arn:aws:eks:…:cluster/eks-payments-dev
[ All 42 ] dev 14 qa 14 pdn 14 ★ pins 3
CLUSTER ENV PROFILE
❯ eks-payments-dev DEV pay-dev ★
eks-payments-qa QA pay-qa
eks-payments-pdn PDN pay-pdn
──────────────────────────────────────────────
42/42 columns │ ↑↓ move ⏎ switch │ ^v views
split — list + detail panel
❯ eks-payments-dev DEV │ eks-payments-dev
eks-payments-qa QA │
eks-payments-pdn PDN │ env DEV
eks-orders-dev DEV │ profile pay-dev
eks-orders-qa QA │ account 111122223333
│ region us-east-1
│ state ★ pinned
Ctrl+V — view picker
Views ↑↓ select · enter apply · esc cancel
❯ list original flat list
kubectx fzf-style like kubectx
simple list with env and profile
columns table with env tabs
grouped grouped by application
tree foldable tree
region foldable tree by region
matrix apps × environments
cards one card per app
grid multi-column names
split list + detail panel
Shortcuts
Ctrl+V pick a view (remembered)
← → Tab switch tab · matrix env · card
Space fold / unfold a group
Ctrl+H short ↔ full names, every view
Ctrl+A/E top / bottom (also Home/End)
Ctrl+P pin / unpin ★
Ctrl+F pinned only
Ctrl+T jump to first pin

Press Ctrl+V in ksw to switch. Your choice is remembered.

🤖 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.

🩺

AI K8s Diagnostics

ksw ai "why is my pod crashing?" — the AI runs kubectl commands (get pods, describe, logs, events, top) and analyzes the output to diagnose issues in natural language.

☁️

EKS Kubeconfig Sync

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

⎈

EKS TUI

ksw eks config opens an interactive manager: sync all profiles, sync a specific profile with live search, view clusters in kubeconfig, remove stale entries, or wipe everything — all with real-time streaming progress.

🔍

K8s Resource Explorer

ksw k8s — browse pods, deployments, services and more with live CPU/MEM metrics, semantic coloring, horizontal scroll, multi-select delete, label-based aggregated logs and namespace switching.

🔐

AWS SSO

ksw aws sso config — manage SSO sessions, login, auto-sync all accounts and roles to ~/.aws/config with live progress. Fully free.

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
# ↑↓ · ←→ tabs · Ctrl+V views · Ctrl+P pin
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
⎈ EKS kubeconfig sync
$ ksw eks kubeconfig sync
⠸ Scanning... ████████░░ 42 / 80
✔ Kubeconfig sync — 3 added 12 skipped
✚ NEW CLUSTERS ADDED 3 ★ 1 new
╭───────────┬──────────────────┬───────────╮
│ Profile │ Cluster │ Region │
├───────────┼──────────────────┼───────────┤
│ ★ pay-dev │ eks-pay-dev │ us-east-1 │
│ │ eks-pay-batch │ us-east-1 │
│ ord-qa │ eks-orders-qa │ us-east-2 │
╰───────────┴──────────────────┴───────────╯
★ AWS SSO profiles sync (premium)
$ ksw aws sso profiles sync
✔ Sync complete — 2 added, 1 fixed
✚ NEW ACCOUNTS ADDED 2
╭───────────┬──────────────┬────────────────╮
│ Profile │ Account ID │ SSO account │
├───────────┼──────────────┼────────────────┤
│ pay-dev │ 111122223333 │ PaymentsDev │
│ ord-qa │ 444455556666 │ OrdersQa │
╰───────────┴──────────────┴────────────────╯
Backup: ~/.aws/config.backup.20261020
🧹 Retired accounts cleanup
$ ksw aws sso profiles sync
⚠ NO LONGER IN AWS SSO 1
╭─────────────┬──────────────┬──────────╮
│ Profile │ Account ID │ Clusters │
├─────────────┼──────────────┼──────────┤
│ old-sandbox │ 999999999999 │ 2 │
╰─────────────┴──────────────┴──────────╯
? Remove these accounts? [y] all [s] select [N] y
? Also remove 2 clusters? [Y/n] y
✔ Removed 1 profile
✔ Removed 2 clusters from kubeconfig
Backup of ~/.aws/config created first