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:
Janik von Rotz committed 2025-11-14 16:44:29 +01:00
1 parent 73fbce4352
commit 71b3e85580
3 files changed
+38

No files matched your search

+11
View File
@@ -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"
}
+15
View File
@@ -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"
}