Example Golang app that has a CLI implemented using Cobra and configuration managed by Viper. Cobra: https://github.com/spf13/cobra Viper: https://github.com/spf13/viper
- Golang
- Read from a config file
- Read from environment variables
- Have defaults.
- Unmarshal config into a struct.
- Viper also has support for writing the config out to a file: https://github.com/spf13/viper#writing-config-files