{"id":42308054,"url":"https://github.com/predatorray/kubectl-alias","last_synced_at":"2026-03-01T06:13:51.326Z","repository":{"id":45657541,"uuid":"513892896","full_name":"predatorray/kubectl-alias","owner":"predatorray","description":"The missing alias command for kubectl.","archived":false,"fork":false,"pushed_at":"2022-07-18T14:36:13.000Z","size":16,"stargazers_count":28,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-16T19:06:54.840Z","etag":null,"topics":["kubectl","kubectl-plugin","kubernetes"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/predatorray.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-14T12:28:57.000Z","updated_at":"2023-08-28T20:10:06.000Z","dependencies_parsed_at":"2022-09-04T12:51:50.784Z","dependency_job_id":null,"html_url":"https://github.com/predatorray/kubectl-alias","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/predatorray/kubectl-alias","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/predatorray%2Fkubectl-alias","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/predatorray%2Fkubectl-alias/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/predatorray%2Fkubectl-alias/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/predatorray%2Fkubectl-alias/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/predatorray","download_url":"https://codeload.github.com/predatorray/kubectl-alias/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/predatorray%2Fkubectl-alias/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29962005,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T05:59:08.471Z","status":"ssl_error","status_checked_at":"2026-03-01T05:58:04.208Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kubectl","kubectl-plugin","kubernetes"],"created_at":"2026-01-27T11:12:46.289Z","updated_at":"2026-03-01T06:13:51.309Z","avatar_url":"https://github.com/predatorray.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# kubectl-alias\n\n![GitHub release version](https://img.shields.io/github/v/release/predatorray/kubectl-alias)\n![License](https://img.shields.io/github/license/predatorray/kubectl-alias)\n![Github Workflow status](https://img.shields.io/github/actions/workflow/status/predatorray/kubectl-alias/ci.yml?branch=master)\n\nThe missing `alias` command for `kubectl`.\n\n## Examples\n\n```sh\n# \"v\" for version\nkubectl alias v version\n\nkubectl v --client\n```\n\n```sh\n# \"cd\" to switch namespace\nkubectl alias cd 'config set-context $(kubectl config current-context) --namespace'\n\nkubectl cd my-namespace\n```\n\n```sh\n# Get Pod's YAML spec and open it with less\nkubectl alias --no-args gpyl 'get pod -o yaml $1 | less'\n\nkubectl gpyl my-pod\n```\n\n```sh\n# Make kubectl awesome!\nkubectl alias avada-kedavra 'delete'\nkubectl alias alohomora 'exec -it $1 -- bash'\n```\n\n## Installation\n\n### Homebrew\n\n1. Install [Homebrew](https://brew.sh/).\n\n2. `brew install predatorray/brew/kubectl-alias`\n\n3. Add this line to your rc file (e.g.: `~/.bashrc`, `~/.zshrc`).\n  ```sh\n  export PATH=\"$PATH:$(brew --prefix kubectl-alias)/alias\"\n  ```\n\n### Krew\n\n1. [Install Krew](https://krew.sigs.k8s.io/docs/user-guide/setup/install/) or upgrade to its latest version using `kubectl krew upgrade`.\n\n2. `kubectl krew index add predatorray https://github.com/predatorray/my-krew-index.git`\n\n3. `kubectl krew install predatorray/alias`\n\n4. Add this line to your rc file (e.g.: `~/.bashrc`, `~/.zshrc`).\n  ```sh\n  export PATH=\"$PATH:$(kubectl alias --prefix)\"\n  ```\n\n### Manually\n\n1. Download the [latest release](https://github.com/predatorray/kubectl-alias/releases/latest).\n\n2. Unpack the `kubectl-alias-*.tar.gz` file and copy all the files to a directory, `/usr/local/kubectl-alias` for instance.\n\n3. Add both the `bin/` and the `alias/` directories to the `PATH`. For example, add this line to your rc file: \n  ```sh\n  export PATH=\"$PATH:/usr/local/kubectl-alias/bin:/usr/local/kubectl-alias/alias\"\n  ```\n\n4. If it is not running on GNU-Linux, install the GNU `getopt`. After that, add this line `export GNU_GETOPT_PREFIX=\"path/to/gnu-getopt\"` to your rc file.\n\n## Usage\n\n### Create an alias\n\n```sh\nkubectl alias ALIAS COMMAND\n\nkubectl alias -N ALIAS COMMAND\nkubectl alias --no-args ALIAS COMMAND\n```\n\nThe `-N, --no-args` flag is used when the arguments should not be passed to the end of the commands. It is useful when the offset parameter is explicitly declared in the alias command. For example,\n\n```sh\nkubectl alias --no-args gpyl 'get pod -o yaml $1 | less'\n```\n\nIf the flag is absent, by executing `kubectl gpyl my-pod`, the `my-pod` argument will also be passed to the `less` commnd.\n\n```sh\n# WRONG\nkubectl alias gpyl 'get pod -o yaml $1 | less'\nkubectl get pod -o yaml my-pod | less my-pod \n```\n\n### Delete an alias\n\n```sh\nkubectl alias -d ALIAS\nkubectl alias --delete ALIAS\n```\n### List all the alias\n\n```sh\nkubectl alias -l\nkubectl alias --list\n```\n\n\n## FAQ\n\n### `error: unknown command \"ALIAS NAME\" for \"kubectl\"`\n\nThis means that the `alias/` directory is not correctly added to the `PATH` environment variable.\n\nAdd this line to your rc file.\n\n```sh\nexport PATH=\"$PATH:$(brew --prefix kubectl-alias)/alias\"\n\n# Or, if installed manually.\nexport PATH=\"$PATH:${PREFIX}/alias\"\n```\n\nAfter that, run `kubectl plugin list` to check if the aliases have been loaded successfully. If the alias is named `v`, the output of the plugin list will be:\n\n```txt\nThe following compatible plugins are available:\n\n/usr/local/bin/kubectl-alias\n/usr/local/opt/kubectl-alias/alias/kubectl-v\n```\n\n## Support\n\nPlease feel free to [open an issue](https://github.com/predatorray/kubectl-alias/issues/new) if you find any bug or have any suggestion.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpredatorray%2Fkubectl-alias","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpredatorray%2Fkubectl-alias","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpredatorray%2Fkubectl-alias/lists"}