Skip to content

Commit

Permalink
add cmds and subcmds, rm flags (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjaudiomv authored Sep 25, 2023
1 parent a97d4f0 commit b18339c
Show file tree
Hide file tree
Showing 26 changed files with 832 additions and 395 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## v0.0.4 (UNRELEASED)
* Allow for listing of current config and context using `-l` and `-lc` flags.
## v0.0.4 (September 25, 2023)
* Allow for listing of current config and context.

## v0.0.3 (September 23, 2023)
* Added support for default config at `~/.kube/config`.
* Added context switcher using `-c` flag.
* Added context switcher.

## v0.0.2 (September 22, 2023)
* Added `KXD_MATCHER` environment variable for specifying different config matchers.
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ By default, Kubeconfig Switcher looks for files with an extension of `.conf`. Yo

## Usage

* See docs for more info [kxd](docs/kxd.md)

### Switching Kubeconfig Files

To switch between different kubeconfig files, use the following command:

```bash
kxd
kxd f s
```

This command will display a list of available kubeconfig files in your `~/.kube` directory. Select the one you want to use.
Expand All @@ -63,7 +65,7 @@ This command will display a list of available kubeconfig files in your `~/.kube`
To switch between Kubernetes contexts within a kubeconfig file, use the following command:

```bash
kxd -c
kxd ctx s
```

This command will display a list of available contexts in your current kubeconfig file. Select the one you want to switch to.
Expand All @@ -74,13 +76,13 @@ This command will display a list of available contexts in your current kubeconfi
To list the currently set Kubeconfig or Kubernetes Context, use the following commands:

```bash
kxd -l
kxd f c
```

This command will display the currently set kubeconfig file.

```bash
kxd -x
kxd ctx c
```

This command will display the currently set Kubernetes Context.
Expand All @@ -90,7 +92,7 @@ This command will display the currently set Kubernetes Context.
To check the version of Kubeconfig Switcher, use the following command:

```bash
kxd -v
kxd version
```

### Show your set kubeconfig in your shell prompt
Expand Down
22 changes: 22 additions & 0 deletions docs/kxd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## kxd

kxd - switch between Kubeconfigs and contexts.

### Synopsis

Allows for switching kubeconfig files and contexts, as well as getting the current set ones.

### Options

```
-h, --help help for kxd
```

### SEE ALSO

* [kxd completion](kxd_completion.md) - Generate the autocompletion script for the specified shell
* [kxd context](kxd_context.md) - Kubeconfig context command
* [kxd file](kxd_file.md) - Kubeconfig file command
* [kxd version](kxd_version.md) - kxd version command

###### Auto generated by spf13/cobra on 25-Sep-2023
25 changes: 25 additions & 0 deletions docs/kxd_completion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## kxd completion

Generate the autocompletion script for the specified shell

### Synopsis

Generate the autocompletion script for kxd for the specified shell.
See each sub-command's help for details on how to use the generated script.


### Options

```
-h, --help help for completion
```

### SEE ALSO

* [kxd](kxd.md) - kxd - switch between Kubeconfigs and contexts.
* [kxd completion bash](kxd_completion_bash.md) - Generate the autocompletion script for bash
* [kxd completion fish](kxd_completion_fish.md) - Generate the autocompletion script for fish
* [kxd completion powershell](kxd_completion_powershell.md) - Generate the autocompletion script for powershell
* [kxd completion zsh](kxd_completion_zsh.md) - Generate the autocompletion script for zsh

###### Auto generated by spf13/cobra on 25-Sep-2023
44 changes: 44 additions & 0 deletions docs/kxd_completion_bash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## kxd completion bash

Generate the autocompletion script for bash

### Synopsis

Generate the autocompletion script for the bash shell.

This script depends on the 'bash-completion' package.
If it is not installed already, you can install it via your OS's package manager.

To load completions in your current shell session:

source <(kxd completion bash)

To load completions for every new session, execute once:

#### Linux:

kxd completion bash > /etc/bash_completion.d/kxd

#### macOS:

kxd completion bash > $(brew --prefix)/etc/bash_completion.d/kxd

You will need to start a new shell for this setup to take effect.


```
kxd completion bash
```

### Options

```
-h, --help help for bash
--no-descriptions disable completion descriptions
```

### SEE ALSO

* [kxd completion](kxd_completion.md) - Generate the autocompletion script for the specified shell

###### Auto generated by spf13/cobra on 25-Sep-2023
35 changes: 35 additions & 0 deletions docs/kxd_completion_fish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## kxd completion fish

Generate the autocompletion script for fish

### Synopsis

Generate the autocompletion script for the fish shell.

To load completions in your current shell session:

kxd completion fish | source

To load completions for every new session, execute once:

kxd completion fish > ~/.config/fish/completions/kxd.fish

You will need to start a new shell for this setup to take effect.


```
kxd completion fish [flags]
```

### Options

```
-h, --help help for fish
--no-descriptions disable completion descriptions
```

### SEE ALSO

* [kxd completion](kxd_completion.md) - Generate the autocompletion script for the specified shell

###### Auto generated by spf13/cobra on 25-Sep-2023
32 changes: 32 additions & 0 deletions docs/kxd_completion_powershell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## kxd completion powershell

Generate the autocompletion script for powershell

### Synopsis

Generate the autocompletion script for powershell.

To load completions in your current shell session:

kxd completion powershell | Out-String | Invoke-Expression

To load completions for every new session, add the output of the above command
to your powershell profile.


```
kxd completion powershell [flags]
```

### Options

```
-h, --help help for powershell
--no-descriptions disable completion descriptions
```

### SEE ALSO

* [kxd completion](kxd_completion.md) - Generate the autocompletion script for the specified shell

###### Auto generated by spf13/cobra on 25-Sep-2023
46 changes: 46 additions & 0 deletions docs/kxd_completion_zsh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## kxd completion zsh

Generate the autocompletion script for zsh

### Synopsis

Generate the autocompletion script for the zsh shell.

If shell completion is not already enabled in your environment you will need
to enable it. You can execute the following once:

echo "autoload -U compinit; compinit" >> ~/.zshrc

To load completions in your current shell session:

source <(kxd completion zsh)

To load completions for every new session, execute once:

#### Linux:

kxd completion zsh > "${fpath[1]}/_kxd"

#### macOS:

kxd completion zsh > $(brew --prefix)/share/zsh/site-functions/_kxd

You will need to start a new shell for this setup to take effect.


```
kxd completion zsh [flags]
```

### Options

```
-h, --help help for zsh
--no-descriptions disable completion descriptions
```

### SEE ALSO

* [kxd completion](kxd_completion.md) - Generate the autocompletion script for the specified shell

###### Auto generated by spf13/cobra on 25-Sep-2023
21 changes: 21 additions & 0 deletions docs/kxd_context.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## kxd context

Kubeconfig context command

### Synopsis

This is the default context command.

### Options

```
-h, --help help for context
```

### SEE ALSO

* [kxd](kxd.md) - kxd - switch between Kubeconfigs and contexts.
* [kxd context current](kxd_context_current.md) - Shows currently set kubeconfig context
* [kxd context switch](kxd_context_switch.md) - Switch kubeconfig contexts

###### Auto generated by spf13/cobra on 25-Sep-2023
23 changes: 23 additions & 0 deletions docs/kxd_context_current.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## kxd context current

Shows currently set kubeconfig context

### Synopsis

This shows the current set kubeconfig context.

```
kxd context current [flags]
```

### Options

```
-h, --help help for current
```

### SEE ALSO

* [kxd context](kxd_context.md) - Kubeconfig context command

###### Auto generated by spf13/cobra on 25-Sep-2023
23 changes: 23 additions & 0 deletions docs/kxd_context_switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## kxd context switch

Switch kubeconfig contexts

### Synopsis

This allows for switching of your kubeconfig context.

```
kxd context switch [flags]
```

### Options

```
-h, --help help for switch
```

### SEE ALSO

* [kxd context](kxd_context.md) - Kubeconfig context command

###### Auto generated by spf13/cobra on 25-Sep-2023
21 changes: 21 additions & 0 deletions docs/kxd_file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## kxd file

Kubeconfig file command

### Synopsis

This is the default file command.

### Options

```
-h, --help help for file
```

### SEE ALSO

* [kxd](kxd.md) - kxd - switch between Kubeconfigs and contexts.
* [kxd file current](kxd_file_current.md) - Shows currently set kubeconfig
* [kxd file switch](kxd_file_switch.md) - Switch kubeconfig

###### Auto generated by spf13/cobra on 25-Sep-2023
23 changes: 23 additions & 0 deletions docs/kxd_file_current.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## kxd file current

Shows currently set kubeconfig

### Synopsis

This shows the current set kubeconfig file.

```
kxd file current [flags]
```

### Options

```
-h, --help help for current
```

### SEE ALSO

* [kxd file](kxd_file.md) - Kubeconfig file command

###### Auto generated by spf13/cobra on 25-Sep-2023
Loading

0 comments on commit b18339c

Please sign in to comment.