kv can remember it for you, wholesale

kv

I've started using a groovy little command-line utility found on the internet, and I have to say I am totally enamored of it.

It was brought to my nebulous attention by my conspirator Rhys, who has it in his 'util' folder of little tools, which I've hg cloned onto my own machine and en-pathed.

The tool in question is 'kv', which is short for 'KeyValue'. You can get it here:


kv.codeplex.com


Imagine you have a lot of ugly things to remember. I know you do.

For example you may need to remember (and frequently type out) the name of your 'dev' server, prod server, staging server, test server and so on.

Get kv to remember it for you!

At a prompt, type:

kv dev MaxServer0412_Tangerine

Now we've stored the rather cumbersome and hard to remember value 'MaxServer0412_Tangerine' against the nice little key name, 'dev'.

So when you type:

kv dev

Two things will happen: the value will get written out into the console. Okay, sure, whatever. But far better than that: the value will get put into your clipboard.

Rhys uses this to store his jargon file. He works in an industry with a lot of domain specific jargon. Every time he hears a new abbreviation that the business people expect him to know, he adds it to his kv stash.

Also - the values don't have to be simple things. They can be gigantic stuff, for example: the complete works of shakespeares. You can pipe a value, or an entire file into the kv command, just give it a key to use.

type 'completeWorks_of_shakespeare.txt' | kv shakes

If you want it to forget one its keys, use the -r switch:

kv -r shakes 

Provenance

The tool itself is based on 'boo' by stevenleeg which is itself based on boom by Zach Holman.

It's clearly better than both of those as it has an even shorter name. None of this three or four letter nonsense. Two letters. That's enough.

Here's the help it provides at the commandline:

>kv -?

kv -- a command-line key-value store integrated with the clipboard.
inspired by: https://github.com/stevenleeg/boo

usage:

kv name fred smith
saves the value, 'fred smith' under the key, 'name'

kv name
retrieve the value 'fred smith' straight to your clipboard.

kv
lists all keys

kv -r name
will remove the key 'name' (and its value) from your store

And two more tips, for super users:

1. You can also pipe a value in, e.g.

echo Hello Fred | kv Greeting
will store 'Hello Fred' under the key 'Greeting'
type File.xml | kv myFile
will store the content of 'File.xml' under the key 'myFile'

Even though, as I say, I found this after it was recommended by a friend, I have to admit that it's my own tool. I wrote it last year in an hour or so, as a simple demo of a little interface I was dabbling with at the time, called stashy. I immediately forgot about it until Rhys rediscovered it.

Utils Folders! Utils Folders! Utils Folders! Utils Folders!

Rhys's 'util' folder is a thing of joy. I think he should make it globally available so people everywhere can clone it, fork it and so on.

I even have a name for it: Rhys's Pieces. Clever hey, Rhys?

Got any little tools in your own utils folder?

Or any way you share your utils folder?



[Image above is of a KV Tank (Kliment Voroshilov), no relation.]

 

I'm currently writing a book about how to build your first product. If building a product is something you'd like to do, then sign up to be notified when the book is available.

Your comment, please?

Your Name
Your Url (optional)
Note: I may edit, reuse or delete your comment. Don't be mean.