AI Architecture Analysis
This repository is indexed by RepoMind. By analyzing mirceanton/kubectl-switch in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.
Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.
Repository Overview (README excerpt)
Crawler viewkubectl-switch is a command-line tool for managing and switching between multiple Kubernetes configuration files located in the same directory. It simplifies the process of selecting a Kubernetes context from multiple kubeconfig files and updating the active configuration or namespace. Just dump all your into a single dir and let manage them for you! Features • **Multiple kubeconfig files**: Manage multiple kubeconfig files in a single directory without merging them • **Context & namespace switching**: Switch between contexts and namespaces from multiple config files • **Interactive & non-interactive modes**: Select from a list or specify directly as an argument (with tab completion support!) Why ? is an alternative to tools like , and . It has been created because I feel all of those fall short in certain regards: • and assume all your contexts are defined in a single config file. Yes, there is some hackery you can do to your environment variable to make it work with multiple files, but it is (in my opinion) a sub-par workflow and I never really liked it • spawns a new shell when you use it to change contexts, making it practically impossible to integrate into scripts or taskfile automation. Also I consider it to be too complicated of a solution for what is fundamentally a really simple problem What I wanted was something very simple conceptually: I just want to dump all my files in a single directory and then have my tool parse them and "physically" move over the config file to (or whatever is configured in my env var) such that it is also persistent between different shells. Here is where comes in! Installation Install via go install Install the latest stable version directly using Go: > **Note**: Versions prior to v2.2.6 cannot be installed via due to module path issues. If you need an older version, please use one of the alternative installation methods below. Download Precompiled Binaries Precompiled binaries are available for various platforms. You can download the latest release from the GitHub Releases page. • Download the appropriate binary for your system and extract the archive. • Make the extracted binary executable: • Move the binary to a directory in your PATH: Install via Homebrew • Add the tap • Install Running via Docker is also available as a Docker container: To use it with your local kubeconfig files: Build from Source • Clone the repository: • Build the tool: • Move the binary to your PATH: Usage Context Command The (or ) subcommand is used to switch between Kubernetes contexts (think of ): Namespace Command The (or ) subcommand is used to switch the current namespace (think of ): Quickly Switch to Previous Configuration Switch back to the previous configuration: Usage with kubectl plugin When installed as a kubectl plugin, you can use it directly with the command: Configuration uses Viper for configuration management, allowing you to configure the tool via command-line flags or environment variables, with flags taking precedence. Configuration Options | Option | Flag | Environment Variable | Default | Description | | -------------------- | ------------------ | -------------------- | ------------------ | ----------------------------------------------------------------- | | Kubeconfig Directory | | | | Directory containing your kubeconfig files | | Kubeconfig | | | | Path to the currently active kubeconfig file | | Log Level | | | | Logging verbosity (trace, debug, info, warn, error, fatal, panic) | | Log Format | | | | Log output format (text, json) | | Page Size | | | | Number of items to show per page in selection prompts | Shell Completion The subcommand generates shell completion scripts: Contributing Contributions are welcome! Please fork the repository, make your changes, and submit a pull request. License This project is licensed under the MIT License. See the file for details.