Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shell completion docs in the README #13

Merged
merged 2 commits into from
Dec 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Create your `.gogok8s.yaml` config file by using the `configure` command.

<p align="center"><img src="/img/gogok8s-configure.gif?raw=true" alt="gogok8s-configure-demo"/></p>

# Example Config
## Example Config

An example gogok8s config might look something like this:

Expand Down Expand Up @@ -60,7 +60,7 @@ Each entry in `accounts` has the following fields:
named `${name}.${region}.${clusterName}`. For example, if the `Dev` account within the config file above had a cluster
within the `us-east-1` region named `test-v1.20`, the kubeconfig context would be named `Dev.us-east-1.test-v1.20`.

# Syncing Clusters
## Syncing Clusters

Running `gogok8s sync [accounts]` will look for EKS clusters in each account (and region) and fetch the necessary
details to craft a kubeconfig cluster/user/context for connecting to the cluster. When no accounts are passed, all
Expand All @@ -75,12 +75,24 @@ the `Dev` & `Staging` accounts you can run:
gogok8s sync Dev Staging
```


# Editing the Format
## Editing the Format

The `format` field supports some customization as to how the kubeconfig clusters, users, and contexts are named. The
following variables can be included as part of the format:
- `${name}` - The account name
- `${region}` - The AWS region of the cluster
- `${clusterName}` - The EKS cluster name
- `${clusterArn}` - The EKS cluster arn

## Shell Completions
Gogok8s uses [Cobra](https://github.com/spf13/cobra) and comes bundled with completions for the following shells:
- `bash`
- `fish`
- `powershell`
- `zsh`

Check out the instructions for adding completions for your preferred shell by running the following command (replacing `$YOUR_SHELL` with one from the list above):

```bash
gogok8s completion $YOUR_SHELL --help
```
2 changes: 1 addition & 1 deletion internal/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var (
var rootCmd = &cobra.Command{
Use: "gogok8s",
Short: "gogok8s helps manage your k8s cluster kubeconfig(s)",
Version: "v0.0.5",
Version: "v0.0.6",
}

func init() {
Expand Down