Skip to content
forked from sadedil/kvit

Syncs Key and Value pairs between Consul and file system

License

Notifications You must be signed in to change notification settings

ibrahimaydinnet/kvit

 
 

Repository files navigation

Kvit

Build & Test & Pack NuGet (Kvit)

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.

What "Kvit" means?

Kvit name comes from Consul Key Value + Git like usage = KV + Git = kvit

How to install?

.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.

How to use?

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.

TL;DR

  • 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

kvit fetch

Downloads your key/value pairs from your Consul server, and writes all into the current directory.

  • If you omit address then tries to connect http://localhost:8500
  • If you omit token then tries to connect without authentication.
kvit fetch [--address <address>] [--token <token>]

kvit push

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 connect http://localhost:8500
  • If you omit token then tries to connect without authentication.
kvit push [--address <address>] [--token <token>]

How to build & test and run on your computer?

Requirements

  • .NET 5 SDK
  • Docker or a real Consul server (for testing)

Running project locally

Simply run on your IDE or type dotnet run in src/Kvit folder.

Running tests locally

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.

Roadmap

  • A clear README
  • Take a backup before the fetch and push
  • 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

How to contribute?

Free to feel to open issues about your questions and PR thoughts.

About

Syncs Key and Value pairs between Consul and file system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%