Merge pull request #293 from ryan4yin/feat/genpass-nu-command

feat(shells): add genpass nu command to generate random passwords
This commit is contained in:
ryan4yin | 二花 authored and GitHub committed 2026-09-21 17:14:48 +08:00
1 parent 8427dee2e6
commit 621da40081
1 file changed
+6
+6
View File
@@ -88,6 +88,12 @@ def dus [path: string = ""] {
}
}
# Generate a secure random base64 password of `length` characters (default 12).
def genpass [length: int = 12] {
let bytes = (($length * 3 + 2) / 4 | math ceil) + 3
^openssl rand -base64 $bytes | str trim | str substring 0..<$length
}
# ---------------------------
# Commandline Editor Settings
# ---------------------------