Secure, minimal, and fast command-line password generator for professionals.
passgen is a compact Node.js CLI that produces cryptographically secure passwords using the Node crypto API. It provides sensible presets (weak, medium, strong, ultra) and fine-grained flags for including/excluding uppercase, lowercase, numbers, and symbols.
- Uses Node's built-in
crypto.randomIntfor secure randomness - Preset strength modes (weak, medium, strong, ultra)
- CLI-friendly flags and positional preset (e.g.
passgen ultra) - Small single-file implementation for easy auditing and embedding
Install globally from npm:
npm install -g @asimawdah/passgenOr run without installing using npx:
npx @asimawdah/passgen ultraTo install from the repository directory (local testing):
npm install -g .Basic usage with preset:
passgenResult: Y@XE4+mNi1dh
Using flags:
passgen --mode strong
passgen -l 20 -u true -lc true -n true -s false-l,--length(number): Password length (default: 12)-u,--upper(boolean): Include uppercase letters-lc,--lower(boolean): Include lowercase letters-n,--numbers(boolean): Include digits-s,--symbols(boolean): Include symbols--mode(string): Preset mode —weak | medium | strong | ultra-i,--info(boolean): Show password strength and entropy info
# Generate an ultra password (32 chars)
passgen ultra
# Strong preset
passgen --mode strong
# Custom length without symbols
passgen -l 16 -s false- passgen relies on Node's
cryptofor random number generation; do not use non-cryptographic RNGs for password generation. - Avoid piping passwords through logs or unencrypted channels.
Contributions and issues are welcome. Please open an issue or submit a pull request following standard Node.js project conventions. Run the test suite locally using:
npm testMIT — see the LICENSE file.