kubetrim
« Back to VersTracker
Description:
Trim your KUBECONFIG automatically
Type: Formula  |  Tracked Since: Dec 28, 2025
Links: Homepage  |  formulae.brew.sh
Category: Devops
Tags: kubernetes kubeconfig cli devops cleanup
Install: brew install kubetrim
About:
Kubetrim is a command-line utility that automatically cleans up your KUBECONFIG file by removing expired, duplicate, and invalid contexts. It helps developers and DevOps engineers maintain a manageable and efficient Kubernetes configuration, reducing clutter and potential errors when switching between clusters.
Key Features:
  • Automatically removes expired or duplicate kubeconfig contexts
  • Validates context connectivity before removal
  • Simple, single-binary tool with no external dependencies
  • Preserves valid configurations while trimming the fat
Use Cases:
  • Cleaning up a KUBECONFIG after working with multiple ephemeral Kubernetes clusters
  • Maintaining a tidy configuration file when regularly switching between development, staging, and production environments
Alternatives:
  • kubectx – kubectx is for switching contexts, while kubetrim is for cleaning them up.
  • Manual Editing – Manually editing the kubeconfig file is error-prone and time-consuming compared to kubetrim's automation.
Version History
Detected Version Rev Change Commit
Sep 25, 2025 9:28am 0 VERSION_BUMP c6e763eb
Dec 12, 2024 6:15pm 0 VERSION_BUMP 2f17e6ba