{"id":13490263,"url":"https://github.com/hidetatz/kubecolor","last_synced_at":"2025-09-27T09:32:06.615Z","repository":{"id":38976187,"uuid":"302255735","full_name":"hidetatz/kubecolor","owner":"hidetatz","description":"colorizes kubectl output","archived":true,"fork":false,"pushed_at":"2023-04-13T17:38:06.000Z","size":255,"stargazers_count":1404,"open_issues_count":12,"forks_count":104,"subscribers_count":19,"default_branch":"main","last_synced_at":"2024-04-15T00:14:58.549Z","etag":null,"topics":["kubectl","kubernetes"],"latest_commit_sha":null,"homepage":"","language":"Go","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/hidetatz.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-10-08T06:51:36.000Z","updated_at":"2024-04-13T03:44:38.000Z","dependencies_parsed_at":"2024-01-13T12:21:52.612Z","dependency_job_id":"84912b23-8968-4bf0-aebb-6b5ae3e25018","html_url":"https://github.com/hidetatz/kubecolor","commit_stats":{"total_commits":206,"total_committers":15,"mean_commits":"13.733333333333333","dds":0.1893203883495146,"last_synced_commit":"2ce3b8b099a44b6f0d0d0b62ae228a65c437e6a5"},"previous_names":["dty1er/kubecolor"],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidetatz%2Fkubecolor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidetatz%2Fkubecolor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidetatz%2Fkubecolor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hidetatz%2Fkubecolor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hidetatz","download_url":"https://codeload.github.com/hidetatz/kubecolor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219871971,"owners_count":16554475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","kubernetes"],"created_at":"2024-07-31T19:00:43.798Z","updated_at":"2025-09-27T09:32:01.328Z","avatar_url":"https://github.com/hidetatz.png","language":"Go","funding_links":[],"categories":["Go","Tools and Libraries","GitOps","kubernetes","K8S-Tools"],"sub_categories":["Command Line Tools","Kubernetes"],"readme":"# kubecolor\n\n\u003cimg width=\"140\" alt=\"image\" src=\"https://user-images.githubusercontent.com/78741582/194959205-5e11d177-1975-4d2c-bdfa-f1bc33234d91.png\"\u003e\n\n\n![test](https://github.com/hidetatz/kubecolor/workflows/test/badge.svg?branch=main)\n[![Go Report Card](https://goreportcard.com/badge/github.com/hidetatz/kubecolor)](https://goreportcard.com/report/github.com/hidetatz/kubecolor)\n[![codecov](https://codecov.io/gh/hidetatz/kubecolor/branch/main/graph/badge.svg?token=k6ysAa5ghD)](https://codecov.io/gh/hidetatz/kubecolor/)\n\nColorize your kubectl output\n\n* get pods\n\n![image](https://user-images.githubusercontent.com/60682957/95733375-04929680-0cbd-11eb-82f3-adbcfecf4a3e.png)\n\n* describe pods\n\n![image](https://user-images.githubusercontent.com/60682957/95733389-08beb400-0cbd-11eb-983b-cf5138277fe3.png)\n\n* something wrong\n\n![image](https://user-images.githubusercontent.com/60682957/95733397-0a887780-0cbd-11eb-8875-bb1000e0e597.png)\n\n* You can change color theme for light-backgrounded environment\n\n![image](https://user-images.githubusercontent.com/60682957/95733403-0c523b00-0cbd-11eb-9ff9-abc5469e97ca.png)\n\n## What's this?\n\nkubecolor colorizes your `kubectl` command output and does nothing else.\nkubecolor internally calls `kubectl` command and try to colorizes the output so\nyou can use kubecolor as a complete alternative of kubectl. It means you can write this in your .bash_profile:\n\n```sh\nalias kubectl=\"kubecolor\"\n```\nIf you use your .bash_profile on more than one computer (e.g. synced via git) that might not all have `kubecolor` \ninstalled, you can avoid breaking `kubectl` like so: \n\n```sh\ncommand -v kubecolor \u003e/dev/null 2\u003e\u00261 \u0026\u0026 alias kubectl=\"kubecolor\"\n```\n\nFor now, not all subcommands are supported and some of them might be in the future. If you want something to be supported by kubecolor, you can open an issue in this GitHub repo.\nEven if what you want to do is not supported by kubecolor right now, kubecolor still can just show `kubectl` output without any decorations,\nso you don't need to switch kubecolor and kubectl but you always can use kubecolor.\n\nAdditionally, if `kubectl` resulted an error, kubecolor just shows the error message in red or yellow.\n\n**Please keep in mind that kubecolor has runtime overhead compared to kubectl because it runs kubectl internally and parses the output, then colorizes it.**\n\n## Installation\n\n### Download binary via GitHub release\n\nGo to [Release page](https://github.com/hidetatz/kubecolor/releases) then download the binary which fits your environment.\n\n### Mac and Linux users via Homebrew\n\n```sh\nbrew install hidetatz/tap/kubecolor\n```\n\n### Manually via go command\n\n*Note: if you install kubecolor via go command, --kubecolor-version  might not work*\n\n```sh\ngo install github.com/hidetatz/kubecolor/cmd/kubecolor@latest\n```\n\nIf you are not using module mode (or if just above doesn't work), try below:\n\n```sh\ngo get -u github.com/hidetatz/kubecolor/cmd/kubecolor\n```\n\n## Usage\n\nkubecolor understands every subcommands and options which are available for `kubectl`. What you have to do is just using `kubecolor`\ninstead of `kubectl` like:\n\n```sh\nkubecolor --context=your_context get pods -o json\n```\n\nIf you want to make the colorized kubectl default on your shell, just add this line into your shell configuration file:\n\n```sh\nalias kubectl=\"kubecolor\"\n```\n\n### Dynamic tty support\n\nWhen the kubecolor output tty is not standard output, it automatically disables the colorization.\nFor example, if you are running `kubecolor get pods \u003e result.txt` or `kubecolor get pods | grep xxx`, the output will be passed through to file or another command, so colorization is not applied.\nYou can force kubecolor do colorization at such cases by passing `--force-colors` flag. See the upcoming section for more details.\n\n### Flags\n\nAvailable flags for kubecolor. When you pass them, kubecolor will understand them but these flags won't be passed to kubectl.\n\n* `--kubecolor-version`\n\nPrints the version of kubecolor (not kubectl one).\n\n* `--light-background`\n\nWhen your terminal's background color is something light (e.g white), default color preset might look too bright and not readable.\nIf so, specify `--light-background` as a command line argument. kubecolor will use a color preset for light-backgrounded environment.\n\n* `--force-colors`\n\nBy default, kubecolor never output the result in colors when the tty is not a terminal standard output.\nIf you want to force kubecolor to show the result in colors for non-terminal tty, you can specify this flag.\nFor example, when you want to pass kubecolor result to grep (`kubecolor get pods | grep pod_name`), this option is useful.\n\n* `--plain`\n\nWhen you don't want to colorize output, you can specify `--plain`. Kubecolor understands this option and outputs the result without colorizing.\n\n### Autocompletion\n\nkubectl provides [autocompletion feature](https://kubernetes.io/docs/tasks/tools/install-kubectl/#enable-kubectl-autocompletion). If you are\nalready using it, you might have to configure it for kubecolor.\nPlease also refer to [kubectl official doc for kubectl autocomplete](https://kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-autocomplete).\n\n#### Bash\n\nFor Bash, configuring autocompletion requires adding following line in your shell config file.\n\n```shell\n# autocomplete for kubecolor\ncomplete -o default -F __start_kubectl kubecolor\n```\n\nIf you are using an alias like `k=\"kubecolor\"`, then just change above like:\n\n```shell\ncomplete -o default -F __start_kubectl k\n```\n\n#### Zsh\n\nFor zsh make sure these lines are present in your zsh config file:\n```shell\n# get zsh complete kubectl\nsource \u003c(kubectl completion zsh)\nalias kubectl=kubecolor\n# make completion work with kubecolor\ncompdef kubecolor=kubectl\n```\n\n#### fish\n\nFish completion is officially unsupported by `kubectl`, so it is unsupported by `kubecolor` as well.\n\nHowever, there are 2 ways we can make them work. Please keep in mind these are a kind of \"hack\" and not officially supported.\n\n1. Use [evanlucas/fish-kubectl-completions](https://github.com/evanlucas/fish-kubectl-completions) with `kubecolor`:\n\n   * Install `kubectl` completions (https://github.com/evanlucas/fish-kubectl-completions):\n      ```\n      fisher install evanlucas/fish-kubectl-completions\n      ```\n   * Add the following function to your `config.fish` file:\n      ```\n      function kubectl\n        kubecolor $argv\n      end\n      ```\n2. Use [awinecki/fish-kubecolor-completions](https://github.com/awinecki/fish-kubecolor-completions)\n\n   The first way will override `kubectl` command. If you wish to preserve both `kubectl` and `kubecolor` with completions, you need to copy [evanlucas/fish-kubectl-completions](https://github.com/evanlucas/fish-kubectl-completions) for the `kubecolor` command.\n\n   For this purpose, you can use [awinecki/fish-kubecolor-completions](https://github.com/awinecki/fish-kubecolor-completions).\n\n\n### Specify what command to execute as kubectl\n\nSometimes, you may want to specify which command to use as `kubectl` internally in kubecolor. For example, when you want to use a versioned-kubectl `kubectl.1.19`, you can do that by an environment variable:\n\n```shell\nKUBECTL_COMMAND=\"kubectl.1.19\" kubecolor get po\n```\n\nWhen you don't set `KUBECTL_COMMAND`, then `kubectl` is used by default.\n\n## Supported kubectl version\n\nBecause kubecolor internally calls `kubectl` command, if you are using unsupported kubectl version, it's also not supported by kubecolor.\nKubernetes version support policy can be found in [official doc](https://kubernetes.io/docs/setup/release/version-skew-policy/).\n\n## kubectl plugins\n\nEven if kubectl supports [plugin](https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/) feature, it is not supported by kubecolor, including [Krew](https://krew.sigs.k8s.io/).\nIt means you can use plugins from kubecolor (e.g. you can do `kubecolor plugin_name xxx`), but the result won't be colorized.\n\n## Contributions\n\nAlways welcome. Just opening an issue should be also greatful.\n\n## LICENSE\n\nMIT\n\n## Author\n\n[@hidetatz](https://github.com/hidetatz)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhidetatz%2Fkubecolor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhidetatz%2Fkubecolor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhidetatz%2Fkubecolor/lists"}