feat(cli): add scripts for KeePass password management
- Add `get-pass-from-keepass` script to retrieve passwords from KeePass entries - Add `save-pass-to-keepass` script to store passwords in KeePass entries - Update library.md documentation with new KeePass utility functions - Include usage examples and descriptions for new password management tools
This commit is contained in:
3 files changed
+38
No files matched your search
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
get-pass-from-keepass() {
|
||||
if [[ -z "$1" ]]; then echo "\$1 is empty."; exit; fi
|
||||
local keepass_entry="$1"
|
||||
|
||||
keepassxc-cli show --show-protected --attributes Password \
|
||||
--key-file "$KEEPASS_DATABASE_KEY_FILE" \
|
||||
"$KEEPASS_DATABASE_FILE" \
|
||||
"$keepass_entry"
|
||||
}
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
save-dotenv-to-keepass() {
|
||||
if [[ -z "$1" ]]; then echo "\$1 is empty."; exit; fi
|
||||
if [[ -z "$2" ]]; then echo "\$2 is empty."; exit; fi
|
||||
local password="$1"
|
||||
local keepass_entry="$2"
|
||||
|
||||
echo "Save password to keepass entry: $keepass_entry"
|
||||
keepassxc-cli add \
|
||||
--key-file "$KEEPASS_DATABASE_KEY_FILE" \
|
||||
--password "$password" \
|
||||
"$KEEPASS_DATABASE_FILE" \
|
||||
"$KEEPASS_ENTRY"
|
||||
}
|
||||
Reference in new issue
Block a user