ahmetb/kubectl-aliases — explained in plain English
Analysis updated 2026-07-03
Stop typing kubectl get pods --namespace production every time by loading the alias file once and using kgpon instead.
Inspect Kubernetes deployments, services, and logs with two-to-four-character commands instead of full kubectl syntax.
Generate a custom alias file with additional resource types by forking the Python generator script.
Just download the alias file and add one source line to your shell config, adds 30-45ms to shell startup time.
kubectl is the command-line tool used to manage Kubernetes clusters. Even simple operations require typing long commands with resource types, flags, and namespace names. This repository provides a pre-generated file of roughly 800 shell aliases that abbreviate common kubectl commands into short combinations of letters, so you type less and make fewer mistakes. The alias names follow a consistent pattern. Starting with k for kubectl, you add letters for the command, the resource type, and any flags. For example, kgpo expands to kubectl get pod, and ksysgpo expands to kubectl --namespace=kube-system get pod. Resource abbreviations like po for pod, dep for deployment, svc for service, and sec for secret combine with command abbreviations like g for get, d for describe, rm for delete, and lo for logs. Once you internalize the pattern, the short names become predictable rather than arbitrary. The aliases are not written by hand. A Python script generates all permutations of commands, resource types, and flags, producing the alias file automatically. The script accepts a shell argument and can output aliases for bash/zsh, fish, or Nushell. Installation is a one-time step: download the alias file for your shell and add a line to your shell startup file to load it. The fish shell version uses abbreviations instead of aliases, which shows the full expanded command in the terminal before it executes, so you always see what will actually run. Sourcing the file adds roughly 30 to 45 milliseconds to shell startup time, according to the README. Adding more resource types would increase that further, which is why the project asks users to fork rather than adding niche resources to the main list.
A pre-generated set of about 800 shell aliases that shorten common Kubernetes kubectl commands into short letter combinations, so you type kgpo instead of kubectl get pod.
Mainly Nu. The stack also includes Python, Bash, Zsh.
Apache License 2.0, use freely for any purpose, including commercial use, as long as you keep the copyright notice.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly ops devops.
This repo across BitVibe Labs
Verify against the repo before relying on details.