whatisgithub

What is kubectl-aliases?

ahmetb/kubectl-aliases — explained in plain English

Analysis updated 2026-07-03

3,689NuAudience · ops devopsComplexity · 1/5LicenseSetup · easy

In one sentence

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.

Mindmap

mindmap
  root((kubectl-aliases))
    What it does
      Shortens kubectl commands
      800 generated aliases
      Consistent letter patterns
    Alias Pattern
      k = kubectl
      g = get, d = describe
      po = pod, svc = service
    Shell Support
      bash and zsh
      fish abbreviations
      Nushell
    Setup
      Download alias file
      Source in shell profile
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Stop typing kubectl get pods --namespace production every time by loading the alias file once and using kgpon instead.

USE CASE 2

Inspect Kubernetes deployments, services, and logs with two-to-four-character commands instead of full kubectl syntax.

USE CASE 3

Generate a custom alias file with additional resource types by forking the Python generator script.

What is it built with?

PythonBashZshFishNushell

How do you get it running?

Difficulty · easy Time to first run · 5min

Just download the alias file and add one source line to your shell config, adds 30-45ms to shell startup time.

Apache License 2.0, use freely for any purpose, including commercial use, as long as you keep the copyright notice.

So what is it?

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.

Copy-paste prompts

Prompt 1
I want to use kubectl-aliases in my zsh setup. Show me exactly which file to download and what line to add to my .zshrc to load the aliases.
Prompt 2
Using the kubectl-aliases pattern, what shorthand do I use for kubectl describe deployment, kubectl delete pod, and kubectl logs?
Prompt 3
I want to add a custom resource type to kubectl-aliases for my CRDs. Show me how to edit the Python generator to add a new resource abbreviation.

Frequently asked questions

What is kubectl-aliases?

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.

What language is kubectl-aliases written in?

Mainly Nu. The stack also includes Python, Bash, Zsh.

What license does kubectl-aliases use?

Apache License 2.0, use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is kubectl-aliases to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is kubectl-aliases for?

Mainly ops devops.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.