From 2e3d6f561881ec91d721947530f1b14c0f86367f Mon Sep 17 00:00:00 2001 From: Kevin Glasson Date: Tue, 29 Sep 2020 23:31:30 +0800 Subject: [PATCH] Update README and fix some typos. --- README.md | 27 +++++++++++++++++++-------- cmd/root.go | 4 ++-- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 8aabc45..98676b9 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,9 @@ Usage: goss [command] Available Commands: + completion Generate completion script delete Delete parameters + env Load parameters into the environment and run a command help Help about any command import Import parameters from a file list List parameters @@ -166,19 +168,28 @@ goss list -p / --json | jq '.[].Name' | xargs -n1 -- goss delete -n Import allows reading a file into the parameter store. - All parameters from the file must be stored as the same type i.e. String or SecretString etc. -- Currently only `dotenv` key-value style files are supported. **However** the parsers are already accessible in the code for the other 3 major formats - I just need create a flag to allow a choice of input format. +- Multiple file formats are supported through the `--format` which is by default set to `dotenv`. Other supported formats include `json`, `toml` and `yaml`. See the table below for an overview. +- **Only flat data structures are supported currently** + +#### File format support +| File format | Currently supported | +| :---------: | :-----------------: | +| dotenv | yes | +| json | yes | +| toml | yes | +| yaml | yes | + +An example command using the default `dotenv` import type. ```bash goss import -f test.env -p /envs/dev -t SecureString ``` -#### File format support -| File format | Currently supported | -| :---------: | ------------------- | -| dotenv | yes | -| json | soon! | -| toml | soon! | -| yaml | soon! | +An example using a toml file +```bash +goss import -f test.toml -p /envs/dev -t SecureString --format toml +``` + ## Why? I made this tool because although **chamber** is an excellent tool - it uses **viper** underneath and the problem with **viper** is that the keys are **CASE INSENSITIVE** which for me was unacceptable. So I decided to *roll-my-own* using the wonderful [**koanf**](https://github.com/knadh/koanf) library to manage the deserialisation of various config files. diff --git a/cmd/root.go b/cmd/root.go index 83a6d99..870981e 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -17,12 +17,12 @@ var ( // rootCmd represents the base command when called without any subcommands rootCmd = &cobra.Command{ Use: "goss", - Short: "goss in an AWS SSM Paramter Store manager", + Short: "goss is an AWS SSM Parameter Store manager", Long: `goss is used to interact with the AWS SSM Parameter Store in a variety of helpful ways. You can interact in bulk through the 'import' sub-command to import parameters -directly from a local file. +directly from a local file in many common formats. You can also interact with paths individually to list, put and delete parameters.