key-gen is an interactive, dependency-free Python 3 password and memorable-key generator. It uses Python's secrets module rather than random and provides conventional passwords with lengths from 8–32, security levels 1–25, and batches of 1–75 results.
key-gen.py— the program.install-key-gen.sh— installer/uninstaller for thekey-genterminal command.
The art and signature are automatically centered at the top of the loading screen and interactive screens.
Open a terminal in the directory containing both files.
chmod +x install-key-gen.sh
./install-key-gen.sh --userIf the installer says ~/.local/bin is not in your PATH, add this line to ~/.profile:
export PATH="$HOME/.local/bin:$PATH"Then close and reopen the terminal (or run source ~/.profile).
This places the command in /usr/local/bin:
chmod +x install-key-gen.sh
sudo ./install-key-gen.sh --systemThis approach works on most Linux distributions because it needs only a POSIX shell, Python 3, and the standard install command. It does not depend on a particular package manager.
Start the TUI:
key-genIt first asks you to choose a mode:
- Secure password — choose password length (8–32), security level (1–25), and result count (1–75).
- Memorable key — choose 4–12 randomly selected words, a separator (
-,., or_), and result count (1–75).
A memorable key looks similar to:
snow-rabbit-tulip-bluebird-daisy-dawn-citrus-stone
The words are chosen with cryptographically secure randomness. Use 8 or more words for important accounts. A conventional high-level random password is usually the better choice when a website accepts it and a password manager is available.
At any input prompt, type /exit, or press Ctrl+C, to quit.
Show the full table describing all 25 levels:
key-gen --helpDisable colors if needed:
key-gen --no-colorFor a user installation:
./install-key-gen.sh --user --uninstallFor a system-wide installation:
sudo ./install-key-gen.sh --system --uninstallPasswords are printed to the terminal. Do not run the tool in a shared terminal session or leave generated passwords visible on screen. Store important passwords in a reputable password manager.

