All Tools View Categories About Contact Privacy

K9s / kubectl Alias Generator

Generate shell aliases for kubectl and k9s across bash, zsh and fish.

Runs entirely in your browser - nothing is uploaded and no cluster connection is made.
Your generated aliases will appear here.

About K9s / kubectl Alias Generator

Typing kubectl repeatedly is tedious. The K9s / kubectl Alias Generator emits ready-to-source alias definitions for bash, zsh and fish, with common command shortcuts and optional namespace scoping.

Pick your shell, toggle the shortcuts you want, optionally scope to a namespace, and copy the result into your rc file.

Everything runs locally and nothing is uploaded.

Features

  • Three shells - bash, zsh, fish.
  • Shortcuts - k, k9s, kgp, kgs, kd, kdel, kl, kpf.
  • Namespace scoping - alias to a default namespace.
  • Copy / Download / Print - drop into your rc file.

How to Use

  1. Pick a shell.
  2. Choose shortcuts.
  3. Watch the preview and export.

Examples

Example 1 - bash. alias k="kubectl"; alias kgp="kubectl get pods".

Example 2 - fish. alias k="kubectl"; alias kgp="kubectl get pods".

Benefits

  • Correct syntax - per-shell alias format.
  • Time saving - common shortcuts included.
  • Flexible - namespace scoping.
  • Private - runs in the browser.
  • Copy, download or print - get the aliases where you need them.

Frequently Asked Questions

What does this tool build?
It generates shell alias definitions for kubectl and k9s for bash, zsh and fish, including common command shortcuts and namespace/context shortcuts.
Which shells are supported?
bash, zsh and fish. Each uses its own alias syntax (alias name=value vs alias name=value in fish via "alias name=value").
What shortcuts are included?
Common ones like k= kubectl, k9s, kgp (get pods), kgs (get services), kd (describe), kdel (delete), kl (logs) and kpf (port-forward).
Can I add namespace shortcuts?
Yes. Provide a namespace and the generator emits an alias that scopes kubectl to it (e.g. kp= kubectl -n prod).
Does this connect to a cluster?
No. Everything runs locally; the output is just alias text.
Can I copy or download the aliases?
Yes. Copy the aliases, download aliases.sh/.fish, or print them.