Skip to content

kubectl, indexed.

Run kx get <resource> once and every row gets a number. From then on you name resources by that number instead of typing them out: kx describe 1, kx delete 2 5, kx exec 1.

curl -fsSL https://jzills.github.io/kx/install.sh | sh

It runs on Linux, macOS and Windows, beside the kubectl you already have.

Other ways to install
$ kx get pods -n diagnostics --limit 3
Pods · diagnostics · 3 of 11 items
  X    NAME                             READY    STATUS              RESTARTS            AGE
  1    api-badimage-b97d844fd-5s8jd     0/1      ImagePullBackOff       0                17d
  2    billing-flaky-b7878b475-4hj7b    1/1      Running               10 (6h43m ago)    17d
  3    cache-oom-cc849dbdb-n2hnn        0/1      CrashLoopBackOff    1338 (2m52s ago)    17d
$ kx get pods -n diagnostics --limit 3
Pods · diagnostics · 3 of 11 items
  X    NAME                             READY    STATUS              RESTARTS            AGE
  1    api-badimage-b97d844fd-5s8jd     0/1      ImagePullBackOff       0                17d
  2    billing-flaky-b7878b475-4hj7b    1/1      Running               10 (6h43m ago)    17d
  3    cache-oom-cc849dbdb-n2hnn        0/1      CrashLoopBackOff    1338 (2m53s ago)    17d
$ kx get pods -n diagnostics --limit 3
Pods · diagnostics · 3 of 11 items
  X    NAME                             READY    STATUS              RESTARTS            AGE
  1    api-badimage-b97d844fd-5s8jd     0/1      ImagePullBackOff       0                17d
  2    billing-flaky-b7878b475-4hj7b    1/1      Running               10 (6h43m ago)    17d
  3    cache-oom-cc849dbdb-n2hnn        0/1      CrashLoopBackOff    1338 (2m53s ago)    17d
$ kx get pods -n diagnostics --limit 3
Pods · diagnostics · 3 of 11 items
  X    NAME                             READY    STATUS              RESTARTS            AGE
  1    api-badimage-b97d844fd-5s8jd     0/1      ImagePullBackOff       0                17d
  2    billing-flaky-b7878b475-4hj7b    1/1      Running               10 (6h43m ago)    17d
  3    cache-oom-cc849dbdb-n2hnn        0/1      CrashLoopBackOff    1338 (2m53s ago)    17d
$ kx get pods -n diagnostics --limit 3
Pods · diagnostics · 3 of 11 items
  X    NAME                             READY    STATUS              RESTARTS            AGE
  1    api-badimage-b97d844fd-5s8jd     0/1      ImagePullBackOff       0                17d
  2    billing-flaky-b7878b475-4hj7b    1/1      Running               10 (6h43m ago)    17d
  3    cache-oom-cc849dbdb-n2hnn        0/1      CrashLoopBackOff    1338 (2m53s ago)    17d
$ kx get pods -n diagnostics --limit 3
Pods · diagnostics · 3 of 11 items
  X    NAME                             READY    STATUS              RESTARTS            AGE
  1    api-badimage-b97d844fd-5s8jd     0/1      ImagePullBackOff       0                17d
  2    billing-flaky-b7878b475-4hj7b    1/1      Running               10 (6h43m ago)    17d
  3    cache-oom-cc849dbdb-n2hnn        0/1      CrashLoopBackOff    1338 (2m53s ago)    17d
$ kx get pods -n diagnostics --limit 3
Pods · diagnostics · 3 of 11 items
  X    NAME                             READY    STATUS              RESTARTS            AGE
  1    api-badimage-b97d844fd-5s8jd     0/1      ImagePullBackOff       0                17d
  2    billing-flaky-b7878b475-4hj7b    1/1      Running               10 (6h43m ago)    17d
  3    cache-oom-cc849dbdb-n2hnn        0/1      CrashLoopBackOff    1338 (2m53s ago)    17d
$ kx get pods -n diagnostics --limit 3
Pods · diagnostics · 3 of 11 items
  X    NAME                             READY    STATUS              RESTARTS            AGE
  1    api-badimage-b97d844fd-5s8jd     0/1      ImagePullBackOff       0                17d
  2    billing-flaky-b7878b475-4hj7b    1/1      Running               10 (6h43m ago)    17d
  3    cache-oom-cc849dbdb-n2hnn        0/1      CrashLoopBackOff    1338 (2m53s ago)    17d
$ kx get pods -n diagnostics --limit 3
Pods · diagnostics · 3 of 11 items
  X    NAME                             READY    STATUS              RESTARTS            AGE
  1    api-badimage-b97d844fd-5s8jd     0/1      ImagePullBackOff       0                17d
  2    billing-flaky-b7878b475-4hj7b    1/1      Running               10 (6h43m ago)    17d
  3    cache-oom-cc849dbdb-n2hnn        0/1      CrashLoopBackOff    1338 (2m53s ago)    17d
