Skip to content

Instantly share code, notes, and snippets.

@alien35
Last active March 31, 2018 15:22
Show Gist options
  • Save alien35/00057bf58998c710895b01a2ad044feb to your computer and use it in GitHub Desktop.
Save alien35/00057bf58998c710895b01a2ad044feb to your computer and use it in GitHub Desktop.
My keybase CLI shortcuts
alias k="keybase"
function _keybase_error_message {
echo "Error parsing command line arguments: "
}
function _keybase_encrypt_usage_message {
echo "USAGE:"
echo "\t ke [command option] <input file> [command option] <destination file> [optional] <username>"
}
function kd {
if [ -z "$1" ]
then
_keybase_error_message
echo "input file missing."
echo "USAGE:"
echo "\t kd [command option] <input file>"
else
keybase decrypt -i "$1"
fi
}
function ke {
if [ -z "$1" ]
then
_keybase_error_message
echo "input file missing."
_keybase_encrypt_usage_message
elif [ -z "$2" ]
then
_keybase_error_message
echo "destination file missing."
_keybase_encrypt_usage_message
else
if [ -z "$3" ]
then
keybase encrypt alien35 -i "$1" -o "$2"
else
keybase encrypt "$3" -i "$1" -o "$2"
fi
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment