Skip to content

bilalbaraz/passgen

Repository files navigation

PassGen Banner

🔐 passgen — Generate passwords from the terminal

GitHub Release Codecov OpenSSF Scorecard OpenSSF Best Practices

PassGen Demo

A small Go CLI that generates secure random passwords with flexible character sets and exclusions.

Uses crypto/rand for cryptographically secure randomness. If no charset flags are provided, all sets are enabled by default.

Installation

Go

# latest
go install github.com/bilalbaraz/passgen@latest

# specific version
go install github.com/bilalbaraz/passgen@<version>

Homebrew

brew tap bilalbaraz/tap
brew install passgen

Linux amd64

wget -L https://github.com/bilalbaraz/passgen/releases/latest/download/passgen_linux_amd64.zip \
&& unzip passgen_linux_amd64.zip \
&& sudo mv passgen /usr/local/bin/ \
&& rm passgen_linux_amd64.zip

Linux arm64

wget -L https://github.com/bilalbaraz/passgen/releases/latest/download/passgen_linux_arm64.zip \
&& unzip passgen_linux_arm64.zip \
&& sudo mv passgen /usr/local/bin/ \
&& rm passgen_linux_arm64.zip

Quickstart

# basic (defaults to all character sets)
passgen --len 16 --count 3

# lower/upper/digits only
passgen --len 24 --count 5 --lower --upper --digits

# symbols only, excluding "@$"
passgen --len 20 --symbols --exclude "@$"

# exclude ambiguous characters (0 O 1 l I)
passgen --len 16 --no-ambiguous

# copy generated passwords to clipboard
passgen --len 20 --count 3 --copy

# render first password as QR code in terminal (requires -count 1)
passgen --len 20 --qr

Development

go run .
go build .
go run ./cmd/passgen
go build ./cmd/passgen
go test -v ./...

Command Surface

  • Length: --len <n> or -l <n>
  • Char sets: --lower, --upper, --digits, --symbols
  • Count: --count <n> or -c <n>
  • Exclude chars: --exclude "..." or -x "..."
  • No ambiguous: --no-ambiguous
  • Copy to clipboard: --copy or -p
  • QR code: --qr or -q (only when --count 1)
  • Help: -h / --help

Configuration

No config file. All behavior is controlled via CLI flags.

Notes

  • Errors are printed to stderr and exit with code 1 on invalid input.
  • -copy uses pbcopy (macOS), clip (Windows), or wl-copy/xclip (Linux).

About

Generate passwords from the terminal

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors

Languages