Interactive terminal password generator with TUI, clipboard support, and DB-safe mode.
- Interactive TUI with color-coded output
- DB-safe passwords for MySQL/MariaDB (no shell-breaking characters)
- Bilingual interface (English / Russian) with runtime switching
- Clipboard integration (wl-copy, xclip, pbcopy)
- Base64 and SHA-256 display
- Password strength meter
- History navigation (up to 50 entries)
- Length presets (4-64) and custom length (4-128)
- CLI mode for scripting and piping
curl -fsSL https://raw.githubusercontent.com/flathead/passgen/master/install.sh | bashThis clones the repo to ~/.local/share/passgen and creates a symlink at ~/.local/bin/passgen.
To update: cd ~/.local/share/passgen && git pull
git clone https://github.com/flathead/passgen.git ~/.local/share/passgen
ln -sf ~/.local/share/passgen/passgen ~/.local/bin/passgen- Bash 4+
- coreutils (
base64,sha256sum,shuf,tr) - Optional:
wl-copy/xclip/pbcopyfor clipboard
passgen # Interactive TUI
passgen -l 32 -c # Generate 32-char password, copy to clipboard
passgen -d -l 24 # DB-safe password (MySQL/MariaDB)
passgen -q | cmd # Pipe password to another program
passgen -s -l 16 # Simple (alphanumeric only)| Option | Description |
|---|---|
-l, --length N |
Password length (default: 24, range: 4-128) |
-s, --simple |
Letters and digits only |
-d, --db-safe |
DB-safe password (MySQL/MariaDB compatible) |
-c, --copy |
Copy to clipboard |
-q, --quiet |
Print only password |
-n, --no-newline |
No trailing newline |
-i, --interactive |
Force TUI mode |
-h, --help |
Show help |
| Key | Action |
|---|---|
r / Enter / Space |
Generate new password |
c |
Copy password to clipboard |
b |
Copy Base64 |
h |
Copy SHA-256 |
+ / - |
Adjust length (+/-4) |
s |
Toggle special characters |
l |
Switch language (EN/RU) |
< / > |
Navigate history |
1-8 |
Length presets (4, 8, 12, 16, 24, 32, 48, 64) |
9 / 0 |
Simple / With specials |
? |
Help screen |
q / Ctrl+C |
Quit |
For MySQL, MariaDB, PostgreSQL, and other databases where special characters in passwords can cause quoting issues:
| Key | Action |
|---|---|
R (Shift+R) |
Generate DB-safe password |
C (Shift+C) |
Generate DB-safe + copy |
B (Shift+B) |
Generate DB-safe + copy Base64 |
H (Shift+H) |
Generate DB-safe + copy SHA-256 |
DB-safe charset: A-Z a-z 0-9 _ . - (no quotes, backslashes, or shell metacharacters)
Full (default): _ . ~ ^ , ( ) [ ] { } @ # ! ? - + alphanumeric
DB-safe: _ . - + alphanumeric
Excluded (always): $ ` \ ' " ; & | < > * % + = : /
Language preference is stored in ~/.config/passgen/config.
curl -fsSL https://raw.githubusercontent.com/flathead/passgen/master/install.sh | bash -s -- --uninstallOr manually:
rm ~/.local/bin/passgen
rm -rf ~/.local/share/passgen
rm -rf ~/.config/passgenMIT