@theradio.in/kubelense
v0.3.0
Published
A terminal UI for browsing Kubernetes clusters, like Lens/k9s.
Maintainers
Readme
kubeLense
A terminal UI for browsing Kubernetes clusters — think Lens / k9s, in your shell.
kubeLense reads your data through the local kubectl binary, so whatever auth
already works for kubectl (including cloud exec plugins like aws eks
get-token) works here with zero extra setup. v1 is read-only — browse,
inspect logs, describe, view YAML, and shell into pods. No delete/scale yet.
Requirements
- Node.js 18+ (tested on v22)
kubectlon yourPATH, configured for a cluster
Install
# One-off, no install:
npx @theradio.in/kubelense
# Or install globally:
npm install -g @theradio.in/kubelense
kubelense # the command is just "kubelense"kubeLense drives your existing kubectl, so it uses whatever cluster and auth
kubectl is already configured for — no extra credentials to set up.
Run from source
npm install
# Dev (run TypeScript directly):
npm run dev
# Or build and run:
npm run build
node dist/index.js
# Install the `kubelense` command globally from this checkout:
npm run build && npm link # then just: kubelenseOptions: --context <name>, --kubeconfig <path|dir>, --help.
Multiple kubeconfig files
--kubeconfig is repeatable, accepts a :-separated list, and expands
directories to the files inside. All contexts from every file are merged, so
you can hop between clusters live with the c context picker.
# several files
kubelense --kubeconfig ~/.kube/a --kubeconfig ~/.kube/b
# a colon-separated list (like KUBECONFIG)
kubelense --kubeconfig ~/.kube/a:~/.kube/b
# a whole directory of configs
kubelense --kubeconfig ~/k8s-configkubeLense is keyboard-only — it never captures the mouse, so your terminal's native scroll and select-to-copy keep working.
Keys
| Key | Action |
| -------------- | -------------------------------------------------- |
| n | open the interactive namespace picker |
| :<resource> | switch view — pods, deploy, svc, nodes, ns, cm, secrets |
| :ns <name> | set the active namespace (:all clears it) |
| /<text> | filter rows by name or namespace |
| ↑/↓ | move the cursor |
| l | stream logs (pods) |
| d | kubectl describe the selected object |
| y | view the object's YAML |
| s | open a shell in the pod (kubectl exec -it) |
| 0 | show all namespaces |
| r | refresh now (auto-refreshes every 3s) |
| esc | close an overlay / clear the filter |
| q | quit |
In the logs view
| Key | Action |
| -------------- | -------------------------------------------------- |
| ↑/↓ · pgup | scroll — scrolling up pauses the live tail |
| f / end | resume following (jump back to newest) |
| w | toggle full-line wrap (shows untruncated lines; pauses) |
| enter | drop a blank separator line into the tail |
| esc / q | close |
How it's built
src/kube.ts— thin wrapper aroundkubectl(JSON out, log streaming, exec).src/resources.ts— data-driven registry of resource kinds + their columns. Add a kind here and it shows up in the UI automatically.src/app.ts— theblessedfull-screen UI: table, command bar, overlays.src/index.ts— CLI entry / arg parsing.
Ideas for later
- Events view (
:events) and per-object events in a detail drill-down. kubectl topCPU/memory columns for pods and nodes (needs metrics-server).- More resources: statefulsets, daemonsets, jobs, cronjobs, ingresses, PVCs, HPAs.
- Mutating actions (delete, scale, rollout restart) behind a typed confirmation,
gated by an explicit
--allow-writeflag. - Swap the kubectl backend for
@kubernetes/client-node+ real watches.
