password-generator is a simple Python script that generates random and secure passwords.
It can be used for quickly creating strong passwords for personal use, secure accounts, or any situation requiring a high-entropy password.
✨ Features:
- Generate customizable passwords with various character sets
- Automatic clipboard copy - Generated passwords are automatically copied to your clipboard for easy pasting
- Simple command-line interface
Before using this tool, make sure you have:
- Python 3.8+
- pyperclip library (for clipboard functionality)
pip install pyperclipClone the repository:
git clone https://github.com/Axel-cmd/password-generator.git
cd password-generatorIf you want to execute the script directly like a normal command (without typing python before), follow these steps:
At the top of your password.py file, make sure there is:
#!/usr/bin/env python3In your project folder, run:
chmod +755 password.py4️⃣ Make it available everywhere
If you want to run it from anywhere in your system using only its name:
sudo cp password.py /usr/local/bin/passwordor the following command allowed the command for all users:
sudo cp password.py /bin/passwordThen simply use:
passwordBelow is the list of available commands and options supported by the script.
| Command | Description |
|---|---|
password |
Generates an 8-character password using lowercase letters only (default). |
password <length> |
Generates a password with the specified length. |
password <length> [options] |
Generates a password with custom length and optional character sets (see options below). |
You can add one or several options when generating a password:
| Option | Description |
|---|---|
-u |
Adds uppercase letters to the password. |
-d |
Adds digits (0-9). |
-s |
Adds special characters. |
--help |
Display options for the command password in the console. |
password # 8 lowercase characters (default)
password 12 # 12 lowercase characters
password 16 -u # 16 chars, including uppercase
password 20 -ud # 20 chars, uppercase + digits
password 24 -uds # 24 chars, all character sets
password --help # list all options💡 Note: All generated passwords are automatically copied to your clipboard, so you can paste them directly where needed!