A secure, customizable password generator for the command line, Node.js and the browser. Generate random passwords, copy them to your clipboard, or embed the generator in your own app.
Try it in the browser: https://yarooqh.github.io/KeyLoom/
- π Cryptographically secure password generation using Node.js crypto module
- π Automatic clipboard copying for instant use
- βοΈ Highly customizable with various options and presets
- π Easy to use with simple commands and sensible defaults
- π― Multiple presets for different use cases (simple, strong, PIN)
- π§ Flexible character sets with inclusion/exclusion options
- π¦ Library + CLI - use it from the terminal or
importit in Node.js and browser apps - π Web app - an interactive generator, see
web/
npm install -g keyloomnpx keyloomGenerate a default 16-character password and copy to clipboard:
keyloom
# or
npx keyloomkeyloom [options] [command]-l, --length <number>- Password length (default: 16)--no-lowercase- Exclude lowercase letters--no-uppercase- Exclude uppercase letters--no-numbers- Exclude numbers--no-symbols- Exclude symbols (!@#$%^&*()_+-=[]{}|;:,.<>?). Symbols are included by default-x, --exclude-ambiguous- Exclude ambiguous characters (il1Lo0O)--no-copy- Don't copy to clipboard, just display-h, --help- Display help information-V, --version- Display version number
# Generate a 12-character password (includes symbols by default)
keyloom -l 12
# Generate a password without symbols
keyloom --no-symbols
# Generate a password without ambiguous characters
keyloom -x
# Generate a password and display it (don't copy to clipboard)
keyloom --no-copy
# Generate a password with only lowercase and numbers
keyloom --no-uppercase --no-symbolsGenerate a simple password with letters, numbers, and symbols (no ambiguous characters). Default: 12 characters:
keyloom simple
keyloom simple -l 10 # Custom length
keyloom simple --no-clipboard # Don't copy to clipboardGenerate a strong password with all character types (default: 20 characters):
keyloom strong
keyloom strong -l 24 # Custom length (default: 20)
keyloom strong --no-clipboard # Don't copy to clipboardGenerate a numeric PIN (default: 6 digits):
keyloom pin
keyloom pin -l 4 # 4-digit PIN
keyloom pin -l 8 # 8-digit PIN
keyloom pin --no-clipboard # Don't copy to clipboardYou can also use this package as a library in your Node.js or React/Next.js applications.
npm install keyloomimport { generatePassword } from 'keyloom';
// Generate a default password (16 chars, letters/numbers/symbols)
const password = generatePassword({ length: 16 });
console.log(password);import { generatePassword } from 'keyloom';
const password = generatePassword({
length: 24,
includeLowercase: true,
includeUppercase: true,
includeNumbers: true,
includeSymbols: true,
excludeAmbiguous: true // Exclude 'i', 'l', '1', 'L', 'o', '0', 'O'
});length is required. Lowercase, uppercase and numbers default to true; includeSymbols and excludeAmbiguous default to false in the library. generatePassword throws if no character set is selected.
It uses crypto.randomBytes in Node.js and window.crypto.getRandomValues in browsers for cryptographically secure generation in both environments.
- Lowercase:
abcdefghijklmnopqrstuvwxyz - Uppercase:
ABCDEFGHIJKLMNOPQRSTUVWXYZ - Numbers:
0123456789 - Symbols:
!@#$%^&*()_+-=[]{}|;:,.<>? - Ambiguous:
il1Lo0O(excluded when using-xflag)
Randomness comes from the platform's cryptographically secure generator (crypto.randomBytes in Node.js, window.crypto.getRandomValues in browsers), never Math.random(). Passwords are generated locally and are not sent anywhere. The CLI accepts lengths from 1 to 256.
- Node.js 14.0.0 or higher
- Clone the repository
- Install dependencies:
npm install - Link for local testing:
npm link - Test the CLI:
keyloom --help
Build the TypeScript sources with npm run build (or npm run dev to watch).
keyloom/
βββ src/
β βββ index.ts # Library: generatePassword, CHAR_SETS
β βββ passgen.ts # CLI entry point (compiled to dist/passgen.js)
βββ web/ # React + Vite web app (deployed to GitHub Pages)
βββ bin/ # Legacy CLI script
βββ package.json
βββ README.md
cd web
npm install
npm run devMIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Library export (
import { generatePassword } from 'keyloom') with browser support - Web app with an interactive generator
- Initial release
- Basic password generation with customizable options
- Clipboard integration
- Preset commands (simple, strong, pin)
- Comprehensive CLI interface