mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-07-19 09:39:36 +00:00
Update readmes
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
parent
6e2f181518
commit
d1c04555f4
20
README.md
20
README.md
@ -14,7 +14,7 @@ USAGE:
|
|||||||
Purpose of this project is to provide an utility and facilitate discussion
|
Purpose of this project is to provide an utility and facilitate discussion
|
||||||
about how `kubectl` can manage contexts better.
|
about how `kubectl` can manage contexts better.
|
||||||
|
|
||||||
## Example
|
## Usage
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ kubectx minikube
|
$ kubectx minikube
|
||||||
@ -31,11 +31,23 @@ Context "dublin" set.
|
|||||||
Aliased "gke_ahmetb_europe-west1-b_dublin" as "dublin".
|
Aliased "gke_ahmetb_europe-west1-b_dublin" as "dublin".
|
||||||
```
|
```
|
||||||
|
|
||||||
[Set up `bash` and `zsh` completion →](completion/README.md)
|
`kubectx` also supports <kbd>Tab</kbd> completion, which helps with long context
|
||||||
|
names.
|
||||||
|
|
||||||
### Help wanted
|
## Installation
|
||||||
|
|
||||||
- [ ] homebrew formula/tap that installs the script and completions
|
For macOS:
|
||||||
|
|
||||||
|
> Use [Homebrew](https://brew.sh/) package manager:
|
||||||
|
>
|
||||||
|
> brew tap ahmetb/kubectx https://github.com/ahmetb/kubectx.git
|
||||||
|
> brew install kubectx
|
||||||
|
> this will also set up bash/zsh completion scripts automatically.
|
||||||
|
|
||||||
|
Other platforms:
|
||||||
|
|
||||||
|
> Download the `kubectx` script, make it executable and add it to your PATH. You
|
||||||
|
> can also install bash/zsh [completion scripts](completion/) manually.
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
@ -1,45 +0,0 @@
|
|||||||
kubectx provides shell completion scripts to complete context names, making it
|
|
||||||
even faster to switch between contexts easily.
|
|
||||||
|
|
||||||
## Bash setup
|
|
||||||
|
|
||||||
Copy the `kubectx.bash` file to your HOME directory:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cp kubectx.bash ~/.kubectx.bash
|
|
||||||
```
|
|
||||||
|
|
||||||
And source it in your `~/.bashrc` file by adding the line:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
[ -f ~/.kubectx.bash ] && source ~/.kubectx.bash
|
|
||||||
```
|
|
||||||
|
|
||||||
Start a new shell, type `kubectx`, then hit <kbd>Tab</kbd> to see the existing
|
|
||||||
contexts.
|
|
||||||
|
|
||||||
You can Add `TAB: menu-complete` to your `~/.inputrc` to cycle through the
|
|
||||||
options with <kbd>Tab</kbd>.
|
|
||||||
|
|
||||||
## Zsh setup
|
|
||||||
|
|
||||||
`zsh` can leverage the `bash` completion scripts. Copy the `kubectx.bash` file
|
|
||||||
to your HOME directory:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cp kubectx.bash ~/.kubectx.bash
|
|
||||||
```
|
|
||||||
|
|
||||||
And add the following to your `.zshrc`:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
[ -f ~/.kubectx.bash ] && source ~/.kubectx.bash
|
|
||||||
```
|
|
||||||
|
|
||||||
Start a new shell, type `kubectx`, then hit <kbd>Tab</kbd> to see the existing
|
|
||||||
contexts. If it does not work, modify the line above to:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
[ -f ~/.kubectx.bash ] && autoload bashcompinit && bashcompinit && \
|
|
||||||
source ~/.kubectx.bash
|
|
||||||
```
|
|
Loading…
Reference in New Issue
Block a user