Kvit helps you to sync your key and value pairs between HashiCorp Consul and file system easily. It's developed as an open source CLI app.
Kvit name comes from Consul Key Value + Git like usage = KV + Git = kvit
.NET 5 runtime is a prerequisite. And can be downloaded from here.
Kvit developed as a cross platform console app with .NET 5. You can easily install as a global cli tool.
# Install if not installed, update to the last version if already installed
dotnet tool update -g kvit
This command pulls the latest Kvit binary from NuGet. And add this binary to your path.
After the install, you can easily execute by typing kvit
to your favorite terminal. When you run without a parameter, you can see the basic usage information.
- Use
kvit fetch
and download all key values to current folder - Edit this files or add new ones with your favorite text editor
- Then use
kvit push
to upload all to your Consul server
Downloads your key/value pairs from your Consul server, and writes all into the current directory.
- If you omit
address
then tries to connecthttp://localhost:8500
- If you omit
token
then tries to connect without authentication.
kvit fetch [--address <address>] [--token <token>]
Uploads your key/value pairs from current directory to your Consul server.
Currently kvit not supports deletion of key value pairs (This feature is in our roadmap)
- If you omit
address
then tries to connecthttp://localhost:8500
- If you omit
token
then tries to connect without authentication.
kvit push [--address <address>] [--token <token>]
- .NET 5 SDK
- Docker or a real Consul server (for testing)
Simply run on your IDE or type dotnet run
in src/Kvit
folder.
To run Integration tests, you will need a Consul running on port 8900
. Easiest way to do this, using Docker.
docker run -d --name=consul-for-kvit-testing -p 8900:8500 consul
After then, you can simply run tests on your IDE or type dotnet test
in project's root folder.
- A clear README
- Take a backup before the
fetch
andpush
- Add diff support before push to see what's different between local folder and remote Consul server
- Add confirmation messages for commands like "Do you want to continue?"
- Support the deletion of keys and values from Consul when they were deleted from local folder
Free to feel to open issues about your questions and PR thoughts.