Simple CLI tool written in Go to import a .env file in Consul.
go get -u github.com/jordyv/consul-dotenv-import
$ consul-dotenv-import -h
Usage: consul-dotenv-import <options> <env file>
-dry
Dry run (don't actual put values in Consul)
-host string
Consul host (default "http://127.0.0.1:8500")
-prefix string
Consul KV prefix
-token string
Consul token
Env file:
TEST=foo
BAR=test
Run:
$ consul-dotenv-import -prefix testenv .env
Putting testenv/TEST = foo
Putting testenv/BAR = test
$ git clone https://github.com/jordyv/consul-dotenv-import
$ cd consul-dotenv-import
$ dep ensure
$ go run main.go