$ kx get pods -n diagnostics --limit 3
Pods · diagnostics · 3 of 11 items
  X    NAME                             READY    STATUS              RESTARTS            AGE
  1    api-badimage-b97d844fd-5s8jd     0/1      ImagePullBackOff       0                17d
  2    billing-flaky-b7878b475-4hj7b    1/1      Running               10 (6h43m ago)    17d
  3    cache-oom-cc849dbdb-n2hnn        0/1      CrashLoopBackOff    1338 (2m53s ago)    17d
kubectl logs billing-flaky-b7878b475-4hj7b -n diagnostics $ kx logs 2

Triage a namespace

Bare kx diag sweeps every workload and ranks what is unhealthy, from CrashLoopBackOff to Services with no endpoints.

Scan images for CVEs

The kx scan command scans each unique image with Docker Scout, Trivy or Grype and sums up the severities.

Ownership, as a tree

The kx tree command walks ownership from controllers down to containers and numbers it like any other listing.

Read a Secret in plaintext

Running kx secret 1 --decode prints every key decoded, or one value raw with -k, straight into a shell.

Tab completion, by number

Typing kx describe <TAB> offers 1  api-7d8f (Pod), from saved state, so it never waits on the cluster.

Built for agents and CI

The kx mcp server gives an agent read-only access, and --fail-on turns a sweep or scan into a pipeline gate.

Every listing, numbered

A health sweep numbers what it finds the way kx get numbers rows, worst first, so the next command is kx describe 1 or kx logs 3. Indexes stay put until you list again, and one command can take several, a range, or a range left open, as in kx delete 1 2..4 5...

How indexes work
Mixed · diagnostics · 11 checked · 7 of 10 shown
  X    KIND          NAME                      VERDICT     TOP FINDING                                      
  1    CronJob       nightly-failing           critical    Most recent run: BackoffLimitExceeded (2/1 faile…
  2    Deployment    api-badimage              critical    Image pull failure (ImagePullBackOff) in Pod api…
  3    Deployment    cache-oom                 critical    CrashLoopBackOff in Pod cache-oom-cc849dbdb-n2hn…
  4    Deployment    frontend-notready         critical    Only 0/2 replicas ready                          
  5    Deployment    report-unschedulable      critical    Unschedulable: 0/1 nodes are available: 1 Insuff…
  6    Deployment    worker-crashloop          critical    CrashLoopBackOff in Pod worker-crashloop-bc7cb7b…
  7    Job           migration-backofflimit    critical    BackoffLimitExceeded (2/1 failed)                
1 healthy resource not shown · kx diag <index> for detail
Mixed · diagnostics · 11 checked · 7 of 10 shown
  X    KIND          NAME                      VERDICT     TOP FINDING                                      
  1    CronJob       nightly-failing           critical    Most recent run: BackoffLimitExceeded (2/1 faile…
  2    Deployment    api-badimage              critical    Image pull failure (ImagePullBackOff) in Pod api…
  3    Deployment    cache-oom                 critical    CrashLoopBackOff in Pod cache-oom-cc849dbdb-n2hn…
  4    Deployment    frontend-notready         critical    Only 0/2 replicas ready                          
  5    Deployment    report-unschedulable      critical    Unschedulable: 0/1 nodes are available: 1 Insuff…
  6    Deployment    worker-crashloop          critical    CrashLoopBackOff in Pod worker-crashloop-bc7cb7b…
  7    Job           migration-backofflimit    critical    BackoffLimitExceeded (2/1 failed)                
1 healthy resource not shown · kx diag <index> for detail
Mixed · diagnostics · 11 checked · 7 of 10 shown
  X    KIND          NAME                      VERDICT     TOP FINDING                                      
  1    CronJob       nightly-failing           critical    Most recent run: BackoffLimitExceeded (2/1 faile…
  2    Deployment    api-badimage              critical    Image pull failure (ImagePullBackOff) in Pod api…
  3    Deployment    cache-oom                 critical    CrashLoopBackOff in Pod cache-oom-cc849dbdb-n2hn…
  4    Deployment    frontend-notready         critical    Only 0/2 replicas ready                          
  5    Deployment    report-unschedulable      critical    Unschedulable: 0/1 nodes are available: 1 Insuff…
  6    Deployment    worker-crashloop          critical    CrashLoopBackOff in Pod worker-crashloop-bc7cb7b…
  7    Job           migration-backofflimit    critical    BackoffLimitExceeded (2/1 failed)                
1 healthy resource not shown · kx diag <index> for detail
Mixed · diagnostics · 11 checked · 7 of 10 shown
  X    KIND          NAME                      VERDICT     TOP FINDING                                      
  1    CronJob       nightly-failing           critical    Most recent run: BackoffLimitExceeded (2/1 faile…
  2    Deployment    api-badimage              critical    Image pull failure (ImagePullBackOff) in Pod api…
  3    Deployment    cache-oom                 critical    CrashLoopBackOff in Pod cache-oom-cc849dbdb-n2hn…
  4    Deployment    frontend-notready         critical    Only 0/2 replicas ready                          
  5    Deployment    report-unschedulable      critical    Unschedulable: 0/1 nodes are available: 1 Insuff…
  6    Deployment    worker-crashloop          critical    CrashLoopBackOff in Pod worker-crashloop-bc7cb7b…
  7    Job           migration-backofflimit    critical    BackoffLimitExceeded (2/1 failed)                
1 healthy resource not shown · kx diag <index> for detail
Mixed · diagnostics · 11 checked · 7 of 10 shown
  X    KIND          NAME                      VERDICT     TOP FINDING                                      
  1    CronJob       nightly-failing           critical    Most recent run: BackoffLimitExceeded (2/1 faile…
  2    Deployment    api-badimage              critical    Image pull failure (ImagePullBackOff) in Pod api…
  3    Deployment    cache-oom                 critical    CrashLoopBackOff in Pod cache-oom-cc849dbdb-n2hn…
  4    Deployment    frontend-notready         critical    Only 0/2 replicas ready                          
  5    Deployment    report-unschedulable      critical    Unschedulable: 0/1 nodes are available: 1 Insuff…
  6    Deployment    worker-crashloop          critical    CrashLoopBackOff in Pod worker-crashloop-bc7cb7b…
  7    Job           migration-backofflimit    critical    BackoffLimitExceeded (2/1 failed)                
1 healthy resource not shown · kx diag <index> for detail
Mixed · diagnostics · 11 checked · 7 of 10 shown
  X    KIND          NAME                      VERDICT     TOP FINDING                                      
  1    CronJob       nightly-failing           critical    Most recent run: BackoffLimitExceeded (2/1 faile…
  2    Deployment    api-badimage              critical    Image pull failure (ImagePullBackOff) in Pod api…
  3    Deployment    cache-oom                 critical    CrashLoopBackOff in Pod cache-oom-cc849dbdb-n2hn…
  4    Deployment    frontend-notready         critical    Only 0/2 replicas ready                          
  5    Deployment    report-unschedulable      critical    Unschedulable: 0/1 nodes are available: 1 Insuff…
  6    Deployment    worker-crashloop          critical    CrashLoopBackOff in Pod worker-crashloop-bc7cb7b…
  7    Job           migration-backofflimit    critical    BackoffLimitExceeded (2/1 failed)                
1 healthy resource not shown · kx diag <index> for detail
Mixed · diagnostics · 11 checked · 7 of 10 shown
  X    KIND          NAME                      VERDICT     TOP FINDING                                      
  1    CronJob       nightly-failing           critical    Most recent run: BackoffLimitExceeded (2/1 faile…
  2    Deployment    api-badimage              critical    Image pull failure (ImagePullBackOff) in Pod api…
  3    Deployment    cache-oom                 critical    CrashLoopBackOff in Pod cache-oom-cc849dbdb-n2hn…
  4    Deployment    frontend-notready         critical    Only 0/2 replicas ready                          
  5    Deployment    report-unschedulable      critical    Unschedulable: 0/1 nodes are available: 1 Insuff…
  6    Deployment    worker-crashloop          critical    CrashLoopBackOff in Pod worker-crashloop-bc7cb7b…
  7    Job           migration-backofflimit    critical    BackoffLimitExceeded (2/1 failed)                
1 healthy resource not shown · kx diag <index> for detail
Mixed · diagnostics · 11 checked · 7 of 10 shown
  X    KIND          NAME                      VERDICT     TOP FINDING                                      
  1    CronJob       nightly-failing           critical    Most recent run: BackoffLimitExceeded (2/1 faile…
  2    Deployment    api-badimage              critical    Image pull failure (ImagePullBackOff) in Pod api…
  3    Deployment    cache-oom                 critical    CrashLoopBackOff in Pod cache-oom-cc849dbdb-n2hn…
  4    Deployment    frontend-notready         critical    Only 0/2 replicas ready                          
  5    Deployment    report-unschedulable      critical    Unschedulable: 0/1 nodes are available: 1 Insuff…
  6    Deployment    worker-crashloop          critical    CrashLoopBackOff in Pod worker-crashloop-bc7cb7b…
  7    Job           migration-backofflimit    critical    BackoffLimitExceeded (2/1 failed)                
1 healthy resource not shown · kx diag <index> for detail
Mixed · diagnostics · 11 checked · 7 of 10 shown
  X    KIND          NAME                      VERDICT     TOP FINDING                                      
  1    CronJob       nightly-failing           critical    Most recent run: BackoffLimitExceeded (2/1 faile…
  2    Deployment    api-badimage              critical    Image pull failure (ImagePullBackOff) in Pod api…
  3    Deployment    cache-oom                 critical    CrashLoopBackOff in Pod cache-oom-cc849dbdb-n2hn…
  4    Deployment    frontend-notready         critical    Only 0/2 replicas ready
  5    Deployment    report-unschedulable      critical    Unschedulable: 0/1 nodes are available: 1 Insuff…
  6    Deployment    worker-crashloop          critical    CrashLoopBackOff in Pod worker-crashloop-bc7cb7b…
  7    Job           migration-backofflimit    critical    BackoffLimitExceeded (2/1 failed)
1 healthy resource not shown · kx diag <index> for detail
Mixed · diagnostics · 11 checked · 7 of 10 shown
  X    KIND          NAME                      VERDICT     TOP FINDING                                      
  1    CronJob       nightly-failing           critical    Most recent run: BackoffLimitExceeded (2/1 faile…
  2    Deployment    api-badimage              critical    Image pull failure (ImagePullBackOff) in Pod api…
  3    Deployment    cache-oom                 critical    CrashLoopBackOff in Pod cache-oom-cc849dbdb-n2hn…
  4    Deployment    frontend-notready         critical    Only 0/2 replicas ready                          
  5    Deployment    report-unschedulable      critical    Unschedulable: 0/1 nodes are available: 1 Insuff…
  6    Deployment    worker-crashloop          critical    CrashLoopBackOff in Pod worker-crashloop-bc7cb7b…
  7    Job           migration-backofflimit    critical    BackoffLimitExceeded (2/1 failed)                
1 healthy resource not shown · kx diag <index> for detail

Reports in the browser

The --html flag on diag, scan, tree and top renders the same analysis as a page you can filter and opens it. Sweep rows expand into a resource's full report, and image rows into the CVEs behind their counts. It's served from localhost, and nothing is written to disk unless you pass --out.

Browser reports
kx diag --html: a namespace sweep, ranked by severity in the github-dark theme kx diag --html: a namespace sweep, ranked by severity in the dracula theme kx diag --html: a namespace sweep, ranked by severity in the nord theme kx diag --html: a namespace sweep, ranked by severity in the gruvbox theme kx diag --html: a namespace sweep, ranked by severity in the solarized-dark theme kx diag --html: a namespace sweep, ranked by severity in the catppuccin-mocha theme kx diag --html: a namespace sweep, ranked by severity in the tokyo-night theme kx diag --html: a namespace sweep, ranked by severity in the rose-pine theme kx diag --html: a namespace sweep, ranked by severity in the mono theme kx diag --html: a namespace sweep, ranked by severity in the light theme
kx diag --html
kx scan --html: severity counts per image in the github-dark theme kx scan --html: severity counts per image in the dracula theme kx scan --html: severity counts per image in the nord theme kx scan --html: severity counts per image in the gruvbox theme kx scan --html: severity counts per image in the solarized-dark theme kx scan --html: severity counts per image in the catppuccin-mocha theme kx scan --html: severity counts per image in the tokyo-night theme kx scan --html: severity counts per image in the rose-pine theme kx scan --html: severity counts per image in the mono theme kx scan --html: severity counts per image in the light theme
kx scan --html
kx tree --html: the ownership graph as a collapsible tree in the github-dark theme kx tree --html: the ownership graph as a collapsible tree in the dracula theme kx tree --html: the ownership graph as a collapsible tree in the nord theme kx tree --html: the ownership graph as a collapsible tree in the gruvbox theme kx tree --html: the ownership graph as a collapsible tree in the solarized-dark theme kx tree --html: the ownership graph as a collapsible tree in the catppuccin-mocha theme kx tree --html: the ownership graph as a collapsible tree in the tokyo-night theme kx tree --html: the ownership graph as a collapsible tree in the rose-pine theme kx tree --html: the ownership graph as a collapsible tree in the mono theme kx tree --html: the ownership graph as a collapsible tree in the light theme
kx tree --html

In your colors

The kx theme command restyles the terminal, the HTML reports and this page from one registry of palettes. Pick one here and the whole site follows.

Themes

Install kx

Every method installs the same prebuilt binary, from PyPI too, with no Python runtime. It needs only kubectl on your PATH.

brew
brew install jzills/tap/kx
krew
kubectl krew install idx
alias kx="kubectl idx"
uv
uv tool install kx-cli
pipx
pipx install kx-cli

To try it without installing, run uvx --from kx-cli kx get pods.