A flexible and secure command-line password generator written in Go.
- Set any password length
- Flexible inclusion of symbols, numbers, and uppercase letters
- Generate one or several passwords in a single command
- Colorized output for better readability in the terminal
-
Clone this repository
git clone https://github.com/myntdeveloper/passgen.git cd passgen -
Build the binary
go build -o passgen ./cmd
-
Generate a password with default settings
./passgen
This command outputs one 12-character password using only lowercase letters.
| Flag | Description | Default |
|---|---|---|
-l |
Length of password | 12 |
-s |
Include symbols | false |
-n |
Include numbers | false |
-u |
Include uppercase letters | false |
-c |
Number of passwords to generate | 1 |
Generate a 16-character password with symbols and numbers:
./passgen -l 16 -s -nGenerate 5 passwords, 20 characters each, including all character types:
./passgen -l 20 -s -n -u -c 5passgen/
├── cmd/ # Entry point of the CLI
│ └── main.go
├── internal/
│ └── generator/ # Password generation logic
│ └── generator.go
├── go.mod
└── README.md
- Go 1.19 or newer
Built with ❤️ by mynt