password-generator

password-generator

Table of Contents

This is a list of all the sections in this post. Click on any of them to jump to that section.

password-generator

License: MIT

📝 Description

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

📦 Requirements

Before using this tool, make sure you have:

  • Python 3.8+
  • pyperclip library (for clipboard functionality)

Install dependencies

pip install pyperclip

🛠 Installation

Clone the repository:

git clone https://github.com/Axel-cmd/password-generator.git
cd password-generator

▶️ Run the script without typing python (Linux)

If you want to execute the script directly like a normal command (without typing python before), follow these steps:

1️⃣ Add a shebang at the top of your script

At the top of your password.py file, make sure there is:

#!/usr/bin/env python3

2️⃣ Make the file executable

In your project folder, run:

chmod +755 password.py

4️⃣ 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/password

or the following command allowed the command for all users:

sudo cp password.py /bin/password

Then simply use:

password

🧰 Command Help & Options

Below is the list of available commands and options supported by the script.

📌 Basic Commands

CommandDescription
passwordGenerates an 8-character password using lowercase letters only (default).
password Generates a password with the specified length.
password [options]Generates a password with custom length and optional character sets (see options below).

🔧 Available Options

You can add one or several options when generating a password:

OptionDescription
-uAdds uppercase letters to the password.
-dAdds digits (0-9).
-sAdds special characters.
--helpDisplay options for the command password in the console.

📝 Example Usage

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!