Skip to content

flathead/passgen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

passgen

Interactive terminal password generator with TUI, clipboard support, and DB-safe mode.

Документация на русском

Features

  • 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

Install

curl -fsSL https://raw.githubusercontent.com/flathead/passgen/master/install.sh | bash

This clones the repo to ~/.local/share/passgen and creates a symlink at ~/.local/bin/passgen.

To update: cd ~/.local/share/passgen && git pull

Manual install

git clone https://github.com/flathead/passgen.git ~/.local/share/passgen
ln -sf ~/.local/share/passgen/passgen ~/.local/bin/passgen

Requirements

  • Bash 4+
  • coreutils (base64, sha256sum, shuf, tr)
  • Optional: wl-copy / xclip / pbcopy for clipboard

Usage

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)

CLI Options

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

TUI Hotkeys

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

DB-safe Mode (Shift+)

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)

Character Sets

Full (default): _ . ~ ^ , ( ) [ ] { } @ # ! ? - + alphanumeric

DB-safe: _ . - + alphanumeric

Excluded (always): $ ` \ ' " ; & | < > * % + = : /

Config

Language preference is stored in ~/.config/passgen/config.

Uninstall

curl -fsSL https://raw.githubusercontent.com/flathead/passgen/master/install.sh | bash -s -- --uninstall

Or manually:

rm ~/.local/bin/passgen
rm -rf ~/.local/share/passgen
rm -rf ~/.config/passgen

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages