{"id":16846827,"url":"https://github.com/mumoshu/config-registry","last_synced_at":"2025-07-08T15:03:56.174Z","repository":{"id":45092488,"uuid":"302496428","full_name":"mumoshu/config-registry","owner":"mumoshu","description":"Switch between kubeconfigs and avoid unintentional operation on your production clusters.","archived":false,"fork":false,"pushed_at":"2022-01-09T10:16:44.000Z","size":70,"stargazers_count":34,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-13T13:05:45.218Z","etag":null,"topics":["krew","krew-plugin","kubernetes"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mumoshu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-09T00:53:26.000Z","updated_at":"2024-08-13T14:13:11.000Z","dependencies_parsed_at":"2022-09-04T17:10:14.657Z","dependency_job_id":null,"html_url":"https://github.com/mumoshu/config-registry","commit_stats":null,"previous_names":["mumoshu/kubeconf"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mumoshu%2Fconfig-registry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mumoshu%2Fconfig-registry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mumoshu%2Fconfig-registry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mumoshu%2Fconfig-registry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mumoshu","download_url":"https://codeload.github.com/mumoshu/config-registry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244912800,"owners_count":20530764,"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":["krew","krew-plugin","kubernetes"],"created_at":"2024-10-13T13:05:22.668Z","updated_at":"2025-03-22T05:31:24.204Z","avatar_url":"https://github.com/mumoshu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# config-registry\n\n![Latest GitHub release](https://img.shields.io/github/release/mumoshu/config-registry.svg)\n![GitHub stars](https://img.shields.io/github/stars/mumoshu/config-registry.svg?label=github%20stars)\n[![CI](https://github.com/mumoshu/config-registry/workflows/Test/badge.svg)](https://github.com/mumoshu/config-registry/actions?query=workflow%3A\"Test\")\n\n`config-registry` is a utility to manage and switch between kubeconfigs.\n\nUse this to **avoid unintentional operation on your production clusters**, while easing the management of multiple clusters.\n\n```\nUsage:\n  config-registry [flags]\n  config-registry [command]\n\nAvailable Commands:\n  cp          copy config OLD to NEW\n  current     show the current config name\n  help        Help about any command\n  import      import existing kubeconfig at PATH as NAME\n  init        initialize kubeconf\n  locate      print the path to config NAME\n  ls          list the configs\n  mv          rename config OLD to NEW\n  rm          delete config NAME\n  use         switch to config NAME\n\nFlags:\n  -h, --help   help for ./kubeconf\n\nUse \"config-registry [command] --help\" for more information about a command.\n```\n\n### Usage\n\n```sh\n$ config-registry init\n✔ Config default created.\n\n$ config-registry cp . custom1\nCopied config \"default\" to \"custom1\".\n\n$ $EDITOR \"$(config-registry locate custom1)\"\n\n$ config-registry mv custom1 prod\nRenamed config \"custom1\" to \"prod\".\n\n$ config-registry ls\ndefault\nprod\n\n$ config-registry use prod\nSwitched to config \"prod\".\n\n$ config-registry use -\nSwitched to config \"default\".\n\n$ config-registry locate prod\n$HOME/.kube/kubeconf/registry/prod\n```\n\nSwitching to the production config by using `config-registry use prod` is strongly NOT RECOMMEND.\nThat's because doing so may result in you running a disruptive operation on the production cluster without noticing the current config is production.\n\nInstead, use `config-registry locate prod`.\n\nWith that you can grab the kubeconfig path without switching,\nso that you will never end up running unexpected operations in production:\n\n```\n# Avoid unintentional operation on prod by using `config-registry locate`\n\n$ KUBECONFIG=$(config-registry locate prod) kubectl version\n```\n\n-----\n\n## Installation\n\nThere two installation options:\n\n- As kubectl plugins (macOS/Linux)\n- Manual installation\n\n### Kubectl Plugins (macOS and Linux)\n\nYou can install and use [Krew](https://github.com/kubernetes-sigs/krew/) kubectl\nplugin manager to get `config-registry`.\n\n```sh\nkubectl krew install config-registry\n```\n\nAfter installing, the plugin will be available as `kubectl config-registry`.\n\n-----\n\n### Manual installation\n\n----\n\n## Interactive mode\n\nIf you want `config-registry` command to present you an interactive menu\nwith fuzzy searching, you just need to [install\n`fzf`](https://github.com/junegunn/fzf) in your PATH.\n\nIf you have `fzf` installed, but want to opt out of using this feature, set the environment variable `CONFIG_REGISTRY_IGNORE_FZF=1`.\n\nIf you want to keep `fzf` interactive mode but need the default behavior of the command, you can do it using Unix composability:\n```\nconfig-registry | cat\n```\n\n\n-----\n\n### Customizing colors\n\nIf you like to customize the colors indicating the current config, set the environment variables `CONFIG_REGISTRY_CURRENT_FGCOLOR` and `CONFIG_REGISTRY_CURRENT_BGCOLOR` (refer color codes [here](https://linux.101hacks.com/ps1-examples/prompt-color-using-tput/)):\n\n```\nexport CONFIG_REGISTRY_CURRENT_FGCOLOR=$(tput setaf 6) # blue text\nexport CONFIG_REGISTRY_CURRENT_BGCOLOR=$(tput setab 7) # white background\n```\n\nColors in the output can be disabled by setting the\n[`NO_COLOR`](http://no-color.org/) environment variable.\n\n-----\n\n# Acknowledgement\n\nThe initial version of `config-registry` codebase has been roughly 50% derived from @ahmetb's awesome [kubectx](https://github.com/ahmetb/kubectx). You can see which source files are still kept without major changes today by seeing the license header comments in the source files. A big thanks to @ahmetb and the contributors for all the hard work, and sharing it as an opensource project!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmumoshu%2Fconfig-registry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmumoshu%2Fconfig-registry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmumoshu%2Fconfig-registry/lists"}