pswg

command module
v0.5.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2026 License: MIT Imports: 7 Imported by: 0

README

pswg

Go Version CI Version

pswg is a small experimental password generator written while learning Go.

It uses crypto/rand for character selection and shuffling, keeps the generated password within a configurable length, and can require a minimum number of uppercase, special, and numeric characters.

Experimental software: use it as a learning project. It has not been audited as a security tool.

Install

go install github.com/olelbis/pswg@v0.5.0-alpha

Usage

Generate a password with the default policy. The password is printed by itself on stdout, so it can be used in scripts:

pswg

Generate a 16-character password with 2 uppercase letters, 2 special characters, and 2 numbers:

pswg -l 16 -u 2 -s 2 -n 2

Print the current version:

pswg -version

Options

-l int
    Password length. Default: 12. Maximum: 128.
-u int
    Number of uppercase characters. Default: 1.
-s int
    Number of special characters. Default: 1.
-n int
    Number of numeric characters. Default: 1.
--silent
    Exit without output.
-version
    Print the current version.

Build

Run the full local check:

make check

Build a local binary with version metadata:

make build
./bin/pswg -version

Build release-style binaries for supported targets:

make dist

Notes

  • Minimum password length is 12 characters.
  • Maximum password length is 128 characters.
  • Requested character counts cannot be negative or exceed the password length.
  • When possible, the generated password is shuffled so it does not start with a number.

License

MIT. See LICENSE.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL