A simple and secure CLI password generator with optional local saving.
Don’t worry — we never store your passwords remotely.
All generated passwords are saved only on your local machine in a passwords.json file.
- Generate strong random passwords
- Options to exclude numbers or symbols
- Choose password length
- Interactive prompt to save passwords with a custom label
- Saved passwords stored locally in JSON format
Install globally from npm:
npm install -g genpasGenerate a password (default length = 12):
genpasGenerate a password of length 16:
genpas -len=16Exclude numbers:
genpas -nonumExclude symbols:
genpas -nosymShow help:
genpas -hIf you choose to save a password, it will be written to a local file named passwords.json.
Since genpas is installed globally, the file is saved inside the global npm node_modules folder.
- First, get the global root path:
npm root -gThis will print something like:
- Windows:
C:\Users\LENOVO\AppData\Roaming\npm\node_modules - macOS/Linux:
/usr/local/lib/node_modules
- Your saved passwords file will be here:
<npm-root>/genpas/passwords.json
To access your password you can easily do
cat <npm-root>/genpas/passwords.json
Windows (PowerShell)
Open in Notepad:
notepad ((npm root -g) + '\genpas\passwords.json')Print to console:
Get-Content ((npm root -g) + '\genpas\passwords.json') | Out-StringmacOS/Linux
Show contents:
cat "$(npm root -g)/genpas/passwords.json"Open in editor:
xdg-open "$(npm root -g)/genpas/passwords.json" # Linux
open "$(npm root -g)/genpas/passwords.json" # macOSSaving files inside node_modules isn’t ideal because updates may overwrite them.
In a future update, saved passwords will move to your home directory (e.g., ~/.genpas_passwords.json).
Clone the repo and run locally:
git clone https://github.com/<your-username>/genpas.git
cd genpas
npm install
node index.js -len=12MIT © 2025 Suryansh Garg