Coder Social home page Coder Social logo

kvit's Introduction

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 keys and values to current folder
  • Edit this files or add new ones with your favorite text editor
  • Optionally use kvit diff to see which files are changed
  • Optionally use kvit compare <file> to see which part of your content is different between file system and consul
  • Then use kvit push to upload all to your Consul server

Most kvit commands requires this two parameters: address and token

  • If you omit address then tries to connect http://localhost:8500
  • If you omit token then tries to connect without authentication.

kvit fetch

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

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)

kvit push [--address <address>] [--token <token>]

kvit diff

Compares keys between Consul and current directory and prints a summary.

  • If you add --all option, it displays all files in directory, otherwise only display different or missing ones.
kvit diff [--address <address>] [--token <token>] [--all]

kvit compare

Compares the content of key between Consul and file system.

  • <file> is a required parameter. You should use the relative path of your current directory. For example kvit compare folder1/file1.
kvit compare [--address <address>] [--token <token>] <file>

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

If you don't have Docker on your system, you can download Consul and run command below

consul agent -dev -http-port=8900

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.

kvit's People

Contributors

sadedil avatar ibrahimaydinnet avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.