Simple cli tool to save your secret stuff.
Install dependencies
$ npm install
Run
$ node index [options] <action> [name] [config]
Use npm link
to create a symlink to run safe
from anywhere
Now you can run
$ safe [options]
Use npm unlink
to remove symlink
action action you want to perform (choices: "add", "remove", "view", "config", "list", "path", "clear")
name entry name
config config arguments
-V, --version output the version number
-t, --type <type> (choices: "text", "account", default: "text")
-f, --file <filename> used with add to insert a file
-o, --output <filename> output entry instead of console log
-s, --safe <filename> safe path
--no-color no color
-h, --help display help for command
When you want to perform any action, If there was no safe file it will be created automatically.
Use -s, --safe <filename>
flag with any action.
Examples:
$ safe add entry -s path/to/file
$ safe clear --safe path/to/file
# Configure default safe path
$ safe config path path/to/file
#=> password: ********
#=> new default safe path: path/to/file
# View default safe path
$ safe path
#=> password: ********
#=> current path: path/to/file
# Configure default safe password
$ safe config password
#=> password: ********
#=> new password: password1
#=> password changed
# Configure password of other safe
$ safe config password -s path/to/file
#=> password: ********
#=> new password: password2
#=> password changed
Save some text:
$ safe add <entry name>
#=> password: ********
#=> your text: example
#=> entry added successfully
Save an account:
$ safe add <entry name> -t account
#=> password: ********
#=> username/email: [email protected]
#=> password: *******
#=> entry added successfully
Save a file:
$ safe add <entry name> -f path/to/file
#=> password: ********
#=> entry added successfully
$ safe view <entry name>
#=> password: ********
#=> example
$ safe view <entry name>
#=> password: ********
#=> username/email: [email protected]
#=> password: example
If entry is a non-text file:
$ safe view <entry name>
#=> password: ********
#=> this entry is a file. would you like to export it ? (Y/N): y
#=> entry exported to file
Export entry to file:
$ safe view <entry name> -o entry.txt
#=> password: ********
#=> entry exported to entry.txt
entry.txt
:
example
$ safe list
#=> password: ********
#=> entry list:
#=> - text1
#=> - account1
#=> - filebin
$ safe remove <entry name>
#=> password: ********
#=> are you sure you want to remove "<entry name>" ? (Y/N): y
#=> entry removed successfully
$ safe clear
#=> password: ********
#=> are you sure you want to clear the safe ? (Y/N): y
#=> safe cleared successfully
This package uses chalk for terminal string styling. To disable it, simply use --no-color
flag.