cachette
is a handy tool that facilitates CRUD(create/retrieve/update/delete)
operations on frequently accessed data for daily use. It features:
- Simplicity
Storing data in key/value form makes information access simple.
- Convenience
Data can not only be accessed by an exact key, but also by a fuzzy one.
For example, the value "324 Water St. New York, NY 10002" mapped by "home address" can alternatively be retrieved by "ha"(home address).
Besides, the matched data are automatically copied into system clipboard, so that they can easily be pasted into any desired area.
- Safety
For safety, the clipboard containing the sensitive data will be cleared in 10 seconds.
Without doubt, all data are encrypted by AES.
As for password, Mac OS users can store one in Keychain(make sure its account name
is the current user name and its service name is cachette
).
Unfortunately, Linux or Windows' users will have to type a password manually(which is
inconvenient), or pass a password as an option(which is unsafe).
Basically, the command is: cachette [OPTION]... [key [value]]
, where
key
is the key used to be retrieved(fuzzy by default) or updated(exact match),
and value
is the new value for the given key
.
All supported options are listed as follows:
-
-a list all matched data
-
-c CMT attach comments
-
-d KEY delete the data mapped by the key(exact)
-
-D KEY delete the data mapped by the key(regex)
-
-e exact key match in data retrieval
-
-f FILE data file's path(default file is set by environment variable
CACHETTE
) -
-n NOT copy into clipboard in data retrieval(imply "-s")
-
-p PWD password for data encryption
-
-s write the data to the stdout in addition to clipboard
-
-S stylize the output(for list only)
-
-t SEC seconds for data to be kept in the clipboard(default is 10, 0 means forever)
-
List all data(warning: unsafe):
cachette
-
List all keys:
cachette -k
-
Copy the first(ordered by key) value matched by
key1
(fuzzy) to the system clipboard:cachette key1
-
List all data matched by
key1
(fuzzy, of course):cachette -a key1
-
Copy the value matched by
key1
(exact) to the system clipboard:cachette -e key1
-
Copy the value matched by
key1
(fuzzy), keep it in the system clipboard for 1 minute:cachette -t60 key1
-
Copy the value matched by
key1
(fuzzy), don't clear the system clipboard:cachette -t0 key1
-
Copy the value matched by
key1
(fuzzy) to the system clipboard and print it on the screen:cachette -s key1
-
Only print(NOT copy) the value matched by
key1
(fuzzy):cachette -n key1
-
Map
key1
to thevalue1
:cachette key1 value1
-
Map
key1
to thevalue1
with a given comment:cachette key1 value1 -c"this is a comment"
-
Delete the data mapped by
key1
:cachette -d key1
-
Delete all the data mapped by regex
^key[1-9]
:cachette -D '^key[1-9]'
Copyright 2014-2015 Hui Zheng
Released under the MIT License.