Cryptographically secure CLI password generator for macOS, Linux & Windows.
nJ0aK-6V96F-zMtQs-o8kuh-sZty9 ← passgen -
X7&kP2!qL9mR@wZ# ← passgen -length 16
mrwlN_XfZNo_awT1y_wDrPk_JY6X9 ← passgen _
crypto/rand— genuinely unpredictable, notmath/rand- Quick mode —
passgen -orpassgen _for an instant segmented password - Interactive mode — guided step-by-step prompts when run with no flags
- Segmented passwords — configurable segments, length & separator (
-/_) - Auto clipboard — every generated password is copied instantly
- Zero dependencies — pure Go stdlib, single static binary
Go to Releases and download the binary for your platform.
macOS / Linux:
# Apple Silicon
tar xzf passgen-1.0.0-macos-arm64.tar.gz
sudo mv passgen /usr/local/bin/
# Intel Mac
tar xzf passgen-1.0.0-macos-intel.tar.gz
sudo mv passgen /usr/local/bin/
# Linux x64
tar xzf passgen-1.0.0-linux-amd64.tar.gz
sudo mv passgen /usr/local/bin/Windows:
Extract passgen-1.0.0-windows-amd64.zip and move passgen.exe to a folder in your PATH.
Requires Go 1.21+.
git clone https://github.com/devthedeveloper/passgen.git
cd passgen
go install .Or install directly without cloning:
go install github.com/devthedeveloper/passgen@latestMake sure
$GOPATH/bin(usually~/go/bin) is in yourPATH. Add this to your~/.zshrcor~/.bashrc:export PATH="$PATH:$HOME/go/bin"
passgen - # instant segmented: nJ0aK-6V96F-zMtQs-o8kuh-sZty9
passgen _ # instant segmented: mrwlN_XfZNo_awT1y_wDrPk_JY6X9Generates 5 segments × 5 chars, uppercase + lowercase + digits, copies to clipboard.
passgenWalks you through all options step by step — type, length, character sets, count.
passgen -length 32
passgen -count 5
passgen -no-symbols
passgen -no-upper -no-symbols # lowercase + digits only
passgen -exclude "0OIl1" # strip ambiguous characters
passgen -length 24 -count 3 -no-copy # no clipboard copypassgen -type segment # ab3k-n9xQ-r7mW (default)
passgen -type segment -segments 4 -seg-length 6 # ab3k2f-n9xQt1-r7mWp0-02yLs8
passgen -type segment -separator _ # ab3k_n9xQ_r7mW
passgen -type segment -no-upper # lowercase + digits only| Flag | Default | Description |
|---|---|---|
-type |
random |
Password type: random or segment |
-length |
16 |
Password length (random mode) |
-count |
1 |
Number of passwords to generate |
-no-upper |
false |
Exclude uppercase A–Z |
-no-lower |
false |
Exclude lowercase a–z |
-no-digits |
false |
Exclude digits 0–9 |
-no-symbols |
false |
Exclude symbols !@#$... (random only) |
-exclude |
"" |
Specific characters to exclude |
-segments |
3 |
Number of segments (segment mode) |
-seg-length |
4 |
Characters per segment (segment mode) |
-separator |
- |
Segment separator: - or _ |
-no-copy |
false |
Skip copying to clipboard |
./build.sh 1.1.0 # cross-compiles for all platforms into dist/Produces binaries for:
macos-arm64(Apple Silicon)macos-intel(x86_64)linux-amd64linux-arm64windows-amd64
MIT © devthedeveloper