pwgen-cli
v1.0.1
Published
Interactive terminal password generator with clipboard support.
Readme
Password Generator CLI
Interactive and flag-driven password generator with clipboard support.
Installation
Install globally from the project directory
npm install -g .After publishing to the npm registry you can install it directly:
npm install -g pwgen-cliUsage
Once installed globally, run the CLI from anywhere:
pwgenFollow the prompts to select the password length and character sets. The generated password is copied to your clipboard automatically.
Non-interactive mode
Skip the prompts and configure the generator with flags:
pwgen --length 24 --symbols --no-copyShortcuts:
pwgen --lowercase # only lowercase letters
pwgen --lowercase --symbols # lowercase + symbols
pwgen --count 10 --raw # 10 passwords, plain outputAvailable flags:
--length <number>Password length (5-128, default 16)--count <number>Generate multiple passwords at once (1-50, default 1)--[no-]lowercaseInclude lowercase letters (defaulttrue)--[no-]uppercaseInclude uppercase letters (defaulttrue)--[no-]numbersInclude digits (defaulttrue)--[no-]symbolsInclude symbols (defaultfalse)--[no-]copyCopy result to the system clipboard (defaulttrue)--[no-]bannerToggle the ASCII art banner (defaulttruein TTYs)--rawPrint the generated password(s) only (no colors/banner)--helpShow the help screen--versionPrint the CLI version
When you specify any positive character flag, unspecified sets default to off—so pwgen --lowercase produces a lowercase-only password, while --no- flags simply disable individual sets.
Custom defaults
Set your own defaults by creating ~/.config/pwgen/config.json (or point PWGEN_CONFIG to another JSON file):
{
"length": 24,
"count": 3,
"lowercase": true,
"uppercase": false,
"numbers": true,
"symbols": true,
"copy": false,
"banner": false,
"raw": true
}Any value you provide overrides the built-in defaults, and CLI flags still win over the config.
