linenoise-cli is a command-line tool that generates strings of random characters that can be used as reasonably secure passwords.

Passwords are, by default, chosen from the union of three character classes: upper-case letters, lower-case letters, and digits.

Options can be given to omit any one or any two of these character classes. For instance, you can omit uppercase letters and digits by passing --upper=false --digit=false to linenoise-cli. This will return a password composed only of lowercase letters.

Passwords are guaranteed to contain at least one of each selected character class. The default length is 16. linenoise-cli will create a password of any length greater than or equal to the number of character classes selected.

If the password length is less than or equal to the total number of characters selected, linenoise-cli will not repeat characters within the generated password.


The usual go build works.

Once the binary is built, linenoise-cli completion [shell] will generate completion files for bash, zsh, fish, or powershell.


Command Line

linenoise-cli is a command-line tool that generates strings of
random characters that can be used as reasonably secure passwords.

  linenoise-cli [flags]
  linenoise-cli [command]

Available Commands:
  completion  Generate completion script
  help        Help about any command

      --digit        include digits (default true)
  -h, --help         help for linenoise-cli
      --length int   length (default 16)
      --lower        include lowercase (default true)
      --upper        include uppercase (default true)

Use "linenoise-cli [command] --help" for more information about a command.

$ linenoise-cli
$ linenoise-cli --length=8
$ linenoise-cli --length=64
$ linenoise-cli --length=0
2017/10/31 16:04:47 Invalid length - must be an integer greater than 2
$ linenoise-cli --lower=false
$ linenoise-cli --upper=false --length=8
$ linenoise-cli --lower=false --upper=false --length=32
$ linenoise-cli --lower=false --upper=false --digit=false
2021/10/02 21:38:36 must include at least one of --lower, --upper and/or --digit
exit status 1

Configuration File

linenoise-cli supports an optional configuration file. It must be in a format supported by viper, such as YAML, TOML, or JSON; be named config.XXXX with the proper format suffix; be located in $HOME/Library/Application Support/linenoise-cli (macOS) or $XDG_CONFIG_HOME/linenoise-cli (other Unix) or /etc/linenoise-cli; and use the command line options as keys.

For example, this data in config.yaml would replicate the default configuration of linenoise-cli:

length: 16
upper: true
lower: true
digit: true

Configuration is also possible using environment variables. For example, these environment variables would replicate the default configuration of linenoise-cli:


(To disable uppercase, lowercase, or digits, set the appropriate variable to 0.)

Values given on the command line take precedence over values given in the configuration file or in environment variables.


This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

linenoise-cli is available as open source under the terms of the MIT License.


View Github