{"id":13449433,"url":"https://github.com/sbstp/kubie","last_synced_at":"2025-04-23T20:48:51.140Z","repository":{"id":37309071,"uuid":"239002506","full_name":"sbstp/kubie","owner":"sbstp","description":"A more powerful alternative to kubectx and kubens","archived":false,"fork":false,"pushed_at":"2025-04-15T16:58:36.000Z","size":3981,"stargazers_count":2197,"open_issues_count":51,"forks_count":109,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-20T13:52:24.983Z","etag":null,"topics":["kubectl","kubectx","kubens","kubernetes"],"latest_commit_sha":null,"homepage":"https://blog.sbstp.ca/introducing-kubie/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbstp.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-07T19:01:42.000Z","updated_at":"2025-04-19T22:44:28.000Z","dependencies_parsed_at":"2023-11-20T19:36:04.665Z","dependency_job_id":"9273e2c7-9bd6-4dc7-91c4-3de6e97c4085","html_url":"https://github.com/sbstp/kubie","commit_stats":{"total_commits":243,"total_committers":35,"mean_commits":6.942857142857143,"dds":0.7695473251028806,"last_synced_commit":"fbafa063ba7fd30e2c25f696e607a882ea4d324e"},"previous_names":[],"tags_count":55,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstp%2Fkubie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstp%2Fkubie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstp%2Fkubie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstp%2Fkubie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbstp","download_url":"https://codeload.github.com/sbstp/kubie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250513710,"owners_count":21443204,"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","kubectx","kubens","kubernetes"],"created_at":"2024-07-31T06:00:38.488Z","updated_at":"2025-04-23T20:48:51.120Z","avatar_url":"https://github.com/sbstp.png","language":"Rust","funding_links":[],"categories":["Rust","kubernetes","Developer Workspaces \u0026 Productivity"],"sub_categories":[],"readme":"# Kubie\n\u003cimg src=\"./assets/logo.svg\" align=\"right\"/\u003e\n\n`kubie` is an alternative to `kubectx`, `kubens` and the `k on` prompt modification script. It offers context switching,\nnamespace switching and prompt modification in a way that makes each shell independent from others. It also has\nsupport for split configuration files, meaning it can load Kubernetes contexts from multiple files. You can configure\nthe paths where kubie will look for contexts, see the [settings](#settings) section.\n\nKubie also has other nice features such as `kubie exec` which allows you to execute commands in a context and a\nnamespace without having to spawn a shell and `kubie lint` which scans your k8s config files for issues and informs\nyou of what they are.\n\n* [Installation](#installation)\n* [Usage](#usage)\n* [Settings](#settings)\n* [Future plans](#future-plans)\n\nThanks to [@ahermant](https://github.com/ahermant) for the lovely logo!\n\n## Installation\n\n### Binary\nYou can download a binary for Linux or OS X on the [GitHub releases page](https://github.com/sbstp/kubie/releases). You\ncan use `curl` or `wget` to download it. Don't forget to `chmod +x` the file!\n\n### Cargo\nYou can build `kubie` from source using `cargo` and crates.io. If you do not have a Rust compiler installed, go to\n[rustup.rs](https://rustup.rs) to get one. Then you can run `cargo install kubie` and kubie will be downloaded from\ncrates.io and then built.\n\n### Homebrew\nYou can install `kubie` from Homebrew by running `brew install kubie`.\n\n### MacPorts\nYou can also install `kubie` from [MacPorts](https://www.macports.org) by running `sudo port install kubie`.\n\n### Nix\nThere is a `kubie` Nix package maintained by @illiusdope that you can install.\n\n### Arch Linux\n`kubie` is available in the [extra repository](https://archlinux.org/packages/extra/x86_64/kubie/) and it can be installed by running `pacman -S kubie`.\n\n### Autocompletion\n\n#### Bash\n\nIf you want autocompletion for `kubie ctx`, `kubie ns` and `kubie exec`, please install this script:\n```bash\nsudo cp ./completion/kubie.bash /etc/bash_completion.d/kubie\n```\n\nThen spawn new shell or source copied file:\n```bash\n. /etc/bash_completion.d/kubie\n```\n\n#### Fish\n\nInstall the completions script [kubie.fish](completion/kubie.fish) by copying it, eg.:\n\n```bash\ncp completion/kubie.fish ~/.config/fish/completions/\n```\n\nThen reopen fish or source the file.\n\n## Usage\nSelectable menus will be available when using `kubie ctx` and `kubie ns`.\n\n---\n\n* `kubie ctx` display a selectable menu of contexts\n* `kubie ctx \u003ccontext\u003e` switch the current shell to the given context (spawns a shell if not a kubie shell)\n* `kubie ctx -` switch back to the previous context\n* `kubie ctx \u003ccontext\u003e -r` spawn a recursive shell in the given context\n* `kubie ctx \u003ccontext\u003e -n \u003cnamespace\u003e` spawn a shell in the given context and namespace\n* `kubie ns` display a selectable menu of namespaces\n* `kubie ns \u003cnamespace\u003e` switch the current shell to the given namespace\n* `kubie ns -` switch back to the previous namespace\n* `kubie ns \u003cnamespace\u003e -r` spawn a recursive shell in the given namespace\n* `kubie exec \u003ccontext\u003e \u003cnamespace\u003e \u003ccmd\u003e \u003cargs\u003e...` execute a command in the given context and namespace\n* `kubie exec \u003cwildcard\u003e \u003cnamespace\u003e \u003ccmd\u003e \u003cargs\u003e...` execute a command in all the contexts matched by the wildcard and\n  in the given namespace\n* `kubie exec \u003cwildcard\u003e \u003cnamespace\u003e -e \u003ccmd\u003e \u003cargs\u003e...` execute a command in all the contexts matched by the wildcard and\n  in the given namespace but fail early if any of the commands executed return a non-zero exit code\n* `kubie export \u003ccontext\u003e \u003cnamespace\u003e` prints the path to an isolated config file for a context and namespace\n* `kubie edit` display a selectable menu of contexts to edit\n* `kubie edit \u003ccontext\u003e` edit the file that contains this context\n* `kubie edit-config` edit kubie's own config file\n* `kubie lint` lint k8s config files for issues\n* `kubie info ctx` print name of current context\n* `kubie info ns` print name of current namespace\n* `kubie info depth` print depth of recursive contexts\n* `kubie update` will check the latest kubie version and update your local installation if needed\n\n## Settings\nYou can customize kubie's behavior with the `~/.kube/kubie.yaml` file. The settings available and their defaults are\navailable below.\n\n```yaml\n# Force kubie to use a particular shell, if unset detect shell currently in use.\n# Possible values: bash, dash, fish, xonsh, zsh\n# Default: unset\nshell: bash\n\n# For the commands `kubie edit/edit-config`\n# Possible values: Any installed text editor\n# Default: unset\ndefault_editor: vim\n\n# Configure where to look for kubernetes config files.\nconfigs:\n\n    # Include these globs.\n    # Default: values listed below.\n    include:\n        - ~/.kube/config\n        - ~/.kube/*.yml\n        - ~/.kube/*.yaml\n        - ~/.kube/configs/*.yml\n        - ~/.kube/configs/*.yaml\n        - ~/.kube/kubie/*.yml\n        - ~/.kube/kubie/*.yaml\n\n    # Exclude these globs.\n    # Default: values listed below.\n    # Note: kubie's own config file is always excluded.\n    exclude:\n        - ~/.kube/kubie.yaml\n\n# Prompt settings.\nprompt:\n    # Disable kubie's custom prompt inside of a kubie shell. This is useful\n    # when you already have a prompt displaying kubernetes information.\n    # Default: false\n    disable: false\n\n    # When using recursive contexts, show depth when larger than 1.\n    # Default: true\n    show_depth: true\n\n    # When using zsh, show context and namespace on the right-hand side using RPS1.\n    # Default: false\n    zsh_use_rps1: false\n\n    # When using fish, show context and namespace on the right-hand side.\n    # Default: false\n    fish_use_rprompt: false\n\n    # When using xonsh, show context and namespace on the right-hand side.\n    # Default: false\n    xonsh_use_right_prompt: false\n\n# Behavior\nbehavior:\n    # Namespace validation and switching behavior.  Set to \"false\" if you do not have\n    # the right to list namespaces.\n    # Valid values:\n    #   true:    Make sure the namespace exists with `kubectl get namespaces`.\n    #   false:   Switch namespaces without validation.\n    #   partial: Check for partial matches when running `kubie ns \u003cnamespace\u003e`\n    #            and no exact match is found:\n    #              - if exactly one namespace partially matches, switch to that namespace\n    #              - if multiple namespaces partially match, select from those\n    # Default: true\n    validate_namespaces: true\n\n    # Enable or disable the printing of the 'CONTEXT =\u003e ...' headers when running\n    # `kubie exec`.\n    # Valid values:\n    #   auto:   Prints context headers only if stdout is a TTY. Piping/redirecting\n    #           kubie output will auto-disable context headers.\n    #   always: Always prints context headers, even if stdout is not a TTY.\n    #   never:  Never prints context headers.\n    # Default: auto\n    print_context_in_exec: auto\n\n# Optional start and stop hooks\nhooks:\n    # A command hook to run when a CTX is started.  \n    # This example re-labels your terminal window\n    # Default: none\n    start_ctx: \u003e\n        echo -en \"\\033]1; `kubie info ctx`|`kubie info ns` \\007\"\n\n    # A command hook to run when a CTX is stopped\n    # This example sets the terminal back to the shell name\n    # Default: none\n    stop_ctx: \u003e\n        echo -en \"\\033]1; $SHELL \\007\"\n\n```\n\n## For distro maintainers\nSince `0.19.0`, the self update functionality is behind a feature. You can use `cargo build --release --no-default-features`\nto produce a binary without the self update functionality. It's probably better if people rely on the distro's package\nmanager for updates over this functionality. The binary produced is also quite smaller since it has fewer dependencies.\n\n## Future plans\n* Integration with vault to automatically download k8s configs from a vault server\n* Import/edit configs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbstp%2Fkubie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbstp%2Fkubie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbstp%2Fkubie/lists"}