openk8s
v1.0.5
Published
A terminal UI for Kubernetes
Maintainers
Readme
openk8s
A terminal UI for Kubernetes.
This project is vibe-coded and untested. No guarantees it works. Built as an exercise to see how far AI-assisted development can go for a k9s-like terminal UI. Use at your own risk.
What is this?
openk8s is a keyboard-driven TUI for browsing and managing Kubernetes clusters, inspired by k9s. It aims to be a simpler, opinionated alternative — three panes, no mouse dependency (though clickable), and direct access to the most common kubectl operations without leaving the terminal.
Prerequisites
| Tool | Required | Notes | |------|----------|-------| | kubectl | yes | >= 1.36.1, must be configured with a valid kubeconfig | | helm | no | Enables HelmRelease management | | bun | yes | Required at runtime to execute the app |
Installation
npm (requires bun at runtime)
npm install -g openk8s
openk8sbunx (no install needed)
bunx openk8sFrom source
git clone https://github.com/leon19/openk8s
cd openk8s
npm install
bun run devQuick start
openk8sThe app scans your kubeconfig, picks your current context, and loads the cluster's resources. Use c to switch contexts, n to switch namespaces.
Layout
┌─────────────┬──────────────────────┬──────────────────┐
│ Kinds │ Resources │ Inspector │
│ │ │ │
│ pods ›│ nginx-7fb96c... ││ Summary tab │
│ services ›│ redis-5d4f8b... ││ Status: Ready │
│ configmaps│ api-6c9b8... ││ Age: 2h │
│ ... │ ... ││ ... │
│ │ │ │
│ [C] cluster │ / filter │ [s] [y] [v] [i] │
│ [N] ns │ │ │
└─────────────┴──────────────────────┴──────────────────┘Three resizable panes: resource kinds (left), resources (center), inspector (right, hidden when width < 110). Tab/Shift+Tab cycles focus. Inspector has four tabs: Summary, YAML, Events, Describe.
Keybindings
Global
| Key | Action |
|-----|--------|
| Tab / Shift+Tab | Cycle pane focus right / left |
| c | Switch cluster context |
| n | Switch namespace |
| r | Refresh current view |
| Escape | Close overlay / exit filter mode |
| Ctrl+C | Quit |
Navigation
| Key | Action |
|-----|--------|
| Up / k | Move up in current pane |
| Down / j | Move down in current pane |
| Left / h | Move to previous pane |
| Right | Move to next pane / inspector tab |
Resource pane
| Key | Action |
|-----|--------|
| / | Enter filter mode (type to filter resources) |
| Space | Toggle multi-select on current resource |
| l | View streaming logs |
| x | Open interactive shell (kubectl exec) |
| e | Edit resource (kubectl edit / helm upgrade --reuse-values) |
| d | Delete resource (supports batch delete) |
| f | Port-forward overlay |
| Shift+S | Scale replicas |
| Shift+R | Rollout restart |
| b | Helm rollback (HelmReleases only) |
| Shift+U | Helm upgrade (HelmReleases only, interactive) |
Inspector pane
| Key | Action |
|-----|--------|
| s | Summary tab |
| y | YAML tab (press again to copy YAML) |
| v | Events tab |
| i | Describe tab |
Logs overlay
| Key | Action |
|-----|--------|
| Up / Down / k / j | Scroll by 3 lines |
| c | Pick container (multi-container pods) |
| p | Toggle previous logs |
| t | Set tail count |
| s | Set since duration (e.g. 1h, 30m) |
| / | Search within logs |
| n / Shift+N | Next / previous search match |
| Escape | Exit search → exit input → close overlay |
| Enter | Confirm input / search |
Port-forward overlay
| Key | Action |
|-----|--------|
| Up / Down / k / j | Navigate ports |
| Enter | Start forwarding on selected port |
| x | Stop active forward on selected port |
| Escape | Close overlay |
Scale dialog
| Key | Action |
|-----|--------|
| type | Enter replica count |
| Enter | Apply scale |
| Escape | Cancel |
Delete confirm overlay
| Key | Action |
|-----|--------|
| Enter | Confirm deletion |
| Escape | Cancel |
Features
- Context & namespace switching — browse any cluster in your kubeconfig, any namespace
- Resource browsing — auto-discovers API resource kinds and lists resources with status, age, and summary; curates a sensible default ordering
- Log streaming —
kubectl logs --followwith search, container picker, tail count, since duration, and previous logs toggle; Deployments/StatefulSets use--all-pods - Shell — drop into a container via
kubectl exec -it sh(renderer suspends, resumes on exit) - Edit —
kubectl editfor resources, temp-file +helm upgrade --reuse-valuesfor HelmReleases (opens$EDITOR) - Port-forward — declare ports, start/stop forwards inline with live status
- Scale — set replica count for Deployments, StatefulSets, ReplicaSets
- Rollout restart — one-key restart for Deployments, StatefulSets, DaemonSets
- Delete — single or batch (via multi-select with
Space), useskubectl deleteorhelm uninstall - Secret reveal — click
[reveal]inline to decode secret values and[copy]to clipboard - YAML copy — view full YAML in inspector, press
yagain to copy - Metrics — pod and node CPU/memory usage when metrics-server is installed
- Helm releases — list, rollback, and upgrade Helm releases (injected as a resource kind when helm is available)
- Multi-select — select multiple resources for batch operations (delete)
- Keyboard-first — all actions accessible via keyboard; mouse also supported
- Persistent state — last active context and namespace saved to
~/.config/openk8s/state.json
Clipboard
Copy actions (YAML, secret values) use:
- Linux (Wayland):
wl-copy - Linux (X11):
xclip -selection clipboard - macOS:
pbcopy
A toast notification is shown on unsupported platforms.
Polling
The app auto-refreshes on three intervals:
| What | Interval | |------|----------| | Cluster state | 30s | | Resource list & detail | 5s | | Metrics | 15s |
Press r to force a manual refresh at any time.
License
MIT